JP7133979B2 - Image processing device, image processing method, image processing program, and storage medium - Google Patents
Image processing device, image processing method, image processing program, and storage medium Download PDFInfo
- Publication number
- JP7133979B2 JP7133979B2 JP2018099369A JP2018099369A JP7133979B2 JP 7133979 B2 JP7133979 B2 JP 7133979B2 JP 2018099369 A JP2018099369 A JP 2018099369A JP 2018099369 A JP2018099369 A JP 2018099369A JP 7133979 B2 JP7133979 B2 JP 7133979B2
- Authority
- JP
- Japan
- Prior art keywords
- image
- ratio
- synthesis
- pixel
- positional deviation
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000012545 processing Methods 0.000 title claims description 98
- 238000003672 processing method Methods 0.000 title claims description 6
- 230000015572 biosynthetic process Effects 0.000 claims description 179
- 238000003786 synthesis reaction Methods 0.000 claims description 179
- 239000013598 vector Substances 0.000 claims description 79
- 238000006073 displacement reaction Methods 0.000 claims description 73
- 239000002131 composite material Substances 0.000 claims description 68
- 239000000203 mixture Substances 0.000 claims description 48
- 238000000034 method Methods 0.000 claims description 38
- 230000002194 synthesizing effect Effects 0.000 claims description 29
- 238000012937 correction Methods 0.000 claims description 15
- 230000007423 decrease Effects 0.000 claims description 8
- 230000008569 process Effects 0.000 claims description 7
- 238000012804 iterative process Methods 0.000 claims description 3
- 235000019557 luminance Nutrition 0.000 description 44
- 238000004364 calculation method Methods 0.000 description 20
- 238000003384 imaging method Methods 0.000 description 16
- 230000006870 function Effects 0.000 description 15
- 238000010586 diagram Methods 0.000 description 8
- 230000000694 effects Effects 0.000 description 8
- 238000005316 response function Methods 0.000 description 8
- 229920006395 saturated elastomer Polymers 0.000 description 6
- 238000006243 chemical reaction Methods 0.000 description 3
- 230000002411 adverse Effects 0.000 description 2
- 239000003086 colorant Substances 0.000 description 2
- 230000009466 transformation Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 238000009499 grossing Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000007935 neutral effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
- 238000004904 shortening Methods 0.000 description 1
- 238000000844 transformation Methods 0.000 description 1
Images
Landscapes
- Studio Devices (AREA)
- Image Processing (AREA)
- Editing Of Facsimile Originals (AREA)
Description
本発明は、露光条件が異なり、互いに対応する第1画像及び第2画像に基づく合成を行う画像処理装置、画像処理方法、プログラム、及び、当該プログラムを記憶した記憶媒体に関する。 The present invention relates to an image processing apparatus, an image processing method, a program, and a storage medium storing the program, which perform composition based on first and second images that have different exposure conditions and correspond to each other.
一般的な撮像装置では、一回の撮像で取得することができる明るさの範囲(ダイナミックレンジ)は限られている。そのため、極端に異なる暗部と明部とが共に含まれるシーン(景色)においては、撮像画像に黒つぶれや白とびが発生することがある。露光時間を短くした場合には、明部での白とびを抑えられるが、暗部にて黒つぶれが生じて視認性が低下した画像となる。一方、露光時間を長くした場合には、暗部での黒つぶれを抑えられるが、明部にて白とびが生じてテクスチャが失われた画像となる。 A general imaging device has a limited range of brightness (dynamic range) that can be acquired in one imaging. Therefore, in a scene (landscape) including both dark and bright areas that are extremely different from each other, the captured image may suffer from crushed shadows and blown highlights. When the exposure time is shortened, the overexposure in bright areas can be suppressed, but the underexposure occurs in dark areas, resulting in an image with reduced visibility. On the other hand, when the exposure time is lengthened, the blocked-up shadows in the dark areas can be suppressed, but the blown-out highlights occur in the bright areas, resulting in an image with lost texture.
そこで、露光条件が異なる複数の画像を合成してダイナミックレンジの広い画像を生成するハイダイナミックレンジ(HDR)合成技術が提案されている。例えば、特許文献1では、同一シーンにおいて短露光時間画像と長露光時間画像とを取得し、これら二つの画像の輝度値に基づいて各画像の合成比率を画素毎に決定し、決定した合成比率に基づいて二つの画像を合成する。この際、暗部では長露光時間画像の合成比率が大きくなり、明部では短露光時間画像の合成比率が大きくなるように合成比率が決定される。
Therefore, a high dynamic range (HDR) synthesis technique has been proposed for synthesizing a plurality of images with different exposure conditions to generate an image with a wide dynamic range. For example, in
しかしながら、以上のようなHDR合成技術では、合成前の複数の画像間に位置ずれがある場合に、それら画像を合成した合成画像において、ぶれや二重像(ゴースト)等の弊害が発生する課題がある。とくに、露光条件を変えた複数の画像を位置が異なるセンサを用いて同一の被写体を撮像する場合や、移動体に搭載した撮像装置を用いて時分割で同一の被写体を撮像する場合などにおいては、複数の画像同士の間に視差が生じる。つまり、複数の画像の撮影時において撮像装置に対する被写体の奥行き距離が異なる場合には、複数の画像同士の間に被写体の位置ずれが局所的に生じ、その結果として、ぶれや二重像(ゴースト)等の弊害が発生する。 However, with the HDR synthesis technology as described above, when there is a positional deviation between a plurality of images before synthesis, there is a problem that adverse effects such as blurring and double images (ghosts) occur in the synthesized image obtained by synthesizing these images. There is In particular, when the same subject is imaged using sensors at different positions with multiple images with different exposure conditions, or when the same subject is imaged by time division using an imaging device mounted on a moving object. , parallax occurs between a plurality of images. In other words, if the depth distance of the subject with respect to the imaging device differs when multiple images are captured, the position of the subject locally shifts between the multiple images, resulting in blurring and double images (ghosts). ), etc. will occur.
こうした弊害を抑制するために、複数の画像の位置ずれを高密度(例えば、画素毎)で検出し、複数の画像を位置ずれ補正して合成する技術が知られている。特許文献2では、視差があり、かつ露光量が異なる複数の入力画像に対し、画像輝度調整を行ったうえでマッチングを行い、全ての画素についてマッチング情報を求め、求められたマッチング情報に基づいて複数の画像を位置校正して合成する技術が開示されている。
In order to suppress such an adverse effect, a technique is known that detects the positional deviation of a plurality of images at a high density (for example, for each pixel), corrects the positional deviation of the plurality of images, and synthesizes the images. In
しかしながら、特許文献2に記載の技術では、黒つぶれしている領域、及び、白とびしている領域を含む全ての画素に対して位置ずれ探索を行う。つまり、基準とする画像において黒つぶれしている領域または白とびしている領域を他の露光条件の画像で置き換える合成処理だけで十分である場合にも、位置ずれ探索を全ての画素に対して行う。このため画像処理が非効率となっており、処理時間の短縮化に改善の余地がある。
However, in the technique described in
そこで、本発明は、上記のような問題点を鑑みてなされたものであり、合成によって生成される画像の品位を保ちつつ、位置ずれ探索にかかる処理時間を低減可能な技術を提供することを目的とする。 Accordingly, the present invention has been made in view of the above problems, and aims to provide a technique capable of reducing the processing time required for searching for misregistration while maintaining the quality of an image generated by synthesis. aim.
本発明に係る画像処理装置は、露光条件が異なり、互いに対応する第1画像及び第2画像に基づく合成を行う画像処理装置であって、前記第1画像の輝度値に基づいて、前記第1画像及び前記第2画像の合成を行った場合の、前記第1画像及び前記第2画像の一方の画像の合成における画素毎の第1合成比率を決定する第1合成比率決定部と、前記第2画像の輝度値に基づいて、前記第1画像及び前記第2画像の合成を行った場合の、前記一方の画像の合成における画素毎の第2合成比率を決定する第2合成比率決定部と、前記第1合成比率及び前記第2合成比率に基づいて、前記第1画像と前記第2画像との間の位置ずれが、前記第1画像及び前記第2画像の合成を行った場合に生成される合成画像の輝度に影響する程度を、位置ずれ顕著性として画素毎に判定する位置ずれ顕著性判定部と、前記位置ずれ顕著性に基づいて、位置ずれ探索に要する処理量を変更しつつ、当該位置ずれ探索によって前記第1画像と前記第2画像との間の画素毎の動きベクトルを算出する重み付き動きベクトル算出部と、前記第1画像と、前記第2画像と、前記動きベクトルとに基づく合成を行うことによって、第3画像を生成する画像生成部とを備える。 An image processing apparatus according to the present invention is an image processing apparatus that combines a first image and a second image that have different exposure conditions and that correspond to each other. a first synthesis ratio determination unit that determines a first synthesis ratio for each pixel in synthesis of one of the first image and the second image when the image and the second image are synthesized; a second synthesis ratio determination unit that determines a second synthesis ratio for each pixel in synthesis of the one image when the first image and the second image are synthesized based on the luminance values of the two images; , based on the first composition ratio and the second composition ratio, the displacement between the first image and the second image is generated when the first image and the second image are composited. A misalignment saliency determination unit that determines, for each pixel, the degree of influence on the luminance of a synthesized image to be processed as misalignment saliency; a weighted motion vector calculator for calculating a motion vector for each pixel between the first image and the second image by the positional displacement search; the first image, the second image, and the motion vector; and an image generation unit that generates a third image by performing synthesis based on the above.
本発明によれば、第1合成比率及び第2合成比率に基づいて、第1画像と第2画像との間の位置ずれが、第1画像及び第2画像の合成を行った場合に生成される合成画像の輝度に影響する程度を、位置ずれ顕著性として画素毎に判定し、位置ずれ顕著性に基づいて、位置ずれ探索に要する処理量を変更しつつ、当該位置ずれ探索によって第1画像と第2画像との間の画素毎の動きベクトルを算出する。このような構成によれば、合成によって生成される画像の品位を保ちつつ、位置ずれ探索にかかる処理時間を低減することができる。 According to the present invention, the displacement between the first image and the second image is generated when the first image and the second image are synthesized based on the first synthesis ratio and the second synthesis ratio. The degree of influence on the brightness of the composite image is determined for each pixel as the salience of positional deviation, and based on the salience of positional deviation, while changing the amount of processing required for searching for positional deviation, the positional deviation search is performed to obtain the first image. A motion vector for each pixel between and the second image is calculated. According to such a configuration, it is possible to reduce the processing time required for searching for misregistration while maintaining the quality of the image generated by combining.
<実施の形態1>
図1は、本発明の実施の形態1に係る画像処理装置の構成を示すブロック図である。
<
FIG. 1 is a block diagram showing the configuration of an image processing apparatus according to
本実施の形態1に係る画像処理装置は、露光条件が異なり、互いに対応する第1画像ImgA及び第2画像ImgBに基づく合成を行うことによって、第3画像ImgCを生成して出力する。図1の画像処理装置は、第1合成比率決定部1aと、第2合成比率決定部1bと、位置ずれ顕著性判定部2と、重み付き動きベクトル算出部3と、画像生成部4とを備える。 The image processing apparatus according to the first embodiment generates and outputs the third image ImgC by synthesizing the first image ImgA and the second image ImgB that correspond to each other under different exposure conditions. The image processing device of FIG. Prepare.
第1合成比率決定部1aは、第1画像ImgAの輝度値に基づいて、第1画像ImgA及び第2画像ImgBの合成を行った場合の、第1画像ImgA及び第2画像ImgBの一方の画像の合成における画素毎の第1合成比率WeiAを決定する。第2合成比率決定部1bは、第2画像ImgBの輝度値に基づいて、第1画像ImgA及び第2画像ImgBの合成を行った場合の、上記一方の画像の合成における画素毎の第2合成比率WeiBを決定する。本実施の形態1では、第1画像ImgA及び第2画像ImgBの一方の画像は、第1画像ImgAであるものとする。なお以下の説明では、画素毎の第1合成比率WeiAによって形成される画像を、第1合成比率画像WeiAと記すこともあり、画素毎の第2合成比率WeiBによって形成される画像を、第2合成比率画像WeiBと記すこともある。また、以下の説明では、第1合成比率WeiA及び第2合成比率WeiBを区別しない場合には単に合成比率と記すこともある。
The first combining ratio determining unit 1a determines the value of one of the first image ImgA and the second image ImgB when combining the first image ImgA and the second image ImgB based on the luminance value of the first image ImgA. determines a first synthesis ratio WeiA for each pixel in the synthesis of . The second synthesis
位置ずれ顕著性判定部2は、第1合成比率WeiA及び第2合成比率WeiBに基づいて、第1画像ImgAと第2画像ImgBとの間の位置ずれが、第1画像ImgA及び第2画像ImgBの合成を行った場合に生成される合成画像の輝度に影響する程度を、位置ずれ顕著性Impとして画素毎に判定する。位置ずれ顕著性Impは、合成画像において位置ずれの影響が目立つ程度に実質的に相当する。また、この位置ずれ顕著性Impは、第1合成比率画像WeiA及び第2合成比率画像WeiBの合成を行った場合に生成される画像の輝度に影響する程度に相当する。なお以下の説明では、画素毎の位置ずれ顕著性Impによって形成される画像を、位置ずれ顕著性画像Impと記すこともある。
Based on the first synthesis ratio WeiA and the second synthesis ratio WeiB, the positional displacement
重み付き動きベクトル算出部3は、位置ずれ顕著性Impに基づいて、位置ずれ探索(位置ずれ検出)に要する処理量を変更しつつ、当該位置ずれ探索によって第1画像ImgAと第2画像ImgBとの間の画素毎の動きベクトルWを算出する。なお、位置ずれ探索に要する処理量を変更することは、位置ずれ探索の粒度を変更することに相当する。
The weighted motion
画像生成部4は、第1画像ImgAと、第2画像ImgBと、動きベクトルWとに基づく合成を行うことによって、第3画像ImgCを生成する。本実施の形態1では、この画像生成部4は、位置補正部4aと、合成部4bとを備える。
The image generator 4 generates a third image ImgC by combining the first image ImgA, the second image ImgB, and the motion vector W. FIG. In
位置補正部4aは、動きベクトルWに基づいて第1画像ImgA及び第2画像ImgBの他方の画像の位置を画素毎に補正する。第1画像ImgA及び第2画像ImgBの他方の画像は、上述した一方の画像と異なる画像である。本実施の形態1では、他方の画像は、第2画像ImgBであるものとする。位置補正部4aの補正によって、位置補正後の第2画像ImgBwが生成される。
The
合成部4bは、第1合成比率WeiAまたは第2合成比率WeiBに基づいて、一方の画像と、位置が補正された他方の画像とを重み付け加算する合成を行うことによって、第3の画像を生成する。本実施の形態1では、合成部4bは、第1合成比率WeiAに基づいて、第1画像ImgAと、位置補正後の第2画像ImgBwとを重み付け加算する合成を行うことによって、第3の画像ImgCを生成する。
The synthesizing
以下、各構成要素について詳細に説明する。 Each component will be described in detail below.
<第1画像ImgA及び第2画像ImgB>
本実施の形態1に係る画像処理装置には、露光条件が異なり、互いに対応する2枚の画像Ia,Ibが入力される。露光条件とは、撮像装置における露光時間、絞り、素子感度、減光フィルタ等の設定値であり、露光量を制御する条件の全てをいう。本実施の形態1では、互いに対応する2枚の画像は、互いの間に視差がある2枚の画像であるものとする。このような2枚の画像は、例えば、位置が異なるセンサを用いて同一の撮影対象(被写体及びシーンなど)を撮像して得られる2枚の画像、または、移動体に搭載した撮像装置を用いて時分割で同一の撮影対象を撮像して得られる2枚の画像などである。2枚の画像の撮影時において撮像装置に対する被写体の奥行き距離が異なる場合には、2枚の画像同士の間に被写体の位置ずれが局所的に生じる。本実施の形態1に係る画像処理装置は、局所的な位置ずれが生じた複数の画像を、位置ずれ補正して合成する。ただし、互いに対応する2枚の画像は、互いの間に視差がない2枚の画像であってもよい。
<First Image ImgA and Second Image ImgB>
The image processing apparatus according to the first embodiment receives two images Ia and Ib that correspond to each other under different exposure conditions. The exposure conditions are set values such as the exposure time, aperture, device sensitivity, and neutral density filter in the imaging device, and refer to all the conditions for controlling the amount of exposure. In the first embodiment, two images corresponding to each other are two images with parallax therebetween. Such two images are, for example, two images obtained by imaging the same object (subject, scene, etc.) using sensors at different positions, or using an imaging device mounted on a moving object. For example, two images obtained by imaging the same subject in a time division manner. If the depth distance of the subject with respect to the imaging device differs when the two images are captured, the position of the subject locally shifts between the two images. The image processing apparatus according to the first embodiment synthesizes a plurality of images with localized positional deviations after correcting the positional deviations. However, the two images corresponding to each other may be two images with no parallax between them.
本実施の形態1では、2枚の画像のうち、位置補正が行われない、位置の基準となる画像(以後、基準画像と呼ぶこともある)を第1画像とする。一方、位置補正が行われ、基準画像と位置が合うように画像が変形される方の画像(以後、参照画像と呼ぶこともある)を第2画像とする。 In the first embodiment, of the two images, an image that is not subjected to position correction and serves as a position reference (hereinafter also referred to as a reference image) is the first image. On the other hand, the image (hereinafter also referred to as the reference image) that has undergone position correction and is deformed so as to match the position of the reference image is referred to as the second image.
ここで、第1画像及び第2画像は、撮像画像の露光条件が異なれば、どちらを基準画像(または参照画像)に選択してよい。すなわち、露光の少ない方の画像を第1画像(基準画像)、露光の多い方の画像を第2画像(参照画像)としてもよいし、または、その逆であってもよい。ただし、黒つぶれしている領域、及び、白とびしている領域の面積が小さい方の画像を第1画像(基準画像)として選ぶ方が好適である。以下では、説明を平易にするため、露光の少ない画像は第1画像(基準画像)であり、露光の多い画像は第2画像(参照画像)であるものとして説明する。 Here, either the first image or the second image may be selected as the standard image (or the reference image) as long as the exposure conditions of the captured images are different. That is, the less exposed image may be used as the first image (reference image), and the more exposed image may be used as the second image (reference image), or vice versa. However, it is preferable to select, as the first image (reference image), the image in which the area of the blocked-up shadow area and the area of the blown-out area are smaller. In the following description, for the sake of simplicity, the image with low exposure is the first image (reference image), and the image with high exposure is the second image (reference image).
また、位置合わせや合成の処理に先立ち、撮像画像の露光条件及びカメラレスポンス関数(CRF;Camera Response Function)を考慮して、明るさが合わせられた2枚の画像を第1画像及び第2画像としてもよい。 In addition, prior to the alignment and composition processing, the two images whose brightness is adjusted are selected as the first image and the second image in consideration of the exposure condition of the captured image and the camera response function (CRF). may be
カメラレスポンス関数とは、撮像画像の画素値と、シーンの放射輝度との関係を記述するものである。一般的な撮像装置では、画像検出器において、シーンの放射輝度に対し線形な信号を出力することが多いが、撮像装置によっては、画像生成過程において、当該信号にガンマ補正などの非線形な階調変換を施すこともある。これらの過程における変換を一つにまとめて、シーンの放射輝度を最終的な撮像画像の画素値に変換する関数は、カメラレスポンス関数と呼ばれる。カメラレスポンス関数の逆関数であり、撮像画像の画素値をシーンの放射輝度に変換する関数は、カメラレスポンス逆関数と呼ばれる。カメラレスポンス関数及びその逆関数は、放射輝度が既知である被写体を撮影し、その撮像画像に基づいて関数を校正する方法、露光時間のみを変えて被写体を撮像し、その撮影画像に基づいて関数を推定する方法、などの公知の方法によって求めることができる。 A camera response function describes the relationship between the pixel values of a captured image and the radiance of a scene. In general imaging devices, the image detector often outputs a linear signal with respect to the radiance of the scene. It may also be converted. A function that integrates the transformations in these processes and transforms the radiance of the scene into the pixel values of the final captured image is called the camera response function. A function that is the inverse of the camera response function and converts the pixel values of the captured image into the radiance of the scene is called the inverse camera response function. The camera response function and its inverse function are obtained by photographing a subject whose radiance is known and calibrating the function based on the captured image, imaging the subject by changing only the exposure time, and calculating the function based on the captured image. can be obtained by a known method such as a method of estimating .
以下では、撮像画像の各々に対応するカメラレスポンス逆関数が校正等により予め求められており、当該カメラレスポンス逆関数を示すLUT(Look Up Table)や多項式が与えられているものとして説明する。 In the following description, it is assumed that an inverse camera response function corresponding to each captured image is obtained in advance by calibration or the like, and that a LUT (Look Up Table) or polynomial representing the inverse camera response function is given.
露光条件を変えて撮像した画像Ia,Ibの明るさを合わせることによって画像Ia’,Ib’に生成する処理は、例えば次式(1)及び次式(2)にて表される。これらの式によれば、実質的に画像Ia,Ibの明るさが規格化されている。 The process of generating the images Ia' and Ib' by matching the brightness of the images Ia and Ib captured under different exposure conditions is represented by the following equations (1) and (2), for example. According to these formulas, the brightness of the images Ia and Ib is substantially normalized.
なお、式(1)及び式(2)で、pは画素位置であり、Ia(p),Ib(p)は画像Ia,Ibにおける画素位置pの画素値をそれぞれ表す(以下、画像データの画素値を表す場合には同様の表記を用いる)。また、fa,fbは画像Ia,Ibのカメラレスポンス逆関数であり、Ea,Ebは画像Ia,Ibの露光量Ea,Ebであり、Kは任意の定数である。 In equations (1) and (2), p is the pixel position, and I a (p) and I b (p) represent pixel values at pixel position p in images Ia and Ib (hereinafter referred to as image The same notation is used when representing pixel values of data). In addition, f a and f b are camera response inverse functions of the images Ia and Ib, E a and E b are the exposure amounts Ea and Eb of the images Ia and Ib, and K is an arbitrary constant.
以下、説明を平易にするため、撮像画像の画素値を放射輝度(に線形な値)に変換することで明るさを合わせた画像を第1画像及び第2画像として入力するものとする。すなわち、式(1)で表される画像Ia’が、図1の第1画像ImgAであるとし、式(2)で表される画像Ib’が、図1の第2画像ImgBであるものとして以下説明する。 In the following, for the sake of simplicity, it is assumed that images whose brightness is adjusted by converting the pixel values of the captured image into (linear values of) radiance are input as the first and second images. That is, assuming that the image Ia' represented by equation (1) is the first image ImgA in FIG. 1, and the image Ib' represented by equation (2) is the second image ImgB in FIG. It is explained below.
<第1合成比率決定部1a及び第2合成比率決定部1b>
第1合成比率決定部1aは、第1画像ImgAの輝度値に基づいて、第1画像ImgA及び第2画像ImgBの合成を行った場合の、第1画像ImgAの合成における画素毎の第1合成比率WeiAを決定して、第1合成比率画像WeiAを生成する。
<First Synthesis Ratio Determination Unit 1a and Second Synthesis
Based on the luminance value of the first image ImgA, the first synthesis ratio determining unit 1a performs the first synthesis for each pixel in the synthesis of the first image ImgA when the first image ImgA and the second image ImgB are synthesized. A ratio WeiA is determined to generate a first composite ratio image WeiA.
なお、第1合成比率画像WeiAの画素値、及び、後述する第2合成比率画像WeiBの画素値はいずれも、第1画像ImgA及び第2画像ImgBの合成を行った場合の第1画像ImgAの合成比率(重み付け)を表す。 Note that the pixel values of the first composite ratio image WeiA and the pixel values of a second composite ratio image WeiB, which will be described later, are both the values of the first image ImgA when the first image ImgA and the second image ImgB are composited. Represents the composite ratio (weighting).
本実施の形態1では、合成比率は画素毎に0から1までの値を取り、合成比率がαである画素に関して、第1画像ImgAの合成比率はαであり、第2画像ImgBの合成比率は(1-α)であり、合成画像の画素値はα×ImgA+(1-α)×ImgBとなる。これにより、合成比率が1である画素は、合成画像において画像ImgAの100%の画素値(画像ImgBの0%の画素値)を有することになり、合成比率が0である画素は、合成画像において画像ImgAの0%の画素値(画像ImgBの100%の画素値)を有することになる。
In
なお、合成比率の画素値の定義を反転させてもよい。つまり、第1合成比率画像WeiAの画素値、及び、後述する第2合成比率画像WeiBの画素値はいずれも、第1画像ImgA及び第2画像ImgBの合成を行った場合の、第2画像ImgBの合成比率(重み付け)を表すものとしてもかまわない。ただし、その場合には、以下で説明する処理において、それらの値の大小も反転される。 Note that the definition of the pixel value of the composition ratio may be reversed. That is, both the pixel values of the first composite ratio image WeiA and the pixel values of the second composite ratio image WeiB, which will be described later, are the values of the second image ImgB when the first image ImgA and the second image ImgB are composited. It may be expressed as a composite ratio (weighting) of . However, in that case, the magnitudes of these values are also inverted in the processing described below.
第1画像ImgAを露光の少ない方の画像とした場合、第1合成比率決定部1aは、第1画像ImgAの輝度値が小さい画素については、当該画素の第1合成比率WeiAを小さくし、第1画像ImgAの輝度値が大きい画素については、当該画素の第1合成比率WeiAを大きくする。 When the first image ImgA is the image with the lower exposure, the first synthesis ratio determining unit 1a reduces the first synthesis ratio WeiA of the pixel with a small luminance value in the first image ImgA, For a pixel with a large luminance value in one image ImgA, the first synthesis ratio WeiA for that pixel is increased.
第1合成比率決定部1aは、例えば次式(3)を用いて、第1画像ImgAの輝度値に基づき、画素毎の第1合成比率WeiAを決定する。なお、次式(3)において、THbright及びTHdarkは閾値である。閾値THbrightは、後述のように飽和レベルに基づいて定められ、閾値THdarkは、後述のようにノイズレベルに基づいて定められる。 The first synthesis ratio determination unit 1a determines the first synthesis ratio WeiA for each pixel based on the luminance value of the first image ImgA, for example, using the following equation (3). Note that TH bright and TH dark are threshold values in the following equation (3). The threshold TH bright is determined based on the saturation level as described later, and the threshold TH dark is determined based on the noise level as described later.
図2は、横軸に第1画像ImgAの輝度値、縦軸に第1合成比率WeiAをとったグラフを示す図である。式(3)及び図2の実線に示す例では、第1画像ImgAの輝度値が閾値THbright以上である場合には、第1合成比率WeiAが1となり、第1画像ImgAの輝度値が閾値THdark以下である場合には、第1合成比率WeiAが0となる。そして、第1画像ImgAの輝度値が閾値THdarkよりも大きく閾値THbrightよりも小さい範囲では、第1合成比率WeiAが第1画像ImgAの輝度値に応じて徐々に増加する。 FIG. 2 is a graph showing the luminance value of the first image ImgA on the horizontal axis and the first synthesis ratio WeiA on the vertical axis. In the example shown in Equation (3) and the solid line in FIG. 2, when the brightness value of the first image ImgA is equal to or greater than the threshold TH bright , the first synthesis ratio WeiA is 1, and the brightness value of the first image ImgA is the threshold. If it is equal to or less than TH dark , the first synthesis ratio WeiA is zero. Then, in a range where the luminance value of the first image ImgA is greater than the threshold TH dark and less than the threshold TH bright , the first synthesis ratio WeiA gradually increases according to the luminance value of the first image ImgA.
したがって、合成画像のうち、第1画像ImgAの輝度値が閾値THbright以上である明るい部分では、第1合成比率WeiAが1となり、露光の少ない方の第1画像ImgAが100%採用される。一方、合成画像のうち、第1画像ImgAの輝度値が閾値THdark以下である暗い部分では、第1合成比率WeiAが0となり、露光の多い方の第2画像ImgBが100%採用される。そして、合成画像のうち、第1画像ImgAの輝度値が閾値THdarkよりも大きく閾値THbrightよりも小さい範囲である明るさが中間である部分では、第1合成比率WeiAが0よりも大きく1よりも小さくなり、露光が少ない方の第1画像ImgAと露光が多い方の第2画像ImgBとがブレンドされる。 Therefore, in a bright portion of the composite image where the brightness value of the first image ImgA is equal to or greater than the threshold TH bright , the first composite ratio WeiA is 1, and the first image ImgA with lower exposure is adopted 100%. On the other hand, in a dark portion of the composite image where the luminance value of the first image ImgA is equal to or less than the threshold TH dark , the first composite ratio WeiA is 0, and the second image ImgB with higher exposure is adopted at 100%. In the composite image, the first composite ratio WeiA is greater than 0 and greater than 1 in a portion where the brightness value of the first image ImgA is greater than the threshold TH dark and less than the threshold TH bright . , and the lower exposed first image ImgA and the higher exposed second image ImgB are blended.
閾値THbrightは、明るさを合わせる前の撮像画像のうち露光の多い方の画像において飽和している画素の輝度値SatLvと同じか、それよりも少し小さな値に定められる。飽和している画素の輝度値SatLvは、元の撮像画像のうち露光の多い方の画像(上述の画像Ib)が取りうる画素値の上限値IMAX(8ビットの画像の場合はIMAX=255)に対して、式(2)と同様の変換を施す次式(4)によって計算される。 The threshold TH bright is set to a value equal to or slightly smaller than the luminance value SatLv of saturated pixels in the image with higher exposure among the captured images before brightness adjustment. The luminance value SatLv of a saturated pixel is the upper limit value I MAX (I MAX = 255) is calculated by the following equation (4) that performs the same transformation as in equation (2).
閾値THbrightは、例えば、SatLvの95%以上100%以下の値に定められる。これにより、第1画像ImgAの輝度値の明るさが、第2画像ImgBが飽和するレベルの明るさである場合には、第1画像ImgAの合成比率は確実に1となり、飽和する第2画像ImgBが第3画像ImgCに採用されないようにすることができる。以下では、閾値THbrightをSatLvに等しい値に定めたものとして説明する。 The threshold TH bright is set, for example, to a value equal to or greater than 95% and equal to or less than 100% of SatLv. As a result, when the brightness of the luminance value of the first image ImgA is at a brightness level at which the second image ImgB is saturated, the composition ratio of the first image ImgA is surely 1, and the second image is saturated. ImgB can be prevented from being adopted for the third image ImgC. In the following description, it is assumed that the threshold TH bright is set to a value equal to SatLv.
閾値THdarkは、閾値THbrightよりも小さな値で、かつ、明るさを合わせる前の撮像画像のノイズレベルに対応する輝度値NoiLvよりも十分に大きな値となるように定められる。ノイズレベルに対応する輝度値NoiLvは、元の撮像画像(例えば、露光の少ない方の画像Ia)におけるノイズの標準偏差がσnであった場合、当該標準偏差に対して、式(1)と同様の変換を施す次式(5)によって計算される。 The threshold TH dark is determined to be a value smaller than the threshold TH bright and sufficiently larger than the luminance value NoiLv corresponding to the noise level of the captured image before brightness adjustment. When the standard deviation of noise in the original captured image (for example, the less exposed image Ia) is σn , the luminance value NoiLv corresponding to the noise level is obtained by formula (1) and It is calculated by the following equation (5) that performs a similar conversion.
閾値THdarkは、NoiLvよりも十分に大きな値、例えば、NoiLvの3倍程度の値に定める。これにより、第1画像ImgAのうち、輝度値の明るさがノイズレベルの明るさである部分では、第1画像ImgAの合成比率は確実に0となり、第1画像ImgAのノイズが第3画像ImgCに採用されないようにすることができる。 The threshold TH dark is set to a value sufficiently larger than NoiLv, for example, a value about three times NoiLv. As a result, in the portion of the first image ImgA where the brightness of the luminance value is the brightness of the noise level, the composition ratio of the first image ImgA is surely 0, and the noise of the first image ImgA is reduced to the noise level of the third image ImgC. can be prevented from being adopted by
以上のように、第1合成比率決定部1aは、第1画像ImgAの輝度値に基づいて、第1画像ImgA及び第2画像ImgBの合成を行った場合の、第1画像ImgAの合成における画素毎の第1合成比率WeiAを決定して、第1合成比率画像WeiAを生成する。 As described above, the first synthesis ratio determination unit 1a determines the pixel A first synthesis ratio image WeiA is generated by determining a first synthesis ratio WeiA for each pixel.
一方、第2合成比率決定部1bは、第2画像ImgBの輝度値に基づいて、第1画像ImgA及び第2画像ImgBの合成を行った場合の、第1画像ImgAの合成における画素毎の第2合成比率WeiBを決定して、第2合成比率画像WeiBを生成する。
On the other hand, based on the luminance value of the second image ImgB, the second synthesis
第2合成比率決定部1bは、第2画像ImgBの輝度値に応じて合成比率を決定する点が第1合成比率決定部1aと異なっているのみで、合成比率の決め方は第1合成比率決定部1aと同様である。
The second combining
すなわち、第2合成比率決定部1bは、第2画像ImgBの輝度値が小さい画素については、当該画素の第2合成比率WeiBを小さくし、第2画像ImgBの輝度値が大きい画素については、当該画素の第2合成比率WeiBを大きくする。このため、第2合成比率決定部1bで決定される第2合成比率WeiBは、第2画像ImgBの合成における合成比率ではなく、第1画像ImgAの合成における合成比率の推定値となる。
That is, the second synthesis
本実施の形態1では、第2合成比率決定部1bは、例えば式(3)と同様の次式(6)を用いて、第2画像ImgBの輝度値に基づき、画素毎の第2合成比率WeiBを決定する。図3は、横軸に第2画像ImgBの輝度値、縦軸に第2合成比率WeiBをとったグラフを示す図である。なお、第2合成比率WeiBは、破線で示される第2画像ImgBの合成比率ではなく、実線で示される第1画像ImgAの合成比率である。
In the first embodiment, the second synthesis
式(6)において、THbright及びTHdarkは閾値であり、それらの値には、第1合成比率決定部1aのTHbright及びTHdarkの値と同じ値を用いることができる。なお、第1合成比率決定部1a及び第2合成比率決定部1bにおいて共通の関係式を用いることができるのは、式(1)及び(2)で明るさを合わせた画像を第1画像及び第2画像として入力しているためである。式(1)及び(2)の変換を行う機能を第1合成比率決定部1a及び第2合成比率決定部1bにそれぞれ組み入れた構成では、明るさを合わせる前の撮像画像を第1画像及び第2画像として入力することができる。
In Equation (6), TH bright and TH dark are threshold values, and the same values as those of TH bright and TH dark of the first combining ratio determining unit 1a can be used for these values. The common relational expression can be used in the first synthesis ratio determination unit 1a and the second synthesis
以上のように、第2合成比率決定部1bは、第2画像ImgBの輝度値に基づいて、第1画像ImgA及び第2画像ImgBの合成を行った場合の、第1画像ImgAの合成における画素毎の第2合成比率WeiBを決定して、第2合成比率画像WeiBを生成する。
As described above, the second synthesis
以上のようにして、第1合成比率決定部1a及び第2合成比率決定部1bは、第1画像ImgA及び第2画像ImgBの輝度値に対して階調変換を施す。これによって、明るさが概ね互いに一致し、かつ、黒つぶれ領域で0、白とび領域で1の値をもつ、0から1までの値に正規化された第1合成比率画像WeiA及び第2合成比率画像WeiBが生成される。
As described above, the first composition ratio determination unit 1a and the second composition
<位置ずれ顕著性判定部2>
図1の位置ずれ顕著性判定部2は、第1合成比率画像WeiA及び第2合成比率画像WeiBに基づいて、第1画像ImgAと第2画像ImgBとの間の位置ずれが、前記第1画像及び前記第2画像の合成を行った場合に生成される合成画像の輝度に影響する程度を画素毎に判定して、位置ずれ顕著性画像Impを生成する。
<Displacement
Based on the first composite ratio image WeiA and the second composite ratio image WeiB, the positional displacement
位置ずれ顕著性判定部2は、第1合成比率画像WeiA(第1合成比率WeiA)が小さくなるほど位置ずれ顕著性Impを大きくし、第1合成比率画像WeiA(第1合成比率WeiA)と第2合成比率画像WeiB(第2合成比率WeiB)との差分絶対値が大きくなるほど位置ずれ顕著性Impを大きくする。位置ずれ顕著性判定部2は、例えば次式(7)を用いて位置ずれ顕著性Impを計算する。
The positional deviation
式(7)の位置ずれ顕著性Impは、合成画像における第1画像ImgAの合成比率の反転(すなわち、第2画像ImgBの合成比率)である(1-WeiA)と、第1合成比率WeiAと第2合成比率WeiBとの差分絶対値|WeiB-WeiA|との積で表される。 The positional deviation conspicuity Imp in Expression (7) is the inversion of the composition ratio of the first image ImgA in the composite image (that is, the composition ratio of the second image ImgB) (1−WeiA), and the first composition ratio WeiA. It is represented by the product of the absolute difference |WeiB-WeiA| with the second synthesis ratio WeiB.
式(7)の右辺第1項(1-WeiA)は、0から1までの値を取る。第1画像ImgAの第1合成比率WeiAが1のとき、当該右辺第1項が0となり、その結果、位置ずれ顕著性Impは0となる。また、第1画像ImgAの合成比率が1未満の値であるとき、第2画像ImgBの合成比率を示す右辺第1項(1-WeiA)が0より大きい値となり、その結果、位置ずれ顕著性Impは、この値に比例して大きくなる。 The first term (1-WeiA) on the right side of equation (7) takes a value from 0 to 1. When the first synthesis ratio WeiA of the first image ImgA is 1, the first term on the right side is 0, and as a result, the salience of displacement Imp is 0. Further, when the composition ratio of the first image ImgA is less than 1, the first term (1-WeiA) on the right side indicating the composition ratio of the second image ImgB becomes a value greater than 0. As a result, the salience of positional deviation Imp increases in proportion to this value.
式(7)における右辺第2項|WeiB-WeiA|は、0から1までの値を取る。第1合成比率画像WeiAと第2合成比率画像WeiBとにおいて位置が互いに同じ画素の画素値が等しいとき、位置ずれ顕著性Impは0となる。また、第1合成比率画像WeiAと第2合成比率画像WeiBとにおいて位置が互いに同じ画素の画素値が異なるとき、位置ずれ顕著性Impは、この差分絶対値に比例して大きくなる。 The second term |WeiB-WeiA| on the right side of equation (7) takes a value from 0 to 1. When the pixel values of the pixels at the same position are equal in the first synthesis ratio image WeiA and the second synthesis ratio image WeiB, the positional shift conspicuity Imp is zero. In addition, when the pixel values of the pixels at the same position are different between the first synthesis ratio image WeiA and the second synthesis ratio image WeiB, the positional deviation conspicuity Imp increases in proportion to the difference absolute value.
図4は、第1合成比率WeiAの値と第2合成比率WeiBの値との組み合わせに対して、式(7)で計算される位置ずれ顕著性Impの値を等高線でプロットした図である。等高線図において右側に行くほど、つまり第1合成比率WeiAが大きくなるほど、位置ずれ顕著性Impは小さくなる。また、等高線図において破線で示した対角線(直線WeiB=WeiA)に近づくほど、つまり第1合成比率WeiAと第2合成比率WeiBとの差分絶対値が小さくなるほど、位置ずれ顕著性Impは小さくなる。また、等高線図において中央から左上の領域に向かうほど、つまり、第1合成比率WeiAが小さく、かつ、第1合成比率WeiAと第2合成比率WeiBとの差分絶対値が大きくなるほど、位置ずれ顕著性Impは大きくなる。 FIG. 4 is a diagram plotting the values of the misalignment conspicuity Imp calculated by the equation (7) with contour lines for the combinations of the values of the first synthesis ratio WeiA and the values of the second synthesis ratio WeiB. The positional deviation saliency Imp decreases toward the right side of the contour map, that is, as the first synthesis ratio WeiA increases. Further, the closer the diagonal line (straight line WeiB=WeiA) indicated by the dashed line in the contour map, that is, the smaller the absolute value of the difference between the first synthesis ratio WeiA and the second synthesis ratio WeiB, the smaller the misalignment conspicuity Imp. Further, the positional deviation conspicuity increases as the first synthesis ratio WeiA decreases and the absolute difference between the first synthesis ratio WeiA and the second synthesis ratio WeiB increases as the contour map moves from the center to the upper left region. Imp increases.
なお、位置ずれ顕著性判定部2は、式(7)を用いて位置ずれ顕著性Impを計算するのではなく、例えば次式(8)を用いて位置ずれ顕著性Impを計算してもよい。
Note that the positional deviation
式(8)で、r1,r2は各項の寄与を調整する乗数であり、それぞれ0以上の実数であるものとする。式(8)において、r1を0にすると、第1合成比率WeiAが大きくなっても位置ずれ顕著性Impが低減しなくなる。r1を大きな値にするほど、第1合成比率WeiAが大きい場合に位置ずれ顕著性Impを低減する程度が大きくなる。つまり、r1を調整することによって、位置ずれ顕著性Impへの第1合成比率WeiAの寄与を調整することができる。同様に、r2を調整することによって、位置ずれ顕著性Impへの、第1合成比率WeiAと第2合成比率WeiBとの差分絶対値の寄与を調整することができる。 In Expression (8), r 1 and r 2 are multipliers for adjusting the contribution of each term, and are real numbers of 0 or more. In equation (8), if r1 is set to 0 , the misregistration saliency Imp will not decrease even if the first synthesis ratio WeiA increases. The greater the value of r1, the greater the extent to which the displacement saliency Imp is reduced when the first synthesis ratio WeiA is large. That is, by adjusting r1, the contribution of the first synthesis ratio WeiA to the misalignment saliency Imp can be adjusted. Similarly, by adjusting r2, the contribution of the absolute value of the difference between the first synthesis ratio WeiA and the second synthesis ratio WeiB to the misalignment saliency Imp can be adjusted.
以上のように、位置ずれ顕著性Impは、第1合成比率画像WeiAが表す第1画像ImgAの合成比率が小さいときに大きくなり、第1合成比率画像WeiAと第2合成比率画像WeiBとの差分絶対値が大きいときに大きくなる特性を有する。 As described above, the positional deviation conspicuity Imp increases when the composition ratio of the first image ImgA represented by the first composition ratio image WeiA is small, and the difference between the first composition ratio image WeiA and the second composition ratio image WeiB. It has the characteristic of increasing when the absolute value is large.
以下では、位置ずれ顕著性Impとして、式(7)で計算される値を用いるものとして説明する。 In the following description, it is assumed that the value calculated by Equation (7) is used as the positional deviation saliency Imp.
<重み付き動きベクトル算出部3>
図1の重み付き動きベクトル算出部3は、位置ずれ顕著性Impに基づいて、位置ずれ探索に要する処理量を変更しつつ、当該位置ずれ探索によって第1画像ImgAと第2画像ImgBとの間の画素毎の動きベクトルWを算出する。
<Weighted
The weighted
図1に示すように、本実施の形態1に係る重み付き動きベクトル算出部3は、第1合成比率WeiAによって形成される第1合成比率画像WeiAと、第2合成比率WeiBによって形成される第2合成比率画像WeiBとの間の位置ずれ探索を行うことによって、間接的に第1画像ImgAと第2画像ImgBとの間の動きベクトルWを算出する。
As shown in FIG. 1, the weighted
動きベクトル算出方法として、例えば、ブロックマッチング法に基づく位置ずれ探索と、勾配法に基づく位置ずれ探索とが知られている。 As motion vector calculation methods, for example, a positional deviation search based on a block matching method and a positional deviation search based on a gradient method are known.
ブロックマッチング法に基づく位置ずれ探索では、例えば、基準画像の画素単位に設定したブロック毎に、参照画像における複数の位置ずれ候補位置のブロックとの相関を計算し、最も相関が高くなる位置ずれを探索することにより、画素毎の動きベクトルを算出する。 In a misregistration search based on the block matching method, for example, for each block set in units of pixels in a reference image, the correlation with a plurality of misregistration candidate position blocks in the reference image is calculated, and the misregistration with the highest correlation is determined. A motion vector for each pixel is calculated by searching.
勾配法に基づく位置ずれ探索では、勾配法の評価関数が最小になるような動きベクトルを反復処理により順次更新していくことにより、画素毎の動きベクトルを算出する。 In the positional displacement search based on the gradient method, the motion vector for each pixel is calculated by sequentially updating the motion vector that minimizes the evaluation function of the gradient method through iterative processing.
重み付き動きベクトル算出部3の動きベクトル算出方法は、これらの位置ずれ探索だけでなく、これら以外の既知の方法であってもよく、特定の動きベクトル算出手法に限定されない。
The motion vector calculation method of the weighted motion
ここで、重み付き動きベクトル算出部3は、位置ずれ顕著性Impに基づいて、位置ずれ探索に要する処理量を変更する。つまり、重み付き動きベクトル算出部3は、実質的に位置ずれ顕著性Impに基づいて位置ずれ探索の粒度を変更する。
Here, the weighted
本実施の形態1では、重み付き動きベクトル算出部3は、位置ずれ顕著性Impが大きくなるほど、位置ずれ探索に要する処理量を大きくする。つまり、重み付き動きベクトル算出部3は、位置ずれ顕著性Impが小さくなるほど、位置ずれ探索に要する処理量を小さくする。
In
位置ずれ探索に要する処理量を小さくすることは、以下にいくつかの具体例を示すように、例えば、動きベクトル算出の各方法及び各ステップにおいて、画素毎に独立かつ並列に実行可能な処理要素があるときに、特定の画素についてその処理要素の実行を省略したり、特定の画素についてその処理要素の精度を下げたりすることに相当する。 Reducing the amount of processing required for positional displacement search is achieved by, for example, processing elements that can be executed independently and in parallel for each pixel in each method and each step of motion vector calculation, as shown in some specific examples below. corresponds to omitting the execution of the processing element for a particular pixel or reducing the precision of the processing element for a particular pixel when there is a
第1具体例では、重み付き動きベクトル算出部3は、位置ずれ顕著性Impが小さい画素について、ブロックマッチング法を用いた位置ずれ探索を行わず、所定の値を割り当てるようにすることで、位置ずれ探索が行われる画素の数を削減する。
In the first specific example, the weighted motion
第2具体例では、重み付き動きベクトル算出部3は、位置ずれ探索が行われるべき画素の位置ずれ顕著性Impが小さくなるにつれて、ブロックマッチング法を用いた位置ずれ探索を行う間隔を2画素に1回、4画素に1回、…というように粗くする。そして、重み付き動きベクトル算出部3は、位置ずれ探索を行わなかった画素については、位置ずれ探索を行った近傍の画素の結果から線形補間するように求めることで、位置ずれ探索が行われる画素の数を削減する。
In the second specific example, the weighted motion
第3具体例では、重み付き動きベクトル算出部3は、位置ずれ探索が行われるべき画素の位置ずれ顕著性Impが小さくなるにつれて、ブロックマッチング法を用いた位置ずれ候補位置の刻み(間隔)を2画素、4画素、…というように粗くする。つまり、重み付き動きベクトル算出部3は、位置ずれ候補位置の数を削減する。
In the third specific example, the weighted motion
第4具体例では、重み付き動きベクトル算出部3は、勾配法を用いた位置ずれ探索における反復処理の回数を削減する。
In the fourth specific example, the weighted
以上のようにして、重み付き動きベクトル算出部3は、例えば、位置ずれ顕著性Impが大きい領域では位置ずれ探索を画素単位に行い、位置ずれ顕著性Impが小さい領域では位置ずれ探索に要する処理量を小さくすることを行い、かつ、当該位置ずれ探索によって画素毎の動きベクトルWを算出する。
As described above, the weighted motion
<位置補正部4a>
図1の位置補正部4aは、動きベクトルWに基づいて第2画像ImgBの位置を画素毎に補正して、位置補正後の第2画像ImgBwを生成する。
<
The
動きベクトルWは、第1画像ImgAの各画素が第2画像ImgB上のどの画素に移動したかを表す位置ずれマップである。位置補正部4aは、第2画像ImgB上の画素位置pを動きベクトルW(p)にしたがって移動した画素位置p+W(p)の画素値に補間を行うことにより、位置補正後の第2画像ImgBwの画素値を求める。補間には、例えば、バイリニア法、バイキュービック法、Lanczos法など任意の補間方法が用いられる。
The motion vector W is a displacement map representing to which pixel on the second image ImgB each pixel of the first image ImgA has moved. The
位置補正部4aは、すべての画素位置pについて第2画像ImgBにおける移動先の位置の画素値を補間することによって位置補正後の第2画像ImgBwを生成する。
The
<合成部4b>
図1の合成部4bは、第1合成比率WeiAに基づいて、第1画像ImgAと、位置補正後の第2画像ImgBwとを重み付け加算する合成を行うことによって、第3の画像ImgCを生成する。図1の合成部4bは、例えば次式(9)を用いて第3の画像ImgCを計算する。
<Combining
The synthesizing
なお、合成部4bは、重み付け加算に先立ち、第1合成比率WeiAに平滑化フィルタや最大値フィルタなどのフィルタ処理を施してWeiA’を求め、次式(10)に示すように、当該WeiA’を重み付け加算の重み付けとして用いてもよい。
Note that, prior to the weighted addition, the synthesizing
以上のようにして、本実施の形態1に係る画像処理装置は、露光条件が異なり、互いに対応する第1画像ImgA及び第2画像ImgBが入力されると、第2画像ImgBを位置ずれ補正して第1画像ImgAと合成することによって、第3の画像ImgCを生成する。これにより、ダイナミックレンジの広い画像を生成するハイダイナミックレンジ合成が可能となっている。 As described above, when the first image ImgA and the second image ImgB that correspond to each other under different exposure conditions are input, the image processing apparatus according to the first embodiment corrects the displacement of the second image ImgB. A third image ImgC is generated by synthesizing the first image ImgA with the first image ImgA. This enables high dynamic range synthesis that generates an image with a wide dynamic range.
<動作>
次に、図5乃至図7を用いて、本実施の形態1に係る画像処理装置の動作を説明する。
<Action>
Next, the operation of the image processing apparatus according to the first embodiment will be described with reference to FIGS. 5 to 7. FIG.
まず、図5を用いて、第1合成比率決定部1a、第2合成比率決定部1b、位置ずれ顕著性判定部2の動作を説明する。図5乃至図7において、第1画像ImgAは、短露光時間画像であり、第2画像ImgBは、長露光時間画像である。図5では、暗い部屋の手前に人物がおり、奥に窓の外の明るい景色が見えているような撮影対象を、視差が生じるように設けられた2つのセンサで露光時間を変えて撮像した画像が、第1画像ImgA及び第2画像ImgBとして模式的に示されている。
First, the operations of the first synthesis ratio determination unit 1a, the second synthesis
図5のように、短露光時間画像である第1画像ImgAにおいて、窓の外の景色の領域は適切な明るさであり明瞭であるが、手前の人物の領域は暗すぎて黒つぶれし、当該領域のS/Nは低くなっている。また、長露光時間画像である第2画像ImgBにおいて、手前の人物の領域は適切な明るさであり明瞭であるが、窓の外の景色の領域は明るすぎて白とびしており、当該領域ではディテールが失われている。 As shown in FIG. 5, in the first image ImgA, which is a short-exposure-time image, the area of the scenery outside the window has appropriate brightness and is clear, but the area of the person in the foreground is too dark and is blackened out. The S/N in this area is low. Also, in the second image ImgB, which is a long-exposure-time image, the region of the person in the foreground has appropriate brightness and is clear, but the region of the scenery outside the window is too bright and overexposed. Detail is lost.
また、第1画像ImgAと第2画像ImgBとの間には視差があり、奥行き距離が異なる撮影対象(手前の人物、窓枠、窓の外の景色)について局所的に位置ずれが変化している。図5では、第2画像ImgBの人物は、第1画像ImgAの同人物に対して左方向に位置がずれており、第1画像ImgA及び第2画像ImgBの窓枠同士の間では位置ずれがなく、第2画像ImgBの窓の外の景色は、第1画像ImgAの同景色に対して右方向に位置がずれている。 In addition, there is a parallax between the first image ImgA and the second image ImgB, and the positional deviation of the subject (person in front, window frame, scenery outside the window) with different depth distances varies locally. there is In FIG. 5, the person in the second image ImgB is displaced to the left with respect to the same person in the first image ImgA, and there is a positional displacement between the window frames of the first image ImgA and the second image ImgB. Instead, the view outside the window of the second image ImgB is shifted to the right with respect to the same view of the first image ImgA.
本実施の形態1に係る画像処理装置は、まず、2枚の撮像画像の画素値を放射輝度に線形な値に変換することで明るさを合わせることによって(図5では省略)、第1画像ImgA及び第2画像ImgBを取得する。その上で、第1合成比率決定部1aは、第1画像ImgAの輝度値に基づいて、第1画像ImgA及び第2画像ImgBの合成を行った場合の、第1画像ImgAの合成における画素毎の第1合成比率WeiAを表す第1合成比率画像WeiAを生成する(図5の矢印A1a)。また、第2合成比率決定部1bは、第2画像ImgBの輝度値に基づいて、第1画像ImgA及び第2画像ImgBの合成を行った場合の、第1画像ImgAの合成における画素毎の第2合成比率WeiBを表す第2合成比率画像WeiBを生成する(図5の矢印A1b)。
The image processing apparatus according to the first embodiment first converts the pixel values of the two captured images into values linear to the radiance to match the brightness (not shown in FIG. 5), so that the first image Acquire ImgA and a second image ImgB. Then, based on the luminance value of the first image ImgA, the first synthesis ratio determination unit 1a determines the value for each pixel in the synthesis of the first image ImgA when the first image ImgA and the second image ImgB are synthesized. (arrow A1a in FIG. 5). In addition, the second synthesis
この結果、図5に示すように、第1合成比率画像WeiAは、第1画像ImgAの黒つぶれ相当輝度領域(手前の人物の胴体の部分)で0になり、白とび相当輝度領域(窓の外の景色の部分)で1になり、それ以外の領域では輝度値に対して線形な値をとった画像となる。 As a result, as shown in FIG. 5, the first composite ratio image WeiA becomes 0 in the brightness region corresponding to blocked-up shadows (the torso portion of the person in the foreground) of the first image ImgA, and the brightness region corresponding to blown-out highlights (the window The image becomes 1 in the outside scenery area), and the image takes a linear value with respect to the luminance value in other areas.
また、図5に示すように、第2合成比率画像WeiBは、第2画像ImgBの黒つぶれ相当輝度領域(手前の人物の胴体の部分)で0になり、白とび相当輝度領域(窓の外の景色の部分)で1になり、それ以外の領域では輝度値に対して線形な値をとった画像となる。 Further, as shown in FIG. 5, the second composite ratio image WeiB becomes 0 in the brightness area corresponding to blocked-up shadows (the torso portion of the person in front) of the second image ImgB, and the brightness area corresponding to blown-out highlights (outside the window). The image becomes 1 in the scenery part), and the image takes a linear value with respect to the luminance value in other areas.
図5の第1合成比率画像WeiA及び第2合成比率画像WeiBの白色部分では、第1画像ImgAの合成比率が1であり、第1画像ImgA及び第2画像ImgBの合成を行った場合に生成される合成画像の対応する部分において、第1画像ImgAの合成比率は100%となり、第2画像ImgBの合成比率は0%となる。また、黒色部分では、第1画像ImgAの合成比率が0であり、合成画像の対応する部分において、第1画像ImgAの合成比率は0%となり、第2画像ImgBの合成比率は100%となる。さらに、白色でも黒色でもない灰色の部分は、第1画像ImgAの合成比率が0及び1の中間の値であり、合成画像の対応する部分において、第1画像ImgAと第2画像ImgBとがブレンドされることを表している。 In the white portions of the first synthesis ratio image WeiA and the second synthesis ratio image WeiB in FIG. 5, the synthesis ratio of the first image ImgA is 1, and the first image ImgA and the second image ImgB are synthesized. In the corresponding part of the synthesized image to be processed, the synthesis ratio of the first image ImgA is 100% and the synthesis ratio of the second image ImgB is 0%. Also, in the black portion, the synthesis ratio of the first image ImgA is 0, in the corresponding portion of the synthesized image, the synthesis ratio of the first image ImgA is 0%, and the synthesis ratio of the second image ImgB is 100%. . Furthermore, gray portions that are neither white nor black have a synthesis ratio between 0 and 1 for the first image ImgA. It means that
第1合成比率決定部1a及び第2合成比率決定部1bは、それぞれ入力される第1画像ImgA及び第2画像ImgBの輝度値に基づいて、黒つぶれ相当輝度領域の合成比率を0、白とび相当輝度領域の合成比率を1、それ以外の領域の合成比率を輝度値に対する線形の値となるように第1合成比率画像WeiA及び第2合成比率画像WeiBを生成する。このため、第1合成比率画像WeiA及び第2合成比率画像WeiBは互いに、明るさだけでなく、黒つぶれ相当輝度領域(合成比率が0の箇所)と、白とび相当輝度領域(合成比率が1の箇所)とが実質的に一致する画像となる。
Based on the luminance values of the input first image ImgA and second image ImgB, the first composition ratio determination unit 1a and the second composition
ただし、第1合成比率画像WeiA及び第2合成比率画像WeiBの被写体の位置は、第1画像ImgA及び第2画像ImgBの同位置とそれぞれ同じである。このため、第1画像ImgA及び第2画像ImgB同士の位置ずれは、第1合成比率画像WeiA及び第2合成比率画像WeiB同士の位置ずれとして保存される。 However, the positions of the subject in the first composite ratio image WeiA and the second composite ratio image WeiB are the same as those in the first image ImgA and the second image ImgB. Therefore, the positional deviation between the first image ImgA and the second image ImgB is stored as the positional deviation between the first composite ratio image WeiA and the second composite ratio image WeiB.
次に、位置ずれ顕著性判定部2は、第1合成比率画像WeiA及び第2合成比率画像WeiBに基づいて位置ずれ顕著性画像Impを生成する(図5の矢印A2)。図5では、位置ずれ顕著性Impの値をグレイスケールで示しており、位置ずれ顕著性Impが小さい部分は暗い色で、位置ずれ顕著性Impが大きい部分は明るい色で表されている。
Next, the misalignment
生成された位置ずれ顕著性画像Impは、図5に示すように、第1合成比率画像WeiAが表す第1画像ImgAの合成比率が小さい部分で比較的大きくなり、第1合成比率WeiAが表す第1画像ImgAの合成比率と、第2合成比率WeiBが表す第1画像ImgAの合成比率との差分絶対値が大きい部分で比較的大きくなり、それ以外の部分では比較的小さくなる。 As shown in FIG. 5, the generated positional displacement saliency image Imp is relatively large in a portion where the synthesis ratio of the first image ImgA represented by the first synthesis ratio image WeiA is small, and is relatively large in the portion where the synthesis ratio is small. The absolute value of the difference between the synthesis ratio of one image ImgA and the synthesis ratio of the first image ImgA represented by the second synthesis ratio WeiB is relatively large in areas where the difference is large, and is relatively small in other areas.
図5において、位置ずれ顕著性Impが大きくなっている部分は、手前の人物の胴体のうち位置ずれ顕著性画像Impのエッジ側の部分(符号Raで示す)や、目、鼻、口の部分(符号Rbで示す)である。これらの領域では、第1合成比率画像WeiAの値が小さく、第1画像ImgA及び第2画像ImgBの合成を行った場合に生成される合成画像において第2画像ImgBが高い比率で採用される。しかも、これらの領域では、第2画像ImgBは、第1画像ImgAに対して位置がずれており、差分絶対値が大きくなっている。このため、これらの領域では、上記合成画像においてその影響が目立つ。そこで、位置ずれ顕著性判定部2は、このような領域の位置ずれ顕著性Impが大きくなるように位置ずれ顕著性Impを判定する。
In FIG. 5 , the portions where the misalignment saliency Imp is large are the edge side portion of the misalignment saliency image Imp (indicated by symbol Ra) of the torso of the person in the foreground, and the eyes, nose, and mouth. (indicated by symbol Rb). In these regions, the value of the first composite ratio image WeiA is small, and the second image ImgB is adopted at a high ratio in the composite image generated when the first image ImgA and the second image ImgB are composited. Moreover, in these areas, the second image ImgB is displaced from the first image ImgA, and the difference absolute value is large. Therefore, in these areas, the effect is conspicuous in the composite image. Therefore, the misregistration
一方、窓の外の景色の領域(符号Rcで示す)では、第1画像ImgAと第2画像ImgBとの間で位置ずれがあるものの、第2画像ImgBは飽和しており、かつ、第1合成比率画像WeiAの値が1であり、合成画像において第1画像ImgAが100%採用される。このため、これらの領域において第2画像ImgBが位置ずれしていることは、合成画像に対して影響を及ぼさない。そこで、位置ずれ顕著性判定部2は、このような領域の位置ずれ顕著性Impが小さくなるように位置ずれ顕著性Impを判定する。
On the other hand, in the scenery area outside the window (indicated by symbol Rc), although there is a positional shift between the first image ImgA and the second image ImgB, the second image ImgB is saturated and the first image ImgB is saturated. The value of the composite ratio image WeiA is 1, and the first image ImgA is adopted 100% in the composite image. Therefore, the displacement of the second image ImgB in these regions does not affect the synthesized image. Therefore, the misregistration
また、部屋の壁の領域(符号Rdで示す)や、手前の人物の胴体のうち位置ずれ顕著性画像Impの内側の部分(符号Reで示す)では、第1合成比率画像WeiAの値が1未満の値であり、合成画像において第2画像ImgBが採用される部分ではあるものの、第1画像ImgA及び第2画像ImgBの輝度が近いため、合成画像においてほとんど目立たない。そこで、位置ずれ顕著性判定部2は、このような領域の位置ずれ顕著性Impが小さくなるように位置ずれ顕著性Impを判定する。
In addition, the value of the first synthesis ratio image WeiA is 1 in the area of the wall of the room (indicated by symbol Rd) and the portion of the torso of the person in the foreground inside the misalignment saliency image Imp (indicated by symbol Re). Although the second image ImgB is used in the synthesized image, it is almost inconspicuous in the synthesized image because the luminances of the first image ImgA and the second image ImgB are close to each other. Therefore, the misregistration
以上のように、位置ずれ顕著性判定部2は、第1合成比率画像WeiAと、第1合成比率画像WeiAと第2合成比率画像WeiBとの差分とを考慮して位置ずれ顕著性Impを判定する。
As described above, the positional deviation
続いて、図6を用いて、重み付き動きベクトル算出部3の動作を説明する。重み付き動きベクトル算出部3は、位置ずれ顕著性Impに基づいて、位置ずれ探索に要する処理量を変更しつつ、当該位置ずれ探索によって第1合成比率画像WeiAと第2合成比率画像WeiBとの間の画素毎の動きベクトルWを算出する(図6の矢印A3)。
Next, the operation of the weighted
図6の例では、重み付き動きベクトル算出部3は、位置ずれ顕著性Impが大きい部分についてのみ、ブロックマッチング法を用いた位置ずれ探索を行う。一方、重み付き動きベクトル算出部3は、位置ずれ顕著性Impが小さい部分では、ブロックマッチング法を用いた位置ずれ探索を行わずに、所定の値、ここではゼロベクトル(位置ずれなし)を割り当てる。図6の位置ずれ顕著性Impが大きい部分は、手前の人物の領域(胴体のエッジ部分等)であり、重み付き動きベクトル算出部3は、この部分の位置ずれ探索を画素単位で行う。
In the example of FIG. 6, the weighted motion
より具体的には、重み付き動きベクトル算出部3は、第1合成比率画像WeiAにおいて、位置ずれ顕著性Impが所定の閾値以上である画素の位置に順次ブロックを設定し、各画素位置のブロックについて第2合成比率画像WeiBにおける複数の位置ずれ候補位置のブロックとの相関を計算する。そして、重み付き動きベクトル算出部3は、最も相関が高くなる位置ずれを当該画素の動きベクトルとして算出する。一方、重み付き動きベクトル算出部3は、位置ずれ顕著性Impが所定の閾値未満である画素では位置ずれ探索を行わず、強制的にゼロベクトルを当該画素の動きベクトルとして割り当てる。その結果、図6のような動きベクトルWの画像が得られる。
More specifically, the weighted
図6の動きベクトルWの画像では、第1合成比率画像WeiAの画素にそれぞれ対応する第2合成比率画像WeiBの画素の位置ずれ量が、等間隔の格子点の上に矢印(ベクトル)で表示されている。図6の場合、動きベクトルWの画像は、手前の人物の領域でその位置ずれ量に対応する左方向のベクトルと、それ以外の領域でゼロベクトルとが格納された画像となる。 In the image of the motion vector W in FIG. 6, the displacement amounts of the pixels of the second synthesis ratio image WeiB corresponding to the pixels of the first synthesis ratio image WeiA are indicated by arrows (vectors) on equally spaced grid points. It is In the case of FIG. 6, the image of the motion vector W is an image in which a vector in the left direction corresponding to the positional deviation amount is stored in the region of the person in the foreground, and a zero vector is stored in the other regions.
最後に、図7を用いて、位置補正部4a及び合成部4bを含む画像生成部4の動作を説明する。位置補正部4aは、動きベクトルWに基づいて第2画像ImgBの位置を画素毎に補正して位置補正後の第2画像ImgBwを生成する(図7の矢印A4)。図6の動きベクトルWでは、手前の人物の領域のみが位置ずれを有しているので、当該動きベクトルWにしたがって第2画像ImgBに位置補正を行うと、手前の人物の領域のみが第1画像ImgAと同じ位置になるように補正される。その結果、図7の位置補正後の第2画像ImgBwのように、手前の人物の領域は破線の位置から実線の位置に移動する。このため、第2画像ImgBwは、窓の外の景色などの領域だけでなく、手前の人物の領域についても第1画像ImgAと位置が合った画像となる。
Finally, the operation of the image generator 4 including the
合成部4bは、第1合成比率画像WeiAが表す第1合成比率WeiAに基づいて、第1画像ImgAと、位置補正後の第2画像ImgBwとを重み付け加算する合成を行うことによって、第3の画像ImgCを生成する(図7の矢印A5)。
Based on the first synthesis ratio WeiA represented by the first synthesis ratio image WeiA, the synthesizing
図7の第1合成比率画像WeiAの合成比率は、窓の外の景色の領域では1となっているので、第3の画像ImgCにおける当該領域には第1画像ImgAが100%採用される。一方、当該合成比率は、手前の人物の領域では1よりも小さな値となっているので、第3の画像ImgCにおける当該領域には、第1画像ImgAと、位置補正された第2画像ImgBwとのそれぞれが、ある程度の比率で採用される。その結果、図7の第3の画像ImgCは、窓の外の景色の領域で白とびがなく、かつ、手前の人物の領域で明瞭となった画像となる。さらに、第3の画像ImgCの手前の人物の領域においては、第1画像ImgAと位置が合うように位置補正された第2画像ImgBwが合成されるので、第3の画像ImgCは、位置ずれによってぶれや二重像のない画像となる。 Since the synthesis ratio of the first synthesis ratio image WeiA in FIG. 7 is 1 in the scenery area outside the window, 100% of the first image ImgA is adopted for that area in the third image ImgC. On the other hand, since the composition ratio is smaller than 1 in the region of the person in the foreground, the region in the third image ImgC includes the first image ImgA and the position-corrected second image ImgBw. are employed in some proportion. As a result, the third image ImgC in FIG. 7 is an image in which there is no overexposure in the scenery area outside the window and the person area in the foreground is clear. Furthermore, in the region of the person in front of the third image ImgC, the second image ImgBw that has been positionally corrected so as to be aligned with the first image ImgA is combined. The image is free of blurring and double images.
以上が、本実施の形態1に係る画像処理装置の動作の説明である。 The above is the description of the operation of the image processing apparatus according to the first embodiment.
<実施の形態1のまとめ>
本実施の形態1に係る画像処理装置では、視点の異なる複数露光条件の画像を合成する際に、全ての画素について位置ずれ探索を一律に行うのではなく、位置ずれ顕著性が小さい領域では位置ずれ探索に要する演算量を削減するので、第3画像ImgCの品位を保ちつつ、画素単位の位置ずれ探索に要する処理時間を低減することができる。以下、この効果について順を追って説明する。
<Summary of
In the image processing apparatus according to the first embodiment, when synthesizing images under a plurality of exposure conditions with different viewpoints, the positional deviation search is not uniformly performed for all pixels, but in an area where the conspicuousness of positional deviation is small, the position Since the amount of calculation required for the displacement search is reduced, it is possible to reduce the processing time required for the positional displacement search for each pixel while maintaining the quality of the third image ImgC. This effect will be described in order below.
本実施の形態1に係る画像処理装置では、露光条件の異なる2枚の画像を第1画像ImgAと第2画像ImgBとし、第1合成比率決定部1a及び第2合成比率決定部1bにおいて、それぞれ第1画像ImgA及び第2画像ImgBの輝度値に基づいて画素毎の合成比率を決定した。
In the image processing apparatus according to the first embodiment, two images with different exposure conditions are defined as the first image ImgA and the second image ImgB, and the first composition ratio determination unit 1a and the second composition
そして、位置ずれ顕著性判定部2において、第1合成比率WeiAと、第1合成比率画像WeiA及び第2合成比率画像WeiBの差分絶対値とに基づいて、第1画像ImgA及び第2画像ImgBの合成を行った場合に生成される合成画像の輝度に影響する程度を、位置ずれ顕著性Impとして画素毎に判定した。
Then, in the positional deviation
さらに、重み付き動きベクトル算出部3において、位置ずれ顕著性Impが小さくなるほど、位置ずれ探索に要する処理量を小さくしつつ、当該位置ずれ探索によって第1画像ImgAと第2画像ImgBとの間の画素毎の動きベクトルWを算出した。また、位置ずれ探索に要する処理量を小さくする手段の具体例として、画素毎に独立かつ並列に実行可能な処理要素に対して、位置ずれ探索を行う対象画素の数を削減したり、位置ずれ探索における位置ずれ候補位置の数を削減したり、反復処理の回数を削減するようにした。
Furthermore, in the weighted motion
最後に、位置補正部4a及び合成部4bを含む画像生成部4において、第1画像ImgAと、第2画像ImgBと、動きベクトルWとに基づく合成を行うことによって、第3画像ImgCを生成した。
Finally, the third image ImgC is generated by synthesizing the first image ImgA, the second image ImgB, and the motion vector W in the image generating unit 4 including the
一般に、ブロックマッチング法を用いた位置ずれ探索であれば、画素毎に複数の位置ずれ候補領域に対して最適な位置ずれを探索する処理を要する。勾配法を用いた位置ずれ探索であれば、連立方程式の解を求めるために画素毎に反復処理を要する。このため、画素毎の動きベクトルを算出する処理は、画素当たりの計算コスト(計算量)が非常に大きい処理である。したがって、CPU(Central Processing Unit)で画素毎の演算を逐次的に行うように実装する場合や、GPU(Graphics Processing Unit)等の並列プロセッサを用いて並列処理として実装する場合に、処理すべき画素の数や画素当たりの反復回数などの、位置ずれ探索に要する処理量が処理時間の課題となっている。 Generally, misregistration search using a block matching method requires a process of searching for the optimum misregistration for a plurality of misregistration candidate regions for each pixel. A misregistration search using the gradient method requires an iterative process for each pixel in order to solve the simultaneous equations. Therefore, the process of calculating a motion vector for each pixel is a process with a very high calculation cost (calculation amount) per pixel. Therefore, when implemented so that the calculation for each pixel is performed sequentially by a CPU (Central Processing Unit), or when implemented as parallel processing using a parallel processor such as a GPU (Graphics Processing Unit), the pixel to be processed The amount of processing required for the misregistration search, such as the number of vertices and the number of iterations per pixel, challenges the processing time.
本実施の形態1に係る画像処理装置は、第1画像ImgA及び第2画像ImgBの合成を行った場合に生成される合成画像において位置ずれ顕著性が小さい、すなわち、位置補正をしなくても合成画像に対してさほど大きな影響が目立たないと判定される画素において、上述したような計算コストがかかる位置ずれ探索の処理量を下げる。これにより、第3画像ImgCの品位を保ちつつ、画素単位の位置ずれ探索にかかる処理時間を低減することができる。 In the image processing apparatus according to the first embodiment, the synthesized image generated by synthesizing the first image ImgA and the second image ImgB has a small conspicuity of positional deviation. The processing amount of the above-described misregistration search, which is computationally costly, is reduced for pixels determined to have an insignificant effect on the composite image. As a result, it is possible to reduce the processing time required for searching for positional deviation in units of pixels while maintaining the quality of the third image ImgC.
また、本実施の形態1に係る画像処理装置では、重み付き動きベクトル算出部3において、第1合成比率画像WeiAと、第2合成比率画像WeiBとの間の位置ずれ探索を行うことによって、間接的に第1画像ImgAと第2画像ImgBとの間の動きベクトルWを算出する。
Further, in the image processing apparatus according to the first embodiment, the weighted motion
ここで、第1合成比率画像WeiA及び第2合成比率画像WeiBは互いに、明るさだけでなく、黒つぶれ相当輝度領域(合成比率が0の箇所)と、白とび相当輝度領域(合成比率が1の箇所)とが実質的に一致する画像である。また、第1画像ImgA及び第2画像ImgB同士の位置ずれは、第1合成比率画像WeiA及び第2合成比率画像WeiB同士の位置ずれとして保存される。このため、第1合成比率画像WeiA及び第2合成比率画像WeiBは、露光条件が異なることによる画像差異(黒つぶれや白とびなど)の影響が抑えられた、位置ずれ探索に適した画像であると言える。本実施の形態1では、第1合成比率画像WeiA及び第2合成比率画像WeiBに対して位置ずれ探索を行うため、黒つぶれや白とびなど画像差異がある部分に対して頑健な位置ずれ探索が可能になる。 Here, the first synthesis ratio image WeiA and the second synthesis ratio image WeiB each have not only brightness, but also a brightness area equivalent to blocked-up shadows (where the synthesis ratio is 0) and a brightness area equivalent to overexposed highlights (where the synthesis ratio is 1). ) are images that substantially match each other. Also, the positional deviation between the first image ImgA and the second image ImgB is stored as the positional deviation between the first composite ratio image WeiA and the second composite ratio image WeiB. For this reason, the first composite ratio image WeiA and the second composite ratio image WeiB are images suitable for searching for misregistration, in which the effects of image differences (such as blocked-up shadows and blown-out highlights) due to different exposure conditions are suppressed. I can say. In the first embodiment, since the positional displacement search is performed on the first composite ratio image WeiA and the second composite ratio image WeiB, robust positional displacement search can be performed for portions with image differences such as blocked-up shadows and blown-out highlights. be possible.
さらに、黒つぶれ領域及び白とび領域が相当の面積をもつ場合には、これらの領域で高精度な位置ずれ探索を行うことは原理的に不可能であり、エラーの原因となる可能性がある。しかしながら、このような領域では、第1画像ImgAの合成比率が1となるか、第1合成比率画像WeiAと第2合成比率画像WeiBとの差分が0となって、位置ずれ顕著性が0となるため、位置ずれ探索を行わないことが可能となる。これにより本実施の形態1によれば、処理時間を低減させる効果に加え、黒つぶれ、白とび領域における位置ずれ探索の誤差を抑制することができる。 Furthermore, when the underexposure region and overexposed region have a considerable area, it is theoretically impossible to perform a high-precision displacement search in these regions, which may cause errors. . However, in such an area, the synthesis ratio of the first image ImgA is 1, or the difference between the first synthesis ratio image WeiA and the second synthesis ratio image WeiB is 0, and the positional deviation saliency is 0. Therefore, it is possible not to search for positional deviation. Thus, according to the first embodiment, in addition to the effect of reducing the processing time, it is possible to suppress positional deviation search errors in blocked-up shadows and blown-out highlights.
なお、上述したように、位置ずれ顕著性判定部2において、式(8)に示す関係により、位置ずれ顕著性を算出するようにしてもよい。式(8)におけるr1,r2の値をそれぞれ調整することにより、位置ずれ顕著性への第1合成比率WeiAの寄与、及び、位置ずれ顕著性への、第1合成比率WeiAと第2合成比率WeiBとの差分絶対値の寄与をそれぞれ調整することができる。これにより、第3画像ImgCにおいて位置ずれが目立つ程度と、処理時間のバランスを調整することが可能になる。
Note that, as described above, the positional deviation
以上のことから、本実施の形態1によれば、位置ずれ顕著性が小さい領域では位置ずれ探索に要する処理量を削減するようにしたので、第3画像ImgCの品位を保ちつつ、位置ずれ探索にかかる処理時間を低減することができる。 As described above, according to the first embodiment, the amount of processing required for searching for misregistration is reduced in regions where the conspicuousness of misregistration is small. processing time can be reduced.
以上、図1に示される画像処理装置の各部分(機能ブロックとして図示した部分)は、処理回路により実現される。処理回路は、専用のハードウェアであっても、プログラムを実行するプロセッサであってもよい。例えば、図1の各部分の機能をそれぞれ処理回路で実現してもよいし、複数の部分の機能をまとめて処理回路で実現してもよい。 Each part of the image processing apparatus shown in FIG. 1 (the part shown as a functional block) is implemented by a processing circuit. The processing circuitry may be dedicated hardware or a processor executing a program. For example, the function of each part in FIG. 1 may be realized by a processing circuit, or the functions of a plurality of parts may be collectively realized by a processing circuit.
処理回路がプロセッサである場合、画像処理装置の各部分の機能は、ソフトウェア、ファームウェア、またはソフトウェアとファームウェアとの組み合わせにより実現される。ソフトウェア或いはファームウェアはプログラムとして記述され、記憶媒体(記録媒体)に格納される。処理回路は、記憶媒体に格納されたプログラムをメモリに読み込んで実行することにより、各部の機能を実現する。このプログラムは、画像処理装置で実施される画像処理方法における処理をコンピュータに実行させるものであると言える。 When the processing circuit is a processor, the function of each part of the image processing device is implemented by software, firmware, or a combination of software and firmware. Software or firmware is written as a program and stored in a storage medium (recording medium). The processing circuit implements the function of each part by reading a program stored in a storage medium into a memory and executing the program. It can be said that this program causes a computer to execute processing in an image processing method implemented in an image processing apparatus.
画像処理装置の各部分の機能のうち、一部を専用のハードウェアで実現し、一部をソフトウェアまたはファームウェアで実現するようにしてもよい。 Some of the functions of each part of the image processing apparatus may be implemented by dedicated hardware, and some may be implemented by software or firmware.
このように、処理回路は、ハードウェア、ソフトウェア、ファームウェア、またはこれらの組み合わせによって、上述の各機能を実現することができる。 Thus, the processing circuitry may implement each of the functions described above through hardware, software, firmware, or a combination thereof.
図8は、単一のプロセッサを含むコンピュータ60aによって、図1の画像処理装置のすべての機能を実現する場合の構成の一例を、撮像装置10a及び記憶装置11aとともに示す図である。図8の例では、コンピュータ60aと撮像装置10aと記憶装置11aとで撮像システムが構成されている。
FIG. 8 is a diagram showing an example of a configuration in which all the functions of the image processing apparatus of FIG. 1 are implemented by a
図8に示されるコンピュータ60aは、プロセッサ61aと、メモリ62aと、入力インターフェース63aと、出力インターフェース64aとを備え、これらはバス65aで接続されている。
A
入力インターフェース63aには、撮像装置10aにより異なる露光条件で撮像された画像Ia,Ib、及び、各画像の露光量Ea,Ebの情報が入力される。あるいは、撮像装置10aにより異なる露光条件で撮像された画像Ia,Ib、及び、各画像の露光量Ea,Ebをいったん記憶装置11aに保存し、記憶装置11aから読み出した画像Ia,Ib、及び、各画像の露光量Ea,Ebの情報が入力インターフェース63aに入力される。
The input interface 63a receives images Ia and Ib captured under different exposure conditions by the
プロセッサ61aは、メモリ62aに記憶されたプログラムに従って動作し、入力インターフェース63aを介して入力された画像Ia,Ibに対して、実施の形態1の画像処理装置の各部の処理を行って、処理の結果得られた出力信号を出力インターフェース64aから出力する。あるいは、プロセッサ61aは、処理の結果得られた出力信号を、出力インターフェース64aを介して記憶装置11aに保存する。
The
以上のように、本実施の形態1の画像合成装置及び画像合成装置方法、並びに画像処理装置及び方法のいずれかにおける処理の一部または全部をコンピュータに実行させるプログラム、及び該プログラムを記録した、コンピュータで読み取り可能な記憶媒体もまた本実施の形態1の一部を成す。 As described above, a program for causing a computer to execute part or all of the processing in any one of the image synthesizing device, the image synthesizing device method, and the image processing device and method of the first embodiment, and the program are recorded, A computer-readable storage medium also forms part of the first embodiment.
<変形例>
以上の説明では、撮像画像のうち、露光の少ない画像を基準画像及び第1画像ImgAとし、露光の多い画像を参照画像及び第2画像ImgBとして説明した。しかしながら、上述したように、これとは逆に、露光の多い画像を基準画像及び第1画像ImgAとし、露光の少ない画像を参照画像及び第2画像ImgBとしてもよい。この場合には、第1合成比率決定部1a及び第2合成比率決定部1bにおいて輝度値及び合成比率のそれぞれの関係を反転させる。つまり、輝度値の低い側で第1画像ImgAに対する合成比率が大きく、輝度値の高い側で第1画像ImgAに対する合成比率が小さくなるような第1合成比率画像WeiA及び第2合成比率画像WeiBを生成すればよい。そして、その他の処理は上述の処理と同様に行えばよい。
<Modification>
In the above description, among the captured images, an image with low exposure is defined as the reference image and the first image ImgA, and an image with high exposure is defined as the reference image and the second image ImgB. However, as described above, conversely, an image with high exposure may be used as the reference image and the first image ImgA, and an image with low exposure may be used as the reference image and the second image ImgB. In this case, the relationship between the luminance value and the synthesis ratio is reversed in the first synthesis ratio determination unit 1a and the second synthesis
また、以上の説明では、第1合成比率は、第1画像ImgAの輝度値に基づく、第1画像ImgAの画像の合成における画素毎の合成比率であった。しかしながら、第1合成比率は、第1画像ImgAの輝度値に基づく、第2画像ImgBの画像の合成における画素毎の合成比率であってもよい。同様に、第2合成比率は、第2画像ImgBの輝度値に基づく、第2画像ImgBの画像の合成における画素毎の合成比率であってもよい。 Also, in the above description, the first synthesis ratio is the synthesis ratio for each pixel in synthesizing the first image ImgA based on the luminance value of the first image ImgA. However, the first synthesis ratio may be a synthesis ratio for each pixel in synthesizing the image of the second image ImgB based on the luminance value of the first image ImgA. Similarly, the second synthesis ratio may be a synthesis ratio for each pixel in synthesizing the image of the second image ImgB based on the luminance value of the second image ImgB.
そして、位置ずれ顕著性判定部2は、第2合成比率が小さくなるほど位置ずれ顕著性を大きくし、かつ、第1合成比率と第2合成比率との差分絶対値が大きくなるほど位置ずれ顕著性を大きくしてもよい。加えて、位置補正部4aは、動きベクトルWに基づいて第1画像ImgAの位置を画素毎に補正し、合成部4bは、第2合成比率に基づいて、第2画像ImgBと、位置が補正された第1画像ImgAとを重み付け加算する合成を行うことによって、第3の画像ImgCを生成してもよい。以上のような構成によっても、上記の効果が得られる。
Then, the positional deviation
なお、本発明は、その発明の範囲内において、実施の形態を適宜、変形、省略することが可能である。 In addition, within the scope of the invention, the embodiments can be appropriately modified or omitted.
1a 第1合成比率決定部、1b 第2合成比率決定部、2 位置ずれ顕著性判定部、3 重み付きベクトル算出部、4 画像生成部、4a 位置補正部、4b 合成部、ImgA 第1画像、ImgB 第2画像、ImgBw 位置補正後の第2画像、ImgC 第3画像、Imp 位置ずれ顕著性画像、W 動きベクトル、WeiA 第1合成比率画像、WeiB 第2合成比率画像。
1a first synthesis
Claims (11)
前記第1画像の輝度値に基づいて、前記第1画像及び前記第2画像の合成を行った場合の、前記第1画像及び前記第2画像の一方の画像の合成における画素毎の第1合成比率を決定する第1合成比率決定部と、
前記第2画像の輝度値に基づいて、前記第1画像及び前記第2画像の合成を行った場合の、前記一方の画像の合成における画素毎の第2合成比率を決定する第2合成比率決定部と、
前記第1合成比率及び前記第2合成比率に基づいて、前記第1画像と前記第2画像との間の位置ずれが、前記第1画像及び前記第2画像の合成を行った場合に生成される合成画像の輝度に影響する程度を、位置ずれ顕著性として画素毎に判定する位置ずれ顕著性判定部と、
前記位置ずれ顕著性に基づいて、位置ずれ探索に要する処理量を変更しつつ、当該位置ずれ探索によって前記第1画像と前記第2画像との間の画素毎の動きベクトルを算出する重み付き動きベクトル算出部と、
前記第1画像と、前記第2画像と、前記動きベクトルとに基づく合成を行うことによって、第3画像を生成する画像生成部と
を備える、画像処理装置。 An image processing device that performs synthesis based on a first image and a second image that have different exposure conditions and correspond to each other,
a first synthesis for each pixel in synthesizing one of the first image and the second image when the first image and the second image are synthesized based on the luminance value of the first image; a first synthesis ratio determining unit that determines the ratio;
Determining a second synthesis ratio for determining a second synthesis ratio for each pixel in synthesis of the one image when the first image and the second image are synthesized based on the luminance value of the second image. Department and
Based on the first composition ratio and the second composition ratio, the displacement between the first image and the second image is generated when the first image and the second image are composited. a misregistration saliency determination unit that determines, for each pixel, the degree of influence on the luminance of a synthesized image that is based on the misregistration saliency;
Weighted motion for calculating a motion vector for each pixel between the first image and the second image by searching for positional displacement while changing the amount of processing required for searching for positional displacement based on the conspicuity of positional displacement. a vector calculator;
An image processing apparatus comprising: an image generation unit configured to generate a third image by combining the first image, the second image, and the motion vector.
前記位置ずれ顕著性判定部は、
前記第1合成比率及び前記第2合成比率の一方が小さくなるほど前記位置ずれ顕著性を大きくし、かつ、前記第1合成比率と前記第2合成比率との差分絶対値が大きくなるほど前記位置ずれ顕著性を大きくし、
前記重み付き動きベクトル算出部は、
前記位置ずれ顕著性が小さくなるほど、前記位置ずれ探索に要する処理量を小さくする、画像処理装置。 The image processing device according to claim 1,
The misalignment saliency determination unit
The positional deviation conspicuity is increased as one of the first synthesis ratio and the second synthesis ratio decreases, and the positional deviation is conspicuous as the absolute difference between the first synthesis ratio and the second synthesis ratio increases. increase sexuality,
The weighted motion vector calculator,
The image processing device, wherein the smaller the positional deviation conspicuity, the smaller the amount of processing required for the positional deviation search.
前記重み付き動きベクトル算出部は、
前記第1合成比率によって形成される第1合成比率画像と、前記第2合成比率によって形成される第2合成比率画像との間の位置ずれ探索を行うことによって、前記動きベクトルを算出する、画像処理装置。 The image processing device according to claim 1 or claim 2,
The weighted motion vector calculator,
calculating the motion vector by performing a position shift search between a first composite ratio image formed by the first composite ratio and a second composite ratio image formed by the second composite ratio; processing equipment.
前記重み付き動きベクトル算出部は、
前記位置ずれ顕著性に基づいて、ブロックマッチング法を用いた位置ずれ探索が行われる画素の数を変更することによって、前記位置ずれ探索に要する処理量を変更する、画像処理装置。 The image processing device according to any one of claims 1 to 3,
The weighted motion vector calculator,
An image processing device that changes the amount of processing required for the positional deviation search by changing the number of pixels for which the positional deviation search using a block matching method is performed based on the positional deviation saliency.
前記重み付き動きベクトル算出部は、
前記位置ずれ顕著性に基づいて、ブロックマッチング法を用いた位置ずれ探索における位置ずれ候補位置の数を変更することによって、前記位置ずれ探索に要する処理量を変更する、画像処理装置。 The image processing device according to any one of claims 1 to 3,
The weighted motion vector calculator,
An image processing device that changes the amount of processing required for the positional displacement search by changing the number of positional displacement candidate positions in the positional displacement search using a block matching method based on the positional displacement conspicuity.
前記重み付き動きベクトル算出部は、
前記位置ずれ顕著性に基づいて、勾配法を用いた位置ずれ探索における反復処理の回数を変更することによって、前記位置ずれ探索に要する処理量を変更する、画像処理装置。 The image processing device according to any one of claims 1 to 3,
The weighted motion vector calculator,
An image processing device that changes the amount of processing required for the positional deviation search by changing the number of iterative processes in the positional deviation search using a gradient method based on the positional deviation saliency.
前記位置ずれ顕著性判定部は、
画素位置がpである前記第1合成比率、前記第2合成比率、前記位置ずれ顕著性をそれぞれWeiA(p)、WeiB(p)、Imp(p)とし、r1、r2を0以上の実数とした場合に、前記第1合成比率及び前記第2合成比率に基づき、次式(11)に従って前記位置ずれ顕著性を判定する、画像処理装置。
The misalignment saliency determination unit
Let WeiA(p), WeiB(p), and Imp(p) be the first synthesis ratio, the second synthesis ratio, and the positional deviation salience, respectively, where the pixel position is p, and r 1 and r 2 are 0 or more. An image processing apparatus that determines the conspicuity of positional deviation according to the following equation (11) based on the first synthesis ratio and the second synthesis ratio when real numbers are used.
前記画像生成部は、
前記動きベクトルに基づいて前記第1画像及び前記第2画像の他方の画像の位置を画素毎に補正する位置補正部と、
前記第1合成比率または前記第2合成比率に基づいて、前記一方の画像と、位置が補正された前記他方の画像とを重み付け加算する合成を行うことによって、第3の画像を生成する合成部と
を含む、画像処理装置。 The image processing device according to any one of claims 1 to 7,
The image generator is
a position correction unit that corrects the position of the other image of the first image and the second image based on the motion vector for each pixel;
A synthesizing unit that generates a third image by synthesizing the one image and the position-corrected other image with weighted addition based on the first synthesis ratio or the second synthesis ratio. and an image processing device.
前記第1画像の輝度値に基づいて、前記第1画像及び前記第2画像の合成を行った場合の、前記第1画像及び前記第2画像の一方の画像の合成における画素毎の第1合成比率を決定し、
前記第2画像の輝度値に基づいて、前記第1画像及び前記第2画像の合成を行った場合の、前記一方の画像の合成における画素毎の第2合成比率を決定し、
前記第1合成比率及び前記第2合成比率に基づいて、前記第1画像と前記第2画像との間の位置ずれが、前記第1画像及び前記第2画像の合成を行った場合に生成される合成画像の輝度に影響する程度を、位置ずれ顕著性として画素毎に判定し、
前記位置ずれ顕著性に基づいて、位置ずれ探索に要する処理量を変更しつつ、当該位置ずれ探索によって前記第1画像と前記第2画像との間の画素毎の動きベクトルを算出し、
前記第1画像と、前記第2画像と、前記動きベクトルとに基づく合成を行うことによって、第3画像を生成する、画像処理方法。 An image processing method for synthesizing based on a first image and a second image that have different exposure conditions and correspond to each other,
a first synthesis for each pixel in synthesizing one of the first image and the second image when the first image and the second image are synthesized based on the luminance value of the first image; determine the ratio,
determining a second synthesis ratio for each pixel in synthesis of the one image when the first image and the second image are synthesized based on the luminance value of the second image;
Based on the first composition ratio and the second composition ratio, the displacement between the first image and the second image is generated when the first image and the second image are composited. The degree of influence on the brightness of the synthesized image is determined for each pixel as the salience of positional deviation
calculating a motion vector for each pixel between the first image and the second image by the positional displacement search while changing the processing amount required for the positional displacement search based on the positional displacement conspicuity;
An image processing method, wherein a third image is generated by combining the first image, the second image, and the motion vector.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2018099369A JP7133979B2 (en) | 2018-05-24 | 2018-05-24 | Image processing device, image processing method, image processing program, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2018099369A JP7133979B2 (en) | 2018-05-24 | 2018-05-24 | Image processing device, image processing method, image processing program, and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2019205073A JP2019205073A (en) | 2019-11-28 |
JP7133979B2 true JP7133979B2 (en) | 2022-09-09 |
Family
ID=68727443
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2018099369A Active JP7133979B2 (en) | 2018-05-24 | 2018-05-24 | Image processing device, image processing method, image processing program, and storage medium |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP7133979B2 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114820404B (en) * | 2021-01-29 | 2024-08-20 | 抖音视界有限公司 | Image processing method, device, electronic equipment and medium |
EP4248657A4 (en) * | 2021-06-15 | 2024-01-03 | Samsung Electronics Co., Ltd. | METHODS AND SYSTEMS FOR ENHANCEMENT OF LOW-LIGHT MEDIA |
WO2022265321A1 (en) | 2021-06-15 | 2022-12-22 | Samsung Electronics Co., Ltd. | Methods and systems for low light media enhancement |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008118555A (en) | 2006-11-07 | 2008-05-22 | Canon Inc | Image processor, image pickup device, and image processing method |
-
2018
- 2018-05-24 JP JP2018099369A patent/JP7133979B2/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008118555A (en) | 2006-11-07 | 2008-05-22 | Canon Inc | Image processor, image pickup device, and image processing method |
Also Published As
Publication number | Publication date |
---|---|
JP2019205073A (en) | 2019-11-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103168462B (en) | Image synthesizer and image combining method | |
JP5687553B2 (en) | Image composition apparatus, image composition method, and image composition program | |
CN104980652B (en) | Image processing apparatus and image processing method | |
JP6326180B1 (en) | Image processing device | |
US20120062694A1 (en) | Imaging apparatus, imaging method, and program | |
US20120008005A1 (en) | Image processing apparatus, image processing method, and computer-readable recording medium having image processing program recorded thereon | |
JP6678376B2 (en) | Motion detection device and motion detection method | |
US10269128B2 (en) | Image processing device and method, and recording medium | |
WO2012147719A1 (en) | Image processing apparatus, image processing method, and image processing program | |
JP6648914B2 (en) | Image processing apparatus, image processing method, and program | |
JP5610245B2 (en) | Image composition apparatus, image composition method, image composition program, and recording medium | |
JP7133979B2 (en) | Image processing device, image processing method, image processing program, and storage medium | |
KR20150035315A (en) | Method for generating a High Dynamic Range image, device thereof, and system thereof | |
KR100956228B1 (en) | Image processing device with distortion image correction | |
JP2015144475A (en) | Imaging apparatus, control method of the same, program and storage medium | |
JP5882702B2 (en) | Imaging device | |
JP6800090B2 (en) | Image processing equipment, image processing methods, programs and recording media | |
JP7057079B2 (en) | Image processing device, image pickup device, image processing method, and program | |
US11373316B2 (en) | Apparatus and method for calculating motion vector | |
JP2019101997A (en) | Image processing apparatus and image processing method reducing noise by composing plural captured images | |
JP6494388B2 (en) | Image processing apparatus, image processing method, and program | |
JP2007234034A (en) | Image processor and image processing method | |
JP6554009B2 (en) | IMAGE PROCESSING APPARATUS, CONTROL METHOD THEREOF, PROGRAM, AND RECORDING MEDIUM | |
JP5364887B2 (en) | Image composition apparatus, image composition method, image composition program, and recording medium | |
KR20140133391A (en) | Apparatus and method for image processing. |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20210326 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20220112 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20220201 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20220315 |
|
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: 20220802 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20220830 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 7133979 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |