JP5711005B2 - Flicker correction method and image processing apparatus - Google Patents
Flicker correction method and image processing apparatus Download PDFInfo
- Publication number
- JP5711005B2 JP5711005B2 JP2011040148A JP2011040148A JP5711005B2 JP 5711005 B2 JP5711005 B2 JP 5711005B2 JP 2011040148 A JP2011040148 A JP 2011040148A JP 2011040148 A JP2011040148 A JP 2011040148A JP 5711005 B2 JP5711005 B2 JP 5711005B2
- Authority
- JP
- Japan
- Prior art keywords
- image
- frame
- reference image
- frame images
- generating
- 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
Links
- 238000000034 method Methods 0.000 title claims description 137
- 238000012937 correction Methods 0.000 title claims description 114
- 238000012545 processing Methods 0.000 title claims description 45
- 238000003384 imaging method Methods 0.000 claims description 70
- 230000004397 blinking Effects 0.000 claims description 62
- 238000012935 Averaging Methods 0.000 claims description 15
- 238000007796 conventional method Methods 0.000 description 51
- 238000010586 diagram Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 2
- 238000005096 rolling process Methods 0.000 description 2
- 230000002411 adverse Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000007429 general method Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
Images
Landscapes
- Studio Devices (AREA)
Description
本発明は、フリッカ補正方法および画像処理装置に関する。 The present invention relates to a flicker correction method and an image processing apparatus.
動画のフリッカ補正の一般的な方法として、過去の複数枚のフレーム画像を平均化して基準画像(フリッカのない画像)を生成し、生成した基準画像とフリッカ補正を行うフレーム画像との比を補正係数として算出し、フリッカ補正を行うフレーム画像に補正係数を乗算するという技術が知られている。また、商用電源の周波数が50Hz地域において、蛍光灯照明下で60fpsの動画を撮像するときに、3枚のフレーム画像の平均値を基準画像としてフリッカ補正を行う技術が知られている(例えば、特許文献1参照)。 As a general method of flicker correction of moving images, a plurality of past frame images are averaged to generate a reference image (an image without flicker), and the ratio between the generated reference image and a frame image to be subjected to flicker correction is corrected. A technique is known in which a frame image to be calculated as a coefficient and subjected to flicker correction is multiplied by a correction coefficient. Also, a technique is known that performs flicker correction using an average value of three frame images as a reference image when a 60 fps moving image is captured under fluorescent lighting in a region where the frequency of a commercial power supply is 50 Hz (for example, Patent Document 1).
以下、従来知られているフリッカ補正における基準画像の生成原理について説明する。図9は、従来知られている光源の明滅周波数とフレーム画像の撮像タイミングとを示したグラフである。グラフの横軸は時間を示し、縦軸は光源の明るさを示す。なお、光源が一番明るい場合の明るさを1とし、光源が一番暗い場合の明るさを−1としている。また、光源の明るさが、一番明るい場合と一番暗い場合とのちょうど中間の明るさを0としている。また、曲線900は、光源の明滅周波数(理想状態としてサインカーブとしている)を示している。また、点901〜903は、フレーム画像の撮像タイミングを示している。
Hereinafter, the generation principle of the reference image in the conventionally known flicker correction will be described. FIG. 9 is a graph showing a blinking frequency of a light source and a frame image capturing timing which are conventionally known. The horizontal axis of the graph indicates time, and the vertical axis indicates the brightness of the light source. Note that the brightness when the light source is the brightest is 1, and the brightness when the light source is the darkest is -1. The brightness between the light source brightness and the darkest brightness is set to 0. A
フリッカは、光源の明滅周波数と撮像周波数(フレームレート)のずれが原因で起こる。図示する例では、光源の明滅周波数は100Hzであり、撮像する動画のフレームレートは60fpsである。1フレーム目の撮像は、時間0msのとき(図中の点901)に行っている。このときの光源の明るさはちょうど中央値であるため、撮像したフレーム画像の明るさも中央値となる。また、2フレーム目の撮像は、時間16.67msのとき(図中の点902)に行っている。このときの光源の明るさは中央値よりも暗くなっているため、撮像したフレーム画像の明るさは中央値よりも暗くなる。また、3フレーム目の撮像は、時間33.33msのとき(図中の点903)に行っている。このときの光源の明るさは中央値よりも明るくなっているため、撮像したフレーム画像の明るさは中央値よりも明るくなる。4フレーム目の撮像は、時間50msのとき(図中の点904)に行っており、このときの光源の明るさは1フレーム目の撮像と同様に中央値となる。以降、上記のパターンが繰り返される。
Flicker is caused by a difference between the blinking frequency of the light source and the imaging frequency (frame rate). In the illustrated example, the blinking frequency of the light source is 100 Hz, and the frame rate of the moving image to be captured is 60 fps. The first frame is imaged at
上記の1フレーム目〜3フレーム目に撮像した3枚のフレーム画像において、それぞれのフレーム画像における同一の座標の画素毎に、画素値の平均値を算出することで、ちょうど光源の明るさが中央値のときに撮像したフレーム画像と同じ明るさの画像(基準画像)が得られる。すなわち、1フレーム目〜3フレーム目に撮像した3枚のフレーム画像を平均化することで、基準画像を得ることができる。具体的には、1フレーム目に撮像したフレーム画像における座標(1,1)の画素値と、2フレーム目に撮像したフレーム画像における座標(1,1)の画素値と、3フレーム目に撮像したフレーム画像における座標(1,1)の画素値との平均値を算出し、算出した値を基準画像の座標(1,1)の画素値とする。同様に、他の座標の画素値についても平均値を算出して基準画像を生成する。このように、1フレーム目〜3フレーム目に撮像した3枚のフレーム画像を平均化することで、基準画像を生成することができる。 In the three frame images captured in the first to third frames, the average value of the pixel values is calculated for each pixel having the same coordinates in each frame image, so that the brightness of the light source is exactly the center. An image (reference image) having the same brightness as that of the frame image captured when the value is obtained is obtained. That is, the reference image can be obtained by averaging the three frame images captured in the first to third frames. Specifically, the pixel value at the coordinate (1, 1) in the frame image captured in the first frame, the pixel value at the coordinate (1, 1) in the frame image captured in the second frame, and the image in the third frame The average value with the pixel value of the coordinate (1, 1) in the frame image is calculated, and the calculated value is set as the pixel value of the coordinate (1, 1) of the reference image. Similarly, a reference image is generated by calculating an average value for pixel values of other coordinates. In this manner, the reference image can be generated by averaging the three frame images captured in the first to third frames.
そして、例えば、3フレーム目に撮像したフレーム画像に対してフリッカ補正を行う場合には、基準画像と、3フレーム目に撮像したフレーム画像との画素値の比を補正係数として算出し、3フレーム目に撮像したフレーム画像の画素値に補正係数を乗算することで、3フレーム目に撮像したフレーム画像のフリッカを補正することができる。なお、フリッカ補正を行うフレーム画像を補正対象画像とする。 For example, when flicker correction is performed on the frame image captured in the third frame, the ratio of the pixel values of the reference image and the frame image captured in the third frame is calculated as a correction coefficient, and 3 frames By multiplying the pixel value of the frame image captured by the eye by the correction coefficient, the flicker of the frame image captured by the third frame can be corrected. Note that a frame image to be subjected to flicker correction is a correction target image.
なお、光源の明滅周波数が100Hzであり、撮像する動画のフレームレートが60fpsである場合に3枚のフレーム画像を用いて基準画像を生成する例を用いて説明したが、光源の明滅周波数や撮像する動画のフレームレートが上述した例と異なる場合においても、複数枚のフレーム画像を用いて基準画像を生成することができる。なお、基準画像を生成するために必要なフレーム画像の枚数は、光源の周波数b(Hz)と撮像する動画のフレームレートa(fps)とから算出することができる。具体的には、撮像する動画のフレームレートa(fps)の逆数1/aと、光源の明滅周波数b(Hz)の逆数1/bとの最小公倍数を算出する。そして、算出した最小公倍数の分母の値を、フレームレートと同じ値にした場合の分子の値が、基準画像を生成する際に必要な画像の枚数となる。 In addition, although the blinking frequency of the light source is 100 Hz and the frame rate of the moving image to be picked up is 60 fps, the reference image is generated using the three frame images. Even when the frame rate of the moving image is different from the above-described example, the reference image can be generated using a plurality of frame images. Note that the number of frame images necessary to generate the reference image can be calculated from the frequency b (Hz) of the light source and the frame rate a (fps) of the moving image to be captured. Specifically, the least common multiple of the reciprocal 1 / a of the frame rate a (fps) of the moving image to be captured and the reciprocal 1 / b of the blinking frequency b (Hz) of the light source is calculated. Then, the numerator value when the calculated denominator value of the least common multiple is the same value as the frame rate is the number of images necessary for generating the reference image.
なお、上述した説明および以降の説明では、説明を容易にするため、露光時間(撮像素子のシャッタが開いている時間)を0としているが、これはもちろん1/60秒等の、実際に即した時間であって構わない。その場合のフレーム画像の明るさは、撮像素子がグローバルシャッタであれば露光時間内の平均輝度となり、ローリングシャッタであればフレーム画像のライン毎に明るさが変わるが、上述の補正原理には変わりない。 In the above description and the following description, the exposure time (the time during which the shutter of the image sensor is open) is set to 0 for ease of explanation. It does not matter if it is In this case, the brightness of the frame image is the average brightness within the exposure time if the image sensor is a global shutter, and the brightness changes for each line of the frame image if it is a rolling shutter. Absent.
ところが、近年高フレームレートで画像を撮像できる撮像素子が開発され、その特徴を生かしたカメラが開発されている。また、フリッカ補正に用いる基準画像を生成するために必要なフレーム画像の枚数は、光源の明滅周波数と、撮像する動画のフレームレートとの組み合わせによって異なる。一般的に、フレームレートが高くなるほど、フリッカ補正に用いる基準画像を生成するために必要なフレーム画像の枚数は多くなる。そのため、フレームレートが60fps以上の動画を撮像することが可能な撮像装置においては、3枚以上のフレーム画像が必要になることがある。 However, in recent years, image sensors that can capture images at a high frame rate have been developed, and cameras that take advantage of these features have been developed. In addition, the number of frame images necessary for generating a reference image used for flicker correction varies depending on the combination of the blinking frequency of the light source and the frame rate of the moving image to be captured. In general, the higher the frame rate, the greater the number of frame images required to generate a reference image used for flicker correction. Therefore, in an imaging device that can capture a moving image with a frame rate of 60 fps or more, three or more frame images may be required.
基準画像を生成するために必要なフレーム画像の枚数が多くなる例として、例えば光源の明滅周波数が50Hzであり、撮像する動画のフレームレートが240fpsの場合がある。このときは、基準画像を生成するために、上述した方法では理論上12枚のフレーム画像が必要となる。従って、このような条件でフリッカ補正を行う場合、12枚分のフレーム画像を保存するメモリが必要となり、また常に最新の12枚のフレーム画像の平均化を行って基準画像を生成する必要があるため、各フレーム画像のフリッカ補正処理を行う毎に、12枚のフレーム画像の平均化を行う時間もしくは演算回路が必要となる。そのため、従来知られているフリッカ補正の方法では、メモリや、回路規模や、処理時間が大きくなるという問題がある。 As an example in which the number of frame images necessary for generating a reference image increases, for example, the blinking frequency of the light source is 50 Hz and the frame rate of the moving image to be captured is 240 fps. In this case, in order to generate the reference image, the above method theoretically requires 12 frame images. Therefore, when performing flicker correction under such conditions, a memory for storing 12 frame images is required, and it is necessary to always generate the reference image by averaging the latest 12 frame images. For this reason, every time flicker correction processing is performed on each frame image, a time or arithmetic circuit for averaging the 12 frame images is required. Therefore, the conventionally known flicker correction methods have a problem that the memory, the circuit scale, and the processing time are increased.
本発明は、上記事情に鑑みてなされたものであり、高フレームレートの動画を撮像する際にフリッカ補正を行う場合においても、メモリや、回路規模や、処理時間をより小さくすることができるフリッカ補正方法および画像処理装置を提供することを目的とする。 The present invention has been made in view of the above circumstances, and even when flicker correction is performed when capturing a high frame rate moving image, the flicker can reduce the memory, circuit scale, and processing time. An object is to provide a correction method and an image processing apparatus.
本発明は、算出部が、撮像する動画のフレームレートa[fps]と光源の明滅周波数b[Hz]とから、1/aと1/bとの最小公倍数を算出し、算出した最小公倍数の分母の値をaに変換した場合の分子の値に含まれる1を除く最小の約数nを算出する算出ステップと、基準画像生成部が、前記最小公倍数を前記明滅周波数b倍した周期をn等分したタイミングで撮像したn枚のフレーム画像を平均化して基準画像を生成する基準画像生成ステップと、補正部が、前記基準画像に基づいて、撮像した前記動画のフリッカ補正を行う補正ステップと、を含むことを特徴とするフリッカ補正方法である。 In the present invention, the calculation unit calculates the least common multiple of 1 / a and 1 / b from the frame rate a [fps] of the moving image to be captured and the blinking frequency b [Hz] of the light source, and the calculated least common multiple A calculation step of calculating a minimum divisor n excluding 1 included in the numerator value when the denominator value is converted to a, and a reference image generation unit that sets a cycle of the least common multiple multiplied by the blinking frequency b to n A reference image generating step for generating a reference image by averaging n frame images captured at equally divided timings, and a correcting step for performing flicker correction of the captured moving image based on the reference image; , Including a flicker correction method.
また、本発明のフリッカ補正方法において、前記基準画像生成ステップでは、前記n枚のフレーム画像のうち、最も過去に撮像したフレーム画像と同じ明るさのフレーム画像を得たときに、前記基準画像を更新することを特徴とする。 Further, in the flicker correction method of the present invention, in the reference image generation step, when the frame image having the same brightness as the frame image captured most recently is obtained among the n frame images, the reference image is determined. It is characterized by updating.
また、本発明のフリッカ補正方法において、前記基準画像生成ステップでは、前記基準画像の更新は、前回の更新から所定の時間以上経過した場合に行うことを特徴とする。 In the flicker correction method of the present invention, in the reference image generation step, the reference image is updated when a predetermined time or more has elapsed since the previous update.
また、本発明は、明滅周波数b[Hz]の光源下でフレームレートa[fps]の動画を撮像する撮像部と、前記フレームレートa[fps]と前記明滅周波数b[Hz]とから、1/aと1/bとの最小公倍数を算出し、算出した最小公倍数の分母の値をaに変換した場合の分子の値に含まれる1を除く最小の約数nを算出する算出部と、前記最小公倍数を前記明滅周波数b倍した周期をn等分したタイミングで撮像したn枚のフレーム画像を平均化して基準画像を生成する基準画像生成部と、前記基準画像生成部が生成した前記基準画像に基づいて、前記撮像部が撮像した前記動画のフリッカ補正を行う補正部と、を備えることを特徴とする画像処理装置である。 Further, the present invention provides an imaging unit that captures a moving image having a frame rate a [fps] under a light source having a blinking frequency b [Hz], the frame rate a [fps], and the blinking frequency b [Hz]. Calculating a least common multiple of / a and 1 / b, and calculating a minimum divisor n excluding 1 included in a numerator value when the calculated denominator of the least common multiple is converted to a; a reference image generation unit that generates a reference image n frame images of the captured cycle the least common multiple and the blink frequency b times at a timing n equal parts by averaging, the reference to the reference image generating unit has generated An image processing apparatus comprising: a correction unit that performs flicker correction on the moving image captured by the imaging unit based on an image.
本発明によれば、算出部は、撮像する動画のフレームレートa[fps]と光源の明滅周波数b[Hz]とから、1/aと1/bとの最小公倍数を算出し、算出した最小公倍数の分母の値をaに変換した場合の分子の値に含まれる1を除く最小の約数nを算出する。また、基準画像生成部は、前記最小公倍数を明滅周波数b倍した周期をn等分したタイミングで撮像したn枚のフレーム画像を平均化して基準画像を生成する。また、補正部は、基準画像に基づいて、撮像した動画のフリッカ補正を行う。これにより、基準画像を生成する際に用いるフレーム画像を少なくすることができる。そのため、フレーム画像を記憶する記憶部の容量をより少なくすることができ、基準画像を作成するための処理時間、あるいはハードウェア処理における回路リソースをより少なくすることができる。従って、高フレームレートの動画を撮像する際にフリッカ補正を行う場合においても、メモリや、回路規模や、処理時間をより小さくすることができる。 According to the present invention, the calculating unit calculates the least common multiple of 1 / a and 1 / b from the frame rate a [fps] of the moving image to be captured and the blinking frequency b [Hz] of the light source, and calculates the minimum The smallest divisor n except 1 included in the numerator value when the denominator value of the common multiple is converted to a is calculated. In addition, the reference image generation unit generates a reference image by averaging n frame images captured at a timing obtained by dividing the period obtained by multiplying the least common multiple by the blinking frequency b into n equal parts. In addition, the correction unit performs flicker correction on the captured moving image based on the reference image. As a result, the number of frame images used when generating the reference image can be reduced. Therefore, the capacity of the storage unit that stores the frame image can be reduced, and the processing time for creating the reference image or the circuit resources in the hardware processing can be further reduced. Therefore, even when flicker correction is performed when capturing a high frame rate moving image, the memory, circuit scale, and processing time can be further reduced.
(第1の実施形態)
以下、本発明の第1の実施形態について図面を参照して説明する。初めに、本実施形態におけるフリッカ補正に用いる基準画像の生成原理について説明する。図1は、本実施形態における光源の明滅周波数とフレーム画像の撮像時間タイミングとを示したグラフである。グラフの横軸は時間を示し、縦軸は光源の明るさを示す。なお、光源が一番明るい場合の明るさを1とし、光源が一番暗い場合の明るさを−1としている。また、光源の明るさが、一番明るい場合と一番暗い場合とのちょうど中間の明るさを0としている。また、曲線1001は、光源の明滅周波数(理想状態としてサインカーブとしている)を示している。また、点101〜112は、1フレーム目から12フレーム目のフレーム画像を撮像した時間を示している。
(First embodiment)
Hereinafter, a first embodiment of the present invention will be described with reference to the drawings. First, the principle of generating a reference image used for flicker correction in this embodiment will be described. FIG. 1 is a graph showing the blinking frequency of the light source and the frame image capturing time timing in this embodiment. The horizontal axis of the graph indicates time, and the vertical axis indicates the brightness of the light source. Note that the brightness when the light source is the brightest is 1, and the brightness when the light source is the darkest is -1. The brightness between the light source brightness and the darkest brightness is set to 0. A
図示する例では、光源の明滅周波数は100Hzであり、撮像する動画のフレームレートは240fpsである。1フレーム目の撮像は、時間0msのとき(図中の点101)に行っている。このときの光源の明るさはちょうど中央値であるため、撮像したフレーム画像の明るさも中央値となる。また、2フレーム目の撮像は、時間4.16msのとき(図中の点102)に行っている。このときの光源の明るさは中央値よりも明るくなっているため、撮像したフレーム画像の明るさは中央値よりも明るくなる。また、3フレーム目の撮像は、時間8.33msのとき(図中の点103)に行っている。このときの光源の明るさは中央値よりも暗くなっているため、撮像したフレーム画像の明るさは中央値よりも暗くなる。4フレーム目以降の撮像時間及び光源の明るさは図示するとおりである。
In the illustrated example, the blinking frequency of the light source is 100 Hz, and the frame rate of the moving image to be captured is 240 fps. The first frame is imaged at
光源の明滅周波数が100Hzであり、撮像する動画のフレームレートが240fpsである場合、従来知られているフリッカ補正の方法であれば、中央の明るさの画像である基準画像を生成するために12枚のフレーム画像が必要となる。なお、必要なフレーム画像の枚数の算出方法は上述したとおりである。 When the flicker frequency of the light source is 100 Hz and the frame rate of the moving image to be captured is 240 fps, a conventionally known flicker correction method uses 12 to generate a reference image that is an image having a central brightness. One frame image is required. The method for calculating the required number of frame images is as described above.
ところが、図1に示したグラフを参照すると、12枚のフレーム画像を用いることなく中央の明るさの画像を生成することができることが分かる。例えば、1フレーム目(図中の点101)に撮像したフレーム画像と7フレーム目(図中の点107)に撮像したフレーム画像とを平均化すると、中央の明るさの画像を生成できることが分かる。また、2フレーム目(図中の点102)に撮像したフレーム画像と8フレーム目(図中の点108)に撮像したフレーム画像とを平均化すると、中央の明るさの画像を生成できることが分かる。同様に、3フレーム目(図中の点103)に撮像したフレーム画像と9フレーム目(図中の点109)に撮像したフレーム画像との平均化など、2つのフレーム画像を平均化することで、中央の明るさの画像を生成できることが分かる。
However, referring to the graph shown in FIG. 1, it can be seen that an image having a central brightness can be generated without using 12 frame images. For example, if the frame image captured at the first frame (
これは、「サインカーブを等分した際のサイン値の和は、何等分であっても必ず0になる」という原理で説明できる。本実施形態においては、光源の明滅周波数はサインカーブである。また、フレーム画像を撮像するタイミングは、光源の明滅周期(光源の明滅周波数に基づいた周期)を整数倍した周期を等分する間隔である。そのため、光源の明滅周期を整数倍した周期を等分する間隔で撮像した際のフレーム画像を平均化した画像の明るさは、ちょうど中央の値となる。例えば、サインカーブを12等分したタイミングで撮影した12枚のフレーム画像を平均化した画像の明るさも、サインカーブを2等分したタイミングで撮影した2枚のフレーム画像を平均化した画像の明るさも、いずれもサイン値でいうところの0の値、すなわち光源の明暗のちょうど中央の明るさとなる。 This can be explained by the principle that “the sum of the sine values when the sine curve is equally divided is always equal to 0 regardless of the number”. In the present embodiment, the blinking frequency of the light source is a sine curve. The timing for capturing the frame image is an interval that equally divides a cycle obtained by multiplying the blink cycle of the light source (cycle based on the blink frequency of the light source) by an integer. For this reason, the brightness of an image obtained by averaging frame images taken at intervals equal to a cycle obtained by multiplying the blinking cycle of the light source by an integer is exactly the center value. For example, the brightness of an image obtained by averaging 12 frame images taken at the timing of dividing the sine curve into 12 parts is equal to the brightness of the image obtained by averaging two frame images taken at the timing of dividing the sine curve into 2 parts. In addition, both are 0 values in terms of sine values, that is, the brightness at the center of the light source.
上述した特性に基づいて、基準画像の生成に必要なフレーム画像(必要フレーム画像)の枚数および保存する必要なフレーム画像(保存画像)の枚数を算出する方法を一般化すると、以下のとおりとなる。
(1)基準画像の生成に必要なフレーム画像の枚数nは、従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数の最小の約数(ただし、1は除く)。
(2)基準画像を生成するために保存する必要があるフレーム画像の枚数mは、従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数から、従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数を(1)で算出した基準画像の生成に必要なフレーム画像の枚数nで割った値を減算し、補正対象画像の枚数(1枚)を加算した値。
Based on the above-described characteristics, a method for calculating the number of frame images (necessary frame images) necessary for generating the reference image and the number of necessary frame images (saved images) to be stored is generalized as follows. .
(1) The number n of frame images necessary for generating a reference image is the minimum divisor of the number of frame images required for generating a reference image using a conventional method (however, 1 is excluded).
(2) The number m of frame images that need to be stored in order to generate a reference image is determined based on the number of frame images required when a reference image is generated using a conventional method. Subtract the value obtained by dividing the number of frame images required for image generation by the number n of frame images required for generating the reference image calculated in (1), and add the number of correction target images (1). Value.
例えば、図1に示したように光源の明滅周波数は100Hzであり撮像する動画のフレームレートは240fpsである場合、基準画像の生成に必要なフレーム画像の枚数nは以下のとおりとなる。
・従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数は「12」
・従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数の最小の約数(但し、1は除く)は「2」
従って、基準画像の生成に必要なフレーム画像の枚数nは「2」である。
For example, as shown in FIG. 1, when the blinking frequency of the light source is 100 Hz and the moving image frame rate is 240 fps, the number n of frame images necessary for generating the reference image is as follows.
The number of frame images required for generating a reference image using the conventional method is “12”.
-The minimum divisor (excluding 1) of the number of frame images required for generating a reference image using the conventional method is "2"
Therefore, the number n of frame images necessary for generating the reference image is “2”.
また、図1に示したように光源の明滅周波数は100Hzであり撮像する動画のフレームレートは240fpsである場合、基準画像を生成するために保存する必要があるフレーム画像の枚数mは以下のとおりとなる。
・従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数は「12」
・基準画像の生成に必要なフレーム画像の枚数nは「2」
・従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数「12」を基準画像の生成に必要なフレーム画像の枚数「2」で割った値は「6」
・従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数「12」から、従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数を基準画像の生成に必要なフレーム画像の枚数で割った値「6」を減算した値は「6」
・従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数から、従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数を基準画像の生成に必要なフレーム画像の枚数で割った値を減算した値「6」に、補正対象画像の枚数「1」を加算した値は「7」
従って、基準画像を生成するために保存する必要があるフレーム画像の枚数mは「7」である。
As shown in FIG. 1, when the blinking frequency of the light source is 100 Hz and the moving image frame rate is 240 fps, the number m of frame images that need to be stored to generate the reference image is as follows: It becomes.
The number of frame images required for generating a reference image using the conventional method is “12”.
The number n of frame images necessary for generating the reference image is “2”.
The value obtained by dividing the number of frame images “12” necessary for generating the reference image using the conventional method by the number of frame images “2” required for generating the reference image is “6”.
The number of frame images necessary for generating the reference image using the conventional method is changed from the number of frame images “12” required for generating the reference image using the conventional method to generate the reference image. The value obtained by subtracting the value “6” divided by the number of necessary frame images is “6”.
-The number of frame images necessary for generating the reference image is calculated from the number of frame images required for generating the reference image using the conventional method to the number of frame images required for generating the reference image using the conventional method. The value obtained by subtracting the value divided by the number of images “6” and adding the number of correction target images “1” is “7”.
Therefore, the number m of frame images that need to be stored in order to generate the reference image is “7”.
すなわち、光源の明滅周波数が100Hzであり、撮像する動画のフレームレートが240fpsである場合、従来の方法を用いて12フレーム目のフレーム画像のフリッカ補正を行うための基準画像を生成するためには、1フレーム目〜12フレーム目の12枚のフレーム画像を全て保存し、12枚のフレーム画像の平均化を行う必要がある。しかしながら、本実施形態の方法を用いて12フレーム目のフレーム画像のフリッカ補正を行うための基準画像を生成する場合には、6フレーム目〜12フレーム目の7枚のフレーム画像のみを保存し、そのうちの2枚のフレーム画像の平均化のみを行えばよい。 That is, when the blinking frequency of the light source is 100 Hz and the frame rate of the moving image to be captured is 240 fps, in order to generate a reference image for performing flicker correction of the frame image of the 12th frame using the conventional method It is necessary to save all 12 frame images of the first to twelfth frames and to average the 12 frame images. However, when generating a reference image for performing flicker correction of the frame image of the 12th frame using the method of the present embodiment, only the 7 frame images of the 6th to 12th frames are stored, Only two of the frame images need be averaged.
なお、基準画像を生成するために必要な2枚のフレーム画像は、光源の明滅周期を5倍した周期を、丁度2等分したタイミングで撮像した2枚のフレーム画像である。この例では、保存しているフレーム画像のうち最も過去に撮像した保存画像(6フレーム目のフレーム画像)と、補正対象画像(12フレーム目のフレーム画像)との2枚である。これは、前述の「サインカーブを等分した際のサイン値の和は、何等分であっても必ず0になる」という原理に基づいている。 Note that the two frame images necessary for generating the reference image are two frame images captured at a timing obtained by equally dividing the cycle obtained by multiplying the blinking cycle of the light source by 5 into two equal parts. In this example, there are two saved images (the sixth frame image) and the correction target image (the 12th frame image), which are captured most recently. This is based on the above-mentioned principle that “the sum of sine values when the sine curve is equally divided is always equal to 0 even if it is equally divided”.
次に、図1に示した例とは異なる例として、光源の明滅周波数が100Hzであり、撮像する動画のフレームレートが90fpsである場合について説明する。図2は、本実施形態における光源の明滅周波数とフレーム画像の撮像時間タイミングとを示したグラフである。グラフの横軸は時間を示し、縦軸は光源の明るさを示す。なお、図1と同様に、光源が一番明るい場合の明るさを1とし、光源が一番暗い場合の明るさを−1としている。また、光源の明るさが、一番明るい場合と一番暗い場合とのちょうど中間の明るさを0としている。また、曲線2001は、光源の明滅周波数(理想状態としてサインカーブとしている)を示している。また、点201〜209は、1フレーム目から9フレーム目のフレーム画像を撮像した時間を示している。
Next, as an example different from the example shown in FIG. 1, a case where the blinking frequency of the light source is 100 Hz and the frame rate of the moving image to be captured is 90 fps will be described. FIG. 2 is a graph showing the blinking frequency of the light source and the frame image capturing time timing in this embodiment. The horizontal axis of the graph indicates time, and the vertical axis indicates the brightness of the light source. As in FIG. 1, the brightness when the light source is the brightest is 1, and the brightness when the light source is the darkest is -1. The brightness between the light source brightness and the darkest brightness is set to 0. A
図示する例では、光源の明滅周波数は100Hzであり、撮像する動画のフレームレートは90fpsである。1フレーム目の撮像は、時間0msのとき(図中の点201)に行っている。このときの光源の明るさはちょうど中央値であるため、撮像したフレーム画像の明るさも中央値となる。また、2フレーム目の撮像は、時間11.11msのとき(図中の点202)に行っている。このときの光源の明るさは中央値よりも明るくなっているため、撮像したフレーム画像の明るさは中央値よりも明るくなる。また、3フレーム目の撮像は、時間22.22msのとき(図中の点203)に行っている。このときの光源の明るさは2フレーム目の撮像時よりも明るくなっているため、撮像したフレーム画像の明るさは2フレーム目のフレーム画像よりも明るくなる。4フレーム目以降の撮像時間及び光源の明るさは図示するとおりである。
In the illustrated example, the blinking frequency of the light source is 100 Hz, and the frame rate of the moving image to be captured is 90 fps. The first frame is imaged at
この場合においても、上述した方法と同様の方法を用いて、基準画像の生成に必要なフレーム画像の枚数nと、基準画像を生成するために保存する必要があるフレーム画像の枚数mを算出することができる。 Even in this case, the number n of frame images necessary for generating the reference image and the number m of frame images that need to be stored to generate the reference image are calculated using the same method as described above. be able to.
具体的には、図2に示したように光源の明滅周波数は100Hzであり撮像する動画のフレームレートは90fpsである場合、基準画像の生成に必要なフレーム画像の枚数nは以下のとおりとなる。
・従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数は「9」
・従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数の最小の約数(但し、1は除く)は「3」
従って、基準画像の生成に必要なフレーム画像の枚数nは「3」である。
Specifically, as shown in FIG. 2, when the blinking frequency of the light source is 100 Hz and the frame rate of the moving image to be captured is 90 fps, the number n of frame images necessary for generating the reference image is as follows. .
The number of frame images required when generating a reference image using the conventional method is “9”
The minimum divisor (excluding 1) of the number of frame images required when generating a reference image using the conventional method is “3”.
Accordingly, the number n of frame images necessary for generating the reference image is “3”.
また、図2に示したように、光源の明滅周波数は100Hzであり、撮像する動画のフレームレートは90fpsである場合、基準画像を生成するために保存する必要があるフレーム画像の枚数mは以下のとおりとなる。
・従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数は「9」
・基準画像の生成に必要なフレーム画像の枚数nは「3」
・従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数「9」を基準画像の生成に必要なフレーム画像の枚数「3」で割った値は「3」
・従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数「9」から、従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数を基準画像の生成に必要なフレーム画像の枚数で割った値「3」を減算した値は「6」
・従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数から、従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数を基準画像の生成に必要なフレーム画像の枚数で割った値を減算した値「6」に、補正対象画像の枚数「1」を加算した値は「7」
従って、基準画像を生成するために保存する必要があるフレーム画像の枚数mは「7」である。
Also, as shown in FIG. 2, when the blinking frequency of the light source is 100 Hz and the frame rate of the moving image to be captured is 90 fps, the number m of frame images that need to be stored to generate the reference image is as follows: It becomes as follows.
The number of frame images required when generating a reference image using the conventional method is “9”
The number n of frame images necessary for generating the reference image is “3”.
The value obtained by dividing the number of frame images “9” necessary for generating the reference image using the conventional method by the number of frame images “3” required for generating the reference image is “3”.
From the number of frame images “9” required when generating a reference image using the conventional method, the number of frame images required when generating the reference image using the conventional method is used to generate the reference image. The value obtained by subtracting the value “3” divided by the number of necessary frame images is “6”.
-The number of frame images necessary for generating the reference image is calculated from the number of frame images required for generating the reference image using the conventional method to the number of frame images required for generating the reference image using the conventional method. The value obtained by subtracting the value divided by the number of images “6” and adding the number of correction target images “1” is “7”.
Therefore, the number m of frame images that need to be stored in order to generate the reference image is “7”.
すなわち、光源の明滅周波数が100Hzであり、撮像する動画のフレームレートが90fpsである場合、従来の方法で、9フレーム目のフレーム画像のフリッカ補正を行うための基準画像を生成するためには、1フレーム目〜9フレーム目の9枚のフレーム画像を全て保存し、9枚のフレーム画像の平均化を行う必要がある。しかしながら、本実施形態の方法で、9フレーム目のフレーム画像のフリッカ補正を行うための基準画像を生成する場合には、3フレーム目〜9フレーム目の7枚のフレーム画像のみを保存し、そのうちの3枚のフレーム画像の平均化のみを行えばよい。 That is, when the blinking frequency of the light source is 100 Hz and the frame rate of the moving image to be captured is 90 fps, in order to generate a reference image for flicker correction of the ninth frame image, It is necessary to save all nine frame images of the first to ninth frames and average the nine frame images. However, in the case of generating a reference image for performing flicker correction of the frame image of the ninth frame by the method of the present embodiment, only the seven frame images of the third to ninth frames are stored, of which It is only necessary to average the three frame images.
なお、基準画像を生成するために必要な3枚のフレーム画像は、光源の明滅周期を10倍した周期を、丁度3等分したタイミングで撮像した3枚のフレーム画像である。この例では、保存しているフレーム画像のうち最も過去に撮像した保存画像(3フレーム目のフレーム画像)と、補正対象画像(9フレーム目のフレーム画像)と、最も過去に撮像した保存画像と補正対象画像との丁度中間のタイミングで撮像した保存画像(6フレーム目のフレーム画像)との3枚である。これは、前述の「サインカーブを等分した際のサイン値の和は、何等分であっても必ず0になる」という原理に基づいている。 Note that the three frame images necessary for generating the reference image are three frame images captured at a timing obtained by dividing the cycle obtained by multiplying the blinking cycle of the light source by 10 into three equal parts. In this example, among the stored frame images, the most recently stored image (the third frame image), the correction target image (the ninth frame image), and the most previously stored image Three images are stored images (sixth frame image) captured at an intermediate timing with the correction target image. This is based on the above-mentioned principle that “the sum of sine values when the sine curve is equally divided is always equal to 0 even if it is equally divided”.
図3は、本実施形態において、光源の明暗周波数が100Hzである場合に、様々なフレームレートの動画を撮影する場合における、基準画像の生成に必要なフレーム画像の枚数と、基準画像を生成するために保存する必要があるフレーム画像の枚数との関係を纏めた図である。図示する例では、表形式で纏められており、列ごとに、撮影する動画のフレームレートと、従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数と、本実施形態の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数と、従来の方法を用いて基準画像を生成する場合に保存する必要があるフレーム画像の枚数と、本実施形態の方法を用いて基準画像を生成する場合に保存する必要があるフレーム画像の枚数とを関連付けて示している。 FIG. 3 shows the number of frame images necessary for generating a reference image and the reference image when shooting moving images having various frame rates when the light / dark frequency of the light source is 100 Hz. It is the figure which put together the relationship with the number of the frame images which need to be preserve | saved for this. In the illustrated example, they are summarized in a table format. For each column, the frame rate of the moving image to be captured, the number of frame images required when generating a reference image using a conventional method, The number of frame images necessary for generating a reference image using the method, the number of frame images that need to be stored when generating the reference image using a conventional method, and the method of this embodiment are used. The number of frame images that need to be saved when generating a reference image is shown in association with each other.
例えば、フレームレートが15fpsの動画を撮影する場合、従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数は「3枚」であり、本実施形態の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数は「3枚」であり、従来の方法を用いて基準画像を生成する場合に保存する必要があるフレーム画像の枚数は「3枚」であり、本実施形態の方法を用いて基準画像を生成する場合に保存する必要があるフレーム画像の枚数は「3枚」であることを示している。 For example, when shooting a moving image with a frame rate of 15 fps, the number of frame images required for generating a reference image using the conventional method is “3”, and the reference image using the method of this embodiment is used. The number of frame images required when generating the image is “3”, and the number of frame images that need to be stored when generating the reference image using the conventional method is “3”. This indicates that the number of frame images that need to be saved when a reference image is generated using the method of the embodiment is “three”.
また、フレームレートが240fpsの動画を撮影する場合、従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数は「12枚」であり、本実施形態の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数は「2枚」であり、従来の方法を用いて基準画像を生成する場合に保存する必要があるフレーム画像の枚数は「12枚」であり、本実施形態の方法を用いて基準画像を生成する場合に保存する必要があるフレーム画像の枚数は「7枚」であることを示している。他のフレームレートの動画を撮影する場合については図示するとおりである。 In addition, when shooting a moving image with a frame rate of 240 fps, the number of frame images necessary for generating a reference image using the conventional method is “12”, and the reference image is generated using the method of this embodiment. The number of frame images required when generating the image is “2”, and the number of frame images that need to be stored when generating the reference image using the conventional method is “12”. This indicates that the number of frame images that need to be saved when the reference image is generated using the method of the embodiment is “7”. The case of shooting a moving image of another frame rate is as illustrated.
図示するとおり、高フレームレート(例えば、フレームレートが90fps以上)の動画を撮影する場合、従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数よりも、本実施形態の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数の方が少ない。また、高フレームレートの動画を撮影する場合、従来の方法を用いて基準画像を生成する場合に保存する必要があるフレーム画像の枚数よりも、本実施形態の方法を用いて基準画像を生成する場合に保存する必要があるフレーム画像の枚数の方が少ない。 As shown in the figure, when shooting a moving image with a high frame rate (for example, a frame rate of 90 fps or more), the method of the present embodiment is more than the number of frame images required when generating a reference image using a conventional method. The number of frame images required for generating a reference image using is smaller. In addition, when shooting a high frame rate moving image, the reference image is generated using the method of this embodiment rather than the number of frame images that need to be stored when the reference image is generated using the conventional method. The number of frame images that need to be saved is smaller.
次に、本実施形態における画像処理装置の構成について説明する。図4は本実施形態における画像処理装置の構成を示したブロック図である。図示する例では、画像処理装置1は、入力部11と、必要枚数算出部12(算出部)と、撮像部13と、一時記憶部14と、基準画像生成部15と、ゲイン算出部16と、補正部17と、記憶部18と、制御部19とを備える。
Next, the configuration of the image processing apparatus in the present embodiment will be described. FIG. 4 is a block diagram showing the configuration of the image processing apparatus according to this embodiment. In the illustrated example, the
入力部11は、撮像する動画のフレームレートを必要枚数算出部12と撮像部13とに対して入力する。また、入力部11は、光源の明滅周波数を必要枚数算出部12に対して入力する。例えば、入力部11は、スイッチやテンキー等を備え、ユーザから、撮像する動画のフレームレートと光源の明滅周波数との入力を受け付ける。そして、入力部12は、ユーザから入力を受け付けた、撮像する動画のフレームレートを必要枚数算出部12と撮像部13とに対して入力し、光源の明滅周波数を必要枚数算出部12に入力する。また、例えば、撮像する動画のフレームレートと光源の明滅周波数とは予め定められており、入力部11は、予め定められている撮像する動画のフレームレートを必要枚数算出部12と撮像部13とに対して入力し、予め定められている光源の明滅周波数を必要枚数算出部12に入力する。
The
必要枚数算出部12は、入力部11から入力された、撮像する動画のフレームレートと光源の明滅周波数とに基づいて、基準画像を生成するために必要なフレーム画像の枚数と、基準画像を生成するために保存する必要があるフレーム画像の枚数とを算出する。撮像部13は、入力部11から入力された、撮像する動画のフレームレートに基づいて動画を撮影する。一時記憶部14は、撮像部13が撮像した動画のフレーム画像を一時記憶する。基準画像生成部15は、一時記憶部14が一時記憶しているフレーム画像を用いて基準画像を生成する。ゲイン算出部16は、撮像部13が撮像した補正対象画像と、基準画像生成部15が生成した基準画像とを用いて、補正対象画像を補正するためのゲイン値を算出する。補正部17は、ゲイン算出部16が算出したゲイン値を用いて、補正対象画像のフリッカを補正する。記憶部18は、補正部17が補正したフレーム画像を動画として記憶する。制御部19は、画像処理装置1が備える各部の制御を行う。
The necessary
次に、画像処理装置1の動作手順について説明する。図5は、本実施形態における画像処理装置1の動作手順を示したフローチャートである。
(ステップS101)ユーザは、動画を撮影する前に、画像処理装置1の入力部11に、撮像する動画のフレームレートと光源の明滅周波数とを入力する。入力部11は、ユーザに入力された、撮像する画像のフレームレートを必要枚数算出部12と撮像部13とに対して入力し、光源の明滅周波数を必要枚数算出部12に対して入力する。その後、ステップS102の処理に進む。
Next, the operation procedure of the
(Step S101) The user inputs the frame rate of the moving image to be captured and the blinking frequency of the light source to the
(ステップS102)必要枚数算出部12は、ステップS101の処理で入力された、撮像する動画のフレームレートと光源の明滅周波数とに基づいて、基準画像を生成するために必要なフレーム画像の枚数nと、基準画像を生成するために保存する必要があるフレーム画像の枚数mとを算出する。また、必要枚数算出部12は、算出した、基準画像を生成するために必要なフレーム画像の枚数nと、基準画像を生成するために保存する必要があるフレーム画像の枚数mとを基準画像生成部15と制御部19とに対して入力する。その後、ステップS103の処理に進む。
(ステップS103)ユーザは、動画の撮影を開始させる際に、入力部11が備える撮影開始ボタンを押下する。制御部19は、入力部11が備える撮影開始ボタンが押下された場合、撮像部13に動画の撮影を開始させる。撮像部13は、制御部19の制御に基づいて、ステップS101で入力された、撮影する動画のフレームレートで指定されるフレームレートでの動画の撮影を開始する。その後、ステップS104の処理に進む。
(Step S102) The required
(Step S <b> 103) When starting the shooting of a moving image, the user presses a shooting start button provided in the
(ステップS104)ユーザは、動画の撮影を終了させる際に、入力部11が備える撮影終了ボタンを押下する。制御部19は、入力部11が備える撮影終了ボタンが押下されていない場合は、動画撮影を継続すると判定してステップS105の処理に進む。また、制御部19は、入力部11が備える撮影終了ボタンが押下された場合は、動画撮影を継続させないと判定し、撮像部13に動画の撮影を終了させる。撮像部13は、制御部19の制御に基づいて動画の撮影を終了する。その後、処理を終了する。
(Step S <b> 104) When the user finishes shooting a moving image, the user presses a shooting end button provided in the
(ステップS105)撮像部13は、1フレーム分のフレーム画像(補正対象画像)を撮像する。その後、ステップS106の処理に進む。
(ステップS106)制御部13は、ステップS105の処理で撮像部13が撮像した1フレーム分のフレーム画像を一時記憶部14に記憶させる。その後、ステップS107の処理に進む。
(Step S105) The
(Step S106) The
(ステップS107)基準画像生成部15は、一時記憶部14が記憶している、基準画像を生成するために保存する必要があるフレーム画像m枚のうち、基準画像を生成するために必要なフレーム画像n枚を平均化し、基準画像を生成する。その後、ステップS108の処理に進む。なお、一時記憶部14が記憶しているフレーム画像がm枚未満である場合には、ステップS104の処理に戻る。
(ステップS108)ゲイン算出部16は、ステップS105の処理で撮像部13が撮像した補正対象画像と、ステップS107の処理で基準画像生成部15が生成した基準画像とを用いて、補正対象画像のフリッカを補正するためのゲイン値を算出する。その後、ステップS109の処理に進む。
(Step S107) The reference
(Step S108) The
(ステップS109)補正部17は、ステップS108の処理でゲイン算出部16が算出したゲイン値を用いて、ステップS105の処理で撮像部13が撮像した補正対象画像のフリッカを補正する。その後、ステップS110の処理に進む。
(ステップS110)制御部19は、ステップS109の処理で補正部17が補正した補正対象画像を動画として記憶部18に記憶させる。その後、ステップS111の処理に進む。
(ステップS111)制御部19は、一時記憶部14が記憶しているフレーム画像のうち、必要のないフレーム画像を削除する。その後、ステップS104の処理に戻る。
(Step S109) The
(Step S110) The
(Step S111) The
次に、図5を用いて説明した画像処理装置1の動作手順の具体例について、光源の明滅周波数が100Hzであり、撮像する動画のフレームレートが240fpsである場合を例に説明する。まず、ステップS101の処理で、入力部11は、フレームレート「240fps」を必要枚数算出部12と撮像部13とに入力し、光源の明滅周波数「100Hz」を必要枚数算出部12に入力する。続いて、ステップS102の処理で、必要枚数算出部12は、基準画像を生成するために保存する必要があるフレーム画像の枚数m「7」と、基準画像を生成するために必要なフレーム画像の枚数n「2」とを算出する。
Next, a specific example of the operation procedure of the
続いて、ステップS103の処理で、撮像部13はフレームレート「240fps」の動画の撮影を開始する。続いて、ステップS104の処理で、制御部19が動画撮影を継続すると判定した場合には、ステップS105の処理で、撮像部13は1フレームのフレーム画像(補正対象画像)を撮像し、ステップS106の処理で、一時記憶部14に記憶させる。
Subsequently, in the process of step S <b> 103, the
続いて、ステップS107の処理で、基準画像を生成するために保存する必要があるフレーム画像「7枚」の中から、基準画像を生成するために必要なフレーム画像「2枚」の画像の平均画像、すなわち基準画像を生成する。基準画像を生成するために必要なフレーム画像は、最も過去に撮像した保存画像と、補正対象画像との2枚である。この2枚のフレーム画像の選択は、前述のサインカーブを等分するという原理に基づいており、基準画像を生成するために必要なフレーム画像として、光源の明滅周期を5倍した周期を、丁度2等分したタイミングで撮像した2枚のフレーム画像を選択している。 Subsequently, in the process of step S107, the average of the two “2” frame images necessary for generating the reference image out of the “7” frame images that need to be stored for generating the reference image. An image, that is, a reference image is generated. The two frame images necessary for generating the reference image are the saved image captured in the past and the correction target image. The selection of the two frame images is based on the principle of equally dividing the sine curve described above. As a frame image necessary for generating the reference image, a cycle obtained by multiplying the blinking cycle of the light source by 5 times is exactly the same. Two frame images picked up at the timing divided into two are selected.
続いて、ステップS108の処理で、基準画像を補正対象画像で除算し、補正対象画像のフリッカを補正するためのゲイン値を算出する。続いて、ステップS109の処理で、補正対象画像に対して、ステップS109の処理で算出したゲイン値を乗算してフリッカ補正を行う。続いて、ステップS110の処理で、フリッカ補正を行った補正対象画像を動画として記憶部18に記憶させる。続いて、ステップS111の処理で、一時記憶部14が記憶しているうち、最も過去に撮像した保存画像を一時記憶部14から削除する。その後、撮影終了ボタンが押下されるまで、ステップS105からステップS111の処理を繰り返し実行する。
Subsequently, in step S108, the reference image is divided by the correction target image to calculate a gain value for correcting flicker of the correction target image. Subsequently, in the process of step S109, the correction target image is multiplied by the gain value calculated in the process of step S109 to perform flicker correction. Subsequently, in step S110, the correction target image subjected to the flicker correction is stored in the
次に、図5を用いて説明した画像処理装置1の動作手順の具体例について、光源の明滅周波数が100Hzであり、撮像する動画のフレームレートが90fpsである場合を例に説明する。まず、ステップS101の処理で、入力部11は、フレームレート「90fps」を必要枚数算出部12と撮像部13とに入力し、光源の明滅周波数「100Hz」を必要枚数算出部12に入力する。続いて、ステップS102の処理で、必要枚数算出部12は、基準画像を生成するために保存する必要があるフレーム画像の枚数m「7」と、基準画像を生成するために必要なフレーム画像の枚数n「3」とを算出する。
Next, a specific example of the operation procedure of the
続いて、ステップS103の処理で、撮像部13はフレームレート「90fps」の動画の撮影を開始する。続いて、ステップS104の処理で、制御部19が動画撮影を継続すると判定した場合には、ステップS105の処理で、撮像部13は1フレームのフレーム画像(補正対象画像)を撮像し、ステップS106の処理で、一時記憶部14に記憶させる。
Subsequently, in the process of step S <b> 103, the
続いて、ステップS107の処理で、基準画像を生成するために保存する必要があるフレーム画像「7枚」の中から、基準画像を生成するために必要なフレーム画像「3枚」の画像の平均画像、すなわち基準画像を生成する。このときの基準画像を生成するために必要なフレーム画像は、最も過去に撮像した保存画像と、補正対象画像と、最も過去に撮像した保存画像と補正対象画像との丁度中間のタイミングで撮像した保存画像との3枚である。この3枚のフレーム画像の選択は、前述のサインカーブを等分するという原理に基づいており、基準画像を生成するために必要なフレーム画像として、光源の明滅周期を10倍した周期を、丁度3等分したタイミングで撮像した3枚のフレーム画像を選択している。 Subsequently, in the process of step S107, the average of the three frame images “3” necessary to generate the reference image from among the “7” frame images that need to be stored to generate the reference image. An image, that is, a reference image is generated. The frame image necessary to generate the reference image at this time was captured at a timing just between the stored image captured most recently, the correction target image, and the stored image captured most recently and the correction target image. Three images with saved images. The selection of the three frame images is based on the principle of equally dividing the sine curve described above. As a frame image necessary for generating the reference image, a cycle obtained by multiplying the blinking cycle of the light source by 10 times is used. Three frame images captured at the timing divided into three equal parts are selected.
ステップS108〜ステップS111の処理は、光源の明滅周波数が100Hzであり、撮像する動画のフレームレートが240fpsである場合における処理と同様の処理である。また、撮影終了ボタンが押下されるまで、ステップS105からステップS111の処理を繰り返し実行する。 The processing in steps S108 to S111 is similar to the processing in the case where the blinking frequency of the light source is 100 Hz and the frame rate of the moving image to be captured is 240 fps. Further, the processing from step S105 to step S111 is repeatedly executed until the photographing end button is pressed.
上述した方法で画像のフリッカ補正をおこなうことで、基準画像の作成に用いるフレーム画像を少なくすることができる。そのため、フレーム画像を記憶する記憶部の容量をより少なくすることができ、基準画像を作成するための処理時間、あるいはハードウェア処理における回路リソースをより少なくすることができる。すなわち、本実施形態における画像処理装置および画像処理方法は、高フレームレートの動画を撮像する際にフリッカ補正を行う場合においても、メモリや回路規模や処理時間をより小さくすることができる。 By performing the flicker correction of the image by the above-described method, it is possible to reduce the number of frame images used for creating the reference image. Therefore, the capacity of the storage unit that stores the frame image can be reduced, and the processing time for creating the reference image or the circuit resources in the hardware processing can be further reduced. That is, the image processing apparatus and the image processing method in the present embodiment can further reduce the memory, circuit scale, and processing time even when performing flicker correction when capturing a high frame rate moving image.
なお、いずれのフレームレートであっても、ステップS108の処理においては、フレーム画像の画素ごとのゲイン値を求めてもよく、フレーム画像の1ラインごとのゲイン値を求めてもよく、フレーム画像全体で1つのゲイン値を求めてもよい。そして、ステップS109の処理において、ステップS108でゲイン値を求めた単位毎に、補正対象画像のフリッカを補正するようにしてもよい。 At any frame rate, in the process of step S108, a gain value for each pixel of the frame image may be obtained, or a gain value for each line of the frame image may be obtained, or the entire frame image may be obtained. A single gain value may be obtained. In the process of step S109, the flicker of the correction target image may be corrected for each unit for which the gain value is obtained in step S108.
例えば、撮像素子がグローバルシャッタ方式で撮像するものであれば、1枚のフレーム画像全体を撮像した際の光源の明暗は一定であるため、フレーム画像全体で1つのゲイン値を求めてフリッカを補正するのが望ましい。この場合は、ステップS107で得られた基準画像の画面全体の平均値と補正画像の画面全体の平均値を求め、それをもとに一つの補正ゲイン値を算出すればよい。また、撮像素子がローリングシャッタ方式で撮像するものであれば、ライン毎に撮像した際の光源の明暗が異なるため、フレーム画像の1ライン毎にゲイン値を求めてフリッカを補正するのが望ましい。この場合は、基準画像の1ライン毎の平均値と、補正画像の1ライン毎の平均値を求め、それぞれのライン毎の補正ゲイン値を算出すればよい。 For example, if the imaging device captures images using the global shutter method, the light source brightness is constant when the entire frame image is captured, so flicker is corrected by obtaining one gain value for the entire frame image. It is desirable to do. In this case, the average value of the entire reference image and the average value of the corrected image obtained in step S107 may be obtained, and one correction gain value may be calculated based on the average value. Further, if the image pickup device picks up an image by the rolling shutter system, it is desirable to correct the flicker by obtaining a gain value for each line of the frame image because the brightness of the light source is different for each line. In this case, an average value for each line of the reference image and an average value for each line of the corrected image may be obtained, and a correction gain value for each line may be calculated.
また、本実施形態では、ステップS107で用いる複数枚画像はすべて同じ被写体が撮影されている前提で説明してきたが、実際の撮影シーンにおいては、手振れなどのカメラの移動や被写体全体が移動することによる画像全体の位置ずれ、あるいは被写体の一部が動くことによる画像の一部分の不一致が起きる可能性がある。このような場合においても正確な補正ゲイン値を算出するためには、たとえば、カメラなどで一般的に使われる手振れ補正機能をつかうことで画像全体の位置ずれを補正した上で基準画像を生成する、あるいは動体検出機能を使って被写体の部分部分の動きを検出し、動きのある部分は上述の説明におけるライン毎もしくは画面全体の平均値算出の際に使用しなければよい。 Further, in the present embodiment, the description has been made on the assumption that the same subject is photographed in all of the plurality of images used in step S107. However, in an actual photographing scene, the movement of the camera such as camera shake or the entire subject moves. There is a possibility that the position of the entire image is shifted due to or a part of the image is mismatched due to the movement of a part of the subject. Even in such a case, in order to calculate an accurate correction gain value, for example, a reference image is generated after correcting the positional deviation of the entire image by using a camera shake correction function generally used in a camera or the like. Alternatively, the movement of the portion of the subject is detected using the moving object detection function, and the portion having movement may not be used for calculating the average value for each line or the entire screen in the above description.
また、本実施形態では、動画撮影時のフリッカ補正の動作フローについて説明したが、フリッカ補正は明るさを補正する処理であるため、補正後の画像は、明るさ以外は補正前の画像となんら変わるところがない。従って、フリッカ補正以外の本実施形態で開示していない画像処理と組み合わせることは、容易に可能である。 In this embodiment, the flicker correction operation flow at the time of moving image shooting has been described. However, since the flicker correction is a process for correcting the brightness, the corrected image is the same as the image before the correction except for the brightness. There is no change. Therefore, it is possible to easily combine with image processing not disclosed in the present embodiment other than flicker correction.
(第2の実施形態)
次に、本発明の第2の実施形態について説明する。第1の実施形態では、1枚の補正対象画像毎に基準画像を生成しているが、本実施形態では、複数枚の補正対象画像に対して、1つの基準画像を生成する。すなわち、基準画像の更新を複数フレーム毎に行う。これにより、更に、フレーム画像を記憶する記憶部の容量をより少なくすることができ、基準画像を作成するための処理時間、あるいはハードウェア処理における回路リソースをより少なくすることができる。なお、本実施形態における画像処理装置1は、第1の実施形態における画像処理装置1と同様の構成である。
(Second Embodiment)
Next, a second embodiment of the present invention will be described. In the first embodiment, a reference image is generated for each correction target image. However, in the present embodiment, one reference image is generated for a plurality of correction target images. That is, the reference image is updated every plural frames. As a result, the capacity of the storage unit for storing the frame image can be further reduced, and the processing time for creating the reference image or the circuit resources in the hardware processing can be further reduced. Note that the
次に、本実施形態において、基準画像を生成するタイミングについて図1を参照して説明する。上述した通り、図1は、光源の明滅周波数が100Hzであり、撮像する動画のフレームレートが240fpsである場合における、光源の明滅周波数とフレーム画像の撮像時間タイミングとを示したグラフである。図示する例において、補正対象画像が7フレーム目のフレーム画像である場合、1フレーム目のフレーム画像と7フレーム目のフレーム画像との平均化を行って基準画像を生成する。これは第1の実施形態と同様である。 Next, the timing for generating the reference image in the present embodiment will be described with reference to FIG. As described above, FIG. 1 is a graph showing the blinking frequency of the light source and the imaging time timing of the frame image when the blinking frequency of the light source is 100 Hz and the frame rate of the moving image to be captured is 240 fps. In the illustrated example, when the correction target image is the frame image of the seventh frame, the reference image is generated by averaging the frame image of the first frame and the frame image of the seventh frame. This is the same as in the first embodiment.
次に、補正対象画像が8フレーム目のフレーム画像である場合、第1の実施形態では、2フレーム目のフレーム画像と8フレーム目のフレーム画像との平均化を行って基準画像を生成する。しかしながら、本実施形態では、7フレーム目のフレーム画像のフリッカ補正を行うために生成した基準画像を、8フレーム目のフレーム画像のフリッカ補正に用いる。なお、本実施形態では、7フレーム目のフレーム画像のフリッカ補正を行うために生成した基準画像を、7フレーム目〜12フレーム目のフレーム画像の補正に用いる。そして、7フレーム目のフレーム画像と同じ明るさのフレーム画像(13フレーム目のフレーム画像)を取得した場合、新たに基準画像を生成する(基準画像を更新する)。 Next, when the correction target image is the frame image of the eighth frame, in the first embodiment, the frame image of the second frame and the frame image of the eighth frame are averaged to generate the reference image. However, in the present embodiment, the reference image generated for performing the flicker correction of the frame image of the seventh frame is used for the flicker correction of the frame image of the eighth frame. In the present embodiment, the reference image generated for flicker correction of the seventh frame image is used for correcting the seventh to twelfth frame images. When a frame image having the same brightness as that of the seventh frame image (13th frame image) is acquired, a new reference image is generated (the reference image is updated).
新たに基準画像を生成するタイミングを、前回基準画像を生成した際に取得したフレーム画像と同じ明るさのフレーム画像を取得した際とした場合に、基準画像の生成に必要なフレーム画像(必要フレーム画像)の枚数および保存する必要なフレーム画像(保存画像)の枚数を算出する方法を一般化すると、以下のとおりとなる。
(1)基準画像の作成に必要なフレーム画像の枚数nは、従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数の最小の約数(ただし、1は除く)である。
(2)基準画像を生成するために保存する必要があるフレーム画像の枚数mは、(1)の基準画像の作成に必要なフレーム画像の枚数nと同じ枚数である。また、基準画像作成用のフレーム画像の保存周期t(フレーム画像のうち、基準画像作成用に保存する必要があるフレーム画像が出現する周期)は、従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数を、基準画像の作成に必要なフレーム画像の枚数nで割った値である。
When a new reference image is generated when a frame image having the same brightness as the frame image acquired when the reference image was generated last time is acquired, the frame image (necessary frame required for generating the reference image) The method of calculating the number of images) and the number of frame images (stored images) that need to be stored is generalized as follows.
(1) The number n of frame images necessary for creating a reference image is the minimum divisor (excluding 1) of the number of frame images necessary for generating a reference image using a conventional method. .
(2) The number m of frame images that need to be stored in order to generate a reference image is the same as the number n of frame images required for creating the reference image in (1). The frame image storage cycle t for generating the reference image (the cycle in which the frame images that need to be stored for generating the reference image among the frame images appear) is generated when the reference image is generated using a conventional method. Is the value obtained by dividing the number of frame images necessary for the above by the number n of frame images necessary for creating the reference image.
例えば、図1に示したように光源の明滅周波数は100Hzであり撮像する動画のフレームレートは240fpsである場合、基準画像の生成に必要なフレーム画像の枚数nは以下のとおりとなる。
・従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数は「12」
・従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数の最小の約数(但し、1は除く)は「2」
従って、基準画像の生成に必要なフレーム画像の枚数nは「2」である。
For example, as shown in FIG. 1, when the blinking frequency of the light source is 100 Hz and the moving image frame rate is 240 fps, the number n of frame images necessary for generating the reference image is as follows.
The number of frame images required for generating a reference image using the conventional method is “12”.
-The minimum divisor (excluding 1) of the number of frame images required for generating a reference image using the conventional method is "2"
Therefore, the number n of frame images necessary for generating the reference image is “2”.
また、図1に示したように光源の明滅周波数は100Hzであり撮像する動画のフレームレートは240fpsである場合、基準画像を生成するために保存する必要があるフレーム画像の枚数mは以下のとおりとなる。
・基準画像の生成に必要なフレーム画像の枚数nは「2」
従って、基準画像を生成するために保存する必要があるフレーム画像の枚数mは「2」である。
As shown in FIG. 1, when the blinking frequency of the light source is 100 Hz and the moving image frame rate is 240 fps, the number m of frame images that need to be stored to generate the reference image is as follows: It becomes.
The number n of frame images necessary for generating the reference image is “2”.
Accordingly, the number m of frame images that need to be stored in order to generate the reference image is “2”.
また、図1に示したように光源の明滅周波数は100Hzであり撮像する動画のフレームレートは240fpsである場合、基準画像作成用のフレーム画像の保存周期tは以下のとおりとなる。
・従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数は「12」
・基準画像の作成に必要なフレーム画像の枚数nは「2」
・従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数「12」を、・基準画像の作成に必要なフレーム画像の枚数「2」で割った値は「6」
従って、フレーム画像の保存周期tは「6」である。すなわち、フレーム画像を6枚取得する毎に、1枚のフレーム画像を保存する。
Further, as shown in FIG. 1, when the blinking frequency of the light source is 100 Hz and the frame rate of the moving image to be captured is 240 fps, the storage period t of the frame image for creating the reference image is as follows.
The number of frame images required for generating a reference image using the conventional method is “12”.
-The number n of frame images necessary for creating the reference image is “2”.
The value obtained by dividing the number of frame images “12” necessary for generating the reference image using the conventional method by the number of frame images “2” necessary for generating the reference image is “6”.
Therefore, the frame image storage cycle t is “6”. That is, every time six frame images are acquired, one frame image is stored.
図6は、本実施形態において、光源の明暗周波数が100Hzである場合に、様々なフレームレートの動画を撮影する場合における、基準画像の生成に必要なフレーム画像の枚数nと、基準画像を生成するために保存する必要があるフレーム画像の枚数mと、基準画像作成用のフレーム画像の保存周期tとの関係を纏めた図である。図示する例では、表形式で纏められており、列ごとに、撮影する動画のフレームレートと、従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数nと、本実施形態の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数nと、従来の方法を用いて基準画像を生成する場合に保存する必要があるフレーム画像の枚数mと、本実施形態の方法を用いて基準画像を生成する場合に保存する必要があるフレーム画像の枚数mと、従来の方法を用いて基準画像を生成する場合での基準画像作成用のフレーム画像の保存周期tと、本実施形態の方法を用いて基準画像を生成する場合での基準画像作成用のフレーム画像の保存周期tとを関連付けて示している。 FIG. 6 shows a case where the number n of frame images necessary for generating a reference image and a reference image are generated in the case where moving images having various frame rates are taken when the light / dark frequency of the light source is 100 Hz. FIG. 6 is a diagram summarizing the relationship between the number m of frame images that need to be stored in order to be stored and the storage period t of frame images for creating a reference image. In the example shown in the figure, they are summarized in a table format. For each column, the frame rate of a moving image to be shot, the number n of frame images necessary for generating a reference image using a conventional method, and the present embodiment The number n of frame images required when generating a reference image using the method of FIG. 5, the number m of frame images that need to be stored when generating a reference image using a conventional method, The number m of frame images that need to be stored when generating a reference image using the method, the storage period t of the frame image for generating the reference image when generating the reference image using the conventional method, A frame image storage cycle t for creating a reference image in the case of generating a reference image using the method of the present embodiment is shown in association with each other.
例えば、フレームレートが120fpsの動画を撮影する場合、従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数nは「6枚」であり、本実施形態の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数nは「2枚」であり、従来の方法を用いて基準画像を生成する場合に保存する必要があるフレーム画像の枚数mは「6枚」であり、本実施形態の方法を用いて基準画像を生成する場合に保存する必要があるフレーム画像の枚数mは「2枚」であり、従来の方法を用いて基準画像を生成する場合での基準画像作成用のフレーム画像の保存周期tは「1」であり、本実施形態の方法を用いて基準画像を生成する場合での基準画像作成用のフレーム画像の保存周期tは「3」であることを示している。 For example, when shooting a moving image with a frame rate of 120 fps, the number n of frame images required for generating a reference image using the conventional method is “6”, and the reference using the method of this embodiment is used. The number n of frame images necessary for generating an image is “2”, and the number m of frame images that need to be stored when generating a reference image using the conventional method is “6”. Yes, the number m of frame images that need to be stored when the reference image is generated using the method of the present embodiment is “2”, and the reference in the case of generating the reference image using the conventional method The storage period t of the frame image for image creation is “1”, and the storage cycle t of the frame image for creation of the reference image when the reference image is generated using the method of the present embodiment is “3”. It is shown that.
また、フレームレートが240fpsの動画を撮影する場合、従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数nは「12枚」であり、本実施形態の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数nは「2枚」であり、従来の方法を用いて基準画像を生成する場合に保存する必要があるフレーム画像の枚数mは「12枚」であり、本実施形態の方法を用いて基準画像を生成する場合に保存する必要があるフレーム画像の枚数mは「2枚」であり、従来の方法を用いて基準画像を生成する場合での基準画像作成用のフレーム画像の保存周期tは「1」であり、本実施形態の方法を用いて基準画像を生成する場合での基準画像作成用のフレーム画像の保存周期tは「6」であることを示している。他のフレームレートの動画を撮影する場合については図示するとおりである。 In addition, when shooting a moving image with a frame rate of 240 fps, the number n of frame images necessary for generating a reference image using the conventional method is “12”. The number n of frame images necessary for generating an image is “2”, and the number m of frame images that need to be stored when generating a reference image using a conventional method is “12”. Yes, the number m of frame images that need to be stored when the reference image is generated using the method of the present embodiment is “2”, and the reference in the case of generating the reference image using the conventional method The storage cycle t of the frame image for image creation is “1”, and the storage cycle t of the frame image for creation of the reference image when the reference image is generated using the method of the present embodiment is “6”. It is shown that. The case of shooting a moving image of another frame rate is as illustrated.
図示するとおり、高フレームレート(例えば、フレームレートが90fps以上)の動画を撮影する場合、従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数nよりも、本実施形態の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数nの方が少ない。また、高フレームレートの動画を撮影する場合、従来の方法を用いて基準画像を生成する場合に保存する必要があるフレーム画像の枚数mよりも、本実施形態の方法を用いて基準画像を生成する場合に保存する必要があるフレーム画像の枚数mの方が少ない。また、高フレームレートの動画を撮影する場合、従来の方法を用いて基準画像を生成する場合での基準画像作成用のフレーム画像の保存周期tよりも、本実施形態の方法を用いて基準画像を生成する場合での基準画像作成用のフレーム画像の保存周期tの方が大きい。 As shown in the drawing, when shooting a moving image with a high frame rate (for example, a frame rate of 90 fps or more), the number of frame images required in the case of generating a reference image using a conventional method is larger than that of the present embodiment. The number n of frame images necessary for generating a reference image using the method is smaller. Also, when shooting a high frame rate moving image, the reference image is generated using the method of this embodiment rather than the number m of frame images that need to be stored when the reference image is generated using the conventional method. In this case, the number m of frame images that need to be saved is smaller. In addition, when shooting a high frame rate moving image, the reference image is generated using the method of the present embodiment rather than the frame image storage cycle t for generating the reference image when the reference image is generated using the conventional method. The storage period t of the frame image for creating the reference image in the case of generating is larger.
次に、画像処理装置1の動作手順について説明する。図7は、本実施形態における画像処理装置1の動作手順を示したフローチャートである。
(ステップS201)ユーザは、動画を撮影する前に、画像処理装置1の入力部11に、撮像する動画のフレームレートと光源の明滅周波数とを入力する。入力部11は、ユーザに入力された、撮像する画像のフレームレートを必要枚数算出部12と撮像部13とに対して入力し、光源の明滅周波数を必要枚数算出部12に対して入力する。また、制御部19は、基準画像作成用のフレーム画像を保存するタイミングを判定するために用いる撮像回数Tの値を0に初期化する。その後、ステップS202の処理に進む。
Next, the operation procedure of the
(Step S201) The user inputs the frame rate of the moving image to be captured and the blinking frequency of the light source to the
(ステップS202)必要枚数算出部12は、ステップS201の処理で入力された、撮像する動画のフレームレートと光源の明滅周波数とに基づいて、基準画像を生成するために保存する必要があるフレーム画像の枚数mと、基準画像を生成するために必要なフレーム画像の枚数nと、基準画像作成用のフレーム画像の保存周期tとを算出する。また、必要枚数算出部12は、算出した、基準画像を生成するために保存する必要があるフレーム画像の枚数mと、基準画像を生成するために必要なフレーム画像の枚数nと、基準画像作成用のフレーム画像の保存周期tとを基準画像生成部15と制御部19とに対して入力する。その後、ステップS203の処理に進む。
(ステップS203)ユーザは、動画の撮影を開始させる際に、入力部11が備える撮影開始ボタンを押下する。制御部19は、入力部11が備える撮影開始ボタンが押下された場合、撮像部13に動画の撮影を開始させる。撮像部13は、制御部19の制御に基づいて、ステップS201で入力された、撮影する動画のフレームレートで指定されるフレームレートでの動画の撮影を開始する。その後、ステップS204の処理に進む。
(Step S202) The required
(Step S203) When the user starts shooting a moving image, the user presses a shooting start button provided in the
(ステップS204)ユーザは、動画の撮影を終了させる際に、入力部11が備える撮影終了ボタンを押下する。制御部19は、入力部11が備える撮影終了ボタンが押下されていない場合は、動画撮影を継続すると判定してステップS205の処理に進む。また、制御部19は、入力部11が備える撮影終了ボタンが押下された場合は、動画撮影を継続させないと判定し、撮像部13に動画の撮影を終了させる。撮像部13は、制御部19の制御に基づいて動画の撮影を終了する。その後、処理を終了する。
(Step S <b> 204) When the user finishes shooting a moving image, the user presses a shooting end button provided in the
(ステップS205)撮像部13は、1フレーム分のフレーム画像(補正対象画像)を撮像する。その後、ステップS206の処理に進む。
(ステップS206)制御部13は、撮像回数Tの値に1を加算する。その後、ステップS207の処理に進む。
(ステップS207)制御部13は、撮像回数Tの値と、基準画像作成用のフレーム画像の保存周期tの値とが同じ値であるか否かを判定する。撮像回数Tの値と、基準画像作成用のフレーム画像の保存周期tの値とが同じ値であると制御部13が判定した場合にはステップS208の処理に進み、それ以外の場合にはステップS212の処理に進む。
(Step S205) The
(Step S206) The
(Step S207) The
(ステップS208)制御部13は、ステップS205の処理で撮像部13が撮像した1フレーム分のフレーム画像を一時記憶部14に記憶させる。その後、ステップS209の処理に進む。
(ステップS209)基準画像生成部15は、一時記憶部14が記憶している、基準画像を生成するために保存する必要があるフレーム画像の枚数mのうち、基準画像を生成するために必要なフレーム画像の枚数nを平均化し、基準画像を生成する。また、基準画像生成部15は、生成した基準画像を一時記憶部14に記憶させる。なお、一時記憶部14が既に基準画像を記憶している場合は、基準画像生成部15が新たに生成した基準画像に更新する。その後、ステップS210の処理に進む。なお、一時記憶部14が記憶しているフレーム画像がm枚未満である場合には、ステップS211の処理に進む。
(Step S208) The
(Step S209) The reference
(ステップS210)制御部19は、一時記憶部14が記憶しているフレーム画像のうち、必要のないフレーム画像を削除する。その後、ステップS211の処理に進む。
(ステップS211)制御部13は、撮像回数Tの値を0に初期化する。その後、ステップS212の処理に進む。
(Step S210) The
(Step S211) The
(ステップS212)ゲイン算出部16は、ステップS205の処理で撮像部13が撮像した補正対象画像と、一時記憶部14が記憶している基準画像とを用いて、補正対象画像のフリッカを補正するためのゲイン値を算出する。その後、ステップS213の処理に進む。
(ステップS213)補正部17は、ステップS212の処理でゲイン算出部16が算出したゲイン値を用いて、ステップS205の処理で撮像部13が撮像した補正対象画像のフリッカを補正する。その後、ステップS214の処理に進む。
(ステップS214)制御部19は、ステップS213の処理で補正部17が補正した補正対象画像を動画として記憶部18に記憶させる。その後、ステップS204の処理に戻る。
(Step S212) The
(Step S213) The
(Step S214) The
次に、図7を用いて説明した画像処理装置1の動作手順の具体例について、光源の明滅周波数が100Hzであり、撮像する動画のフレームレートが240fpsである場合を例に説明する。まず、ステップS201の処理で、入力部11は、フレームレート「240fps」を必要枚数算出部12と撮像部13とに入力し、光源の明滅周波数「100Hz」を必要枚数算出部12に入力する。また、撮像回数Tの値を0に初期化する。続いて、ステップS202の処理で、必要枚数算出部12は、基準画像を生成するために保存する必要があるフレーム画像の枚数m「2」と、基準画像を生成するために必要なフレーム画像の枚数n「2」と、基準画像作成用のフレーム画像の保存周期t「6」とを算出する。
Next, a specific example of the operation procedure of the
続いて、ステップS203の処理で、撮像部13はフレームレート「240fps」の動画の撮影を開始する。続いて、ステップS204の処理で、制御部19が動画撮影を継続すると判定した場合には、ステップS205の処理で、撮像部13は1フレームのフレーム画像(補正対象画像)を撮像し、ステップS206の処理で、制御部19は撮像回数Tの値に1を加算する。続いて、ステップS207の処理で、制御部19は、撮像回数Tの値と、基準画像作成用のフレーム画像の保存周期tの値とが同じ値であるか否かを判定する。撮像回数Tの値と、基準画像作成用のフレーム画像の保存周期tの値とが同じ値であると制御部13が判定した場合にはステップS208の処理に進み、それ以外の場合にはステップS212の処理に進む。
Subsequently, in step S <b> 203, the
ステップS208の処理では、制御部19は、ステップS205の処理で撮像部13が撮像したフレーム画像を、一時記憶部14に記憶させる。続いて、ステップS209の処理で、基準画像を生成するために必要なフレーム画像「2枚」の画像の平均画像、すなわち基準画像を生成し、一時記憶部14に記憶させる。なお、基準画像を生成するために必要なフレーム画像「2枚」は、基準画像を生成するために保存する必要があるフレーム画像「2枚」と同一である。続いて、ステップS210の処理で、一時記憶部14が記憶しているうち、最も過去に撮像した保存画像を一時記憶部14から削除する。続いて、ステップS211の処理で、撮像回数Tの値を0に初期化する。
In the process of step S208, the
ステップS212の処理では、前回ステップS209の処理を実行した際に一時記憶部14に記憶させた基準画像を補正対象画像で除算し、補正対象画像のフリッカを補正するためのゲイン値を算出する。続いて、ステップS213の処理で、補正対象画像に対して、ステップS212の処理で算出したゲイン値を乗算してフリッカ補正を行う。続いて、ステップS214の処理で、フリッカ補正を行った補正対象画像を動画として記憶部18に記憶させる。その後、撮影終了ボタンが押下されるまで、ステップS204からステップS214の処理を繰り返し実行する。
In the process of step S212, the reference image stored in the
上述した通り、本実施形態における補正対象画像のフリッカ補正の方法では、基準画像を1フレーム毎に生成する必要が無いため、基準画像を生成するために必要なフレーム画像を少なくすることができる。そのため、フレーム画像を記憶する記憶部の容量をより少なくすることができ、基準画像を作成するための処理時間、あるいはハードウェア処理における回路リソースをより少なくすることができる。また、本実施形態のフリッカ補正の方法を用いてフリッカ補正を行う装置においては、基準画像を作成するための処理次男を少なくすることができるため、消費電力を更に少なくすることができる。 As described above, in the flicker correction method for the correction target image in the present embodiment, it is not necessary to generate the reference image for each frame, so that the number of frame images necessary for generating the reference image can be reduced. Therefore, the capacity of the storage unit that stores the frame image can be reduced, and the processing time for creating the reference image or the circuit resources in the hardware processing can be further reduced. Further, in the apparatus that performs flicker correction using the flicker correction method of the present embodiment, it is possible to reduce the number of second generations for creating a reference image, so that power consumption can be further reduced.
なお、上述したフリッカ補正の方法では、補正対象画像のフリッカ補正に、補正対象画像と時間的に離れた基準画像を用いることになるため、例えば、被写体が動いている場合などに、基準画像と補正画像とに差が生じ、適切なフリッカ補正ゲインが得られなくなることが懸念される。しかし、本実施形態で想定している高フレームレートでの撮像システムにおいては、複数フレーム毎に基準画像を生成したとしても、基準画像の更新周期は、フレームレートが60fpsの動画を撮像する際での1フレームの撮像間隔とほぼ同じ間隔となる。そのため、複数フレーム毎に基準画像を生成することは、大きな弊害はないと考えられる。 In the flicker correction method described above, a reference image that is temporally separated from the correction target image is used for flicker correction of the correction target image. For example, when the subject is moving, There is a concern that a difference may occur between the corrected image and an appropriate flicker correction gain cannot be obtained. However, in the imaging system at a high frame rate assumed in the present embodiment, even if a reference image is generated for each of a plurality of frames, the reference image update cycle is when a moving image with a frame rate of 60 fps is captured. The interval is almost the same as the imaging interval of one frame. For this reason, it is considered that generating a reference image for each of a plurality of frames has no significant adverse effect.
図8は、本実施形態において、光源の明暗周波数が100Hzである場合に、様々なフレームレートの動画を撮影する場合における、基準画像の生成に必要なフレーム画像の枚数nと、基準画像を生成するために保存する必要があるフレーム画像の枚数mと、基準画像作成用のフレーム画像の保存周期tと、基準画像の更新間隔との関係を纏めた図である。 FIG. 8 shows the case where the number n of frame images necessary for generating the reference image and the reference image are generated when moving images having various frame rates are taken when the light / dark frequency of the light source is 100 Hz. FIG. 6 is a diagram summarizing the relationship among the number m of frame images that need to be stored in order to save, the storage period t of frame images for creating reference images, and the update interval of reference images.
図示する例では、表形式で纏められており、列ごとに、撮影する動画のフレームレートと、従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数nと、本実施形態の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数nと、従来の方法を用いて基準画像を生成する場合に保存する必要があるフレーム画像の枚数mと、本実施形態の方法を用いて基準画像を生成する場合に保存する必要があるフレーム画像の枚数mと、従来の方法を用いて基準画像を生成する場合での基準画像作成用のフレーム画像の保存周期tと、本実施形態の方法を用いて基準画像を生成する場合での基準画像作成用のフレーム画像の保存周期tと、基準画像の更新間隔とを関連付けて示している。 In the example shown in the figure, they are summarized in a table format. For each column, the frame rate of a moving image to be shot, the number n of frame images necessary for generating a reference image using a conventional method, and the present embodiment The number n of frame images required when generating a reference image using the method of FIG. 5, the number m of frame images that need to be stored when generating a reference image using a conventional method, The number m of frame images that need to be stored when generating a reference image using the method, the storage period t of the frame image for generating the reference image when generating the reference image using the conventional method, The reference image creation frame image storage cycle t and the reference image update interval in the case of generating a reference image using the method of this embodiment are shown in association with each other.
例えば、フレームレートが120fpsの動画を撮影する場合、従来の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数nは「6枚」であり、本実施形態の方法を用いて基準画像を生成する場合に必要なフレーム画像の枚数nは「2枚」であり、従来の方法を用いて基準画像を生成する場合に保存する必要があるフレーム画像の枚数mは「6枚」であり、本実施形態の方法を用いて基準画像を生成する場合に保存する必要があるフレーム画像の枚数mは「2枚」であり、従来の方法を用いて基準画像を生成する場合での基準画像作成用のフレーム画像の保存周期tは「1」であり、本実施形態の方法を用いて基準画像を生成する場合での基準画像作成用のフレーム画像の保存周期tは「3」であり、基準画像の更新間隔は25msであることを示している。他のフレームレートの動画を撮影する場合については図示するとおりである。 For example, when shooting a moving image with a frame rate of 120 fps, the number n of frame images required for generating a reference image using the conventional method is “6”, and the reference using the method of this embodiment is used. The number n of frame images necessary for generating an image is “2”, and the number m of frame images that need to be stored when generating a reference image using the conventional method is “6”. Yes, the number m of frame images that need to be stored when the reference image is generated using the method of the present embodiment is “2”, and the reference in the case of generating the reference image using the conventional method The storage period t of the frame image for image creation is “1”, and the storage cycle t of the frame image for reference image creation when the reference image is generated using the method of the present embodiment is “3”. The reference image update interval is 2 It shows that it is a ms. The case of shooting a moving image of another frame rate is as illustrated.
図示するとおり、高フレームレート(例えば、フレームレートが90fps〜480fps)の動画を撮影する場合、基準画像作成用のフレーム画像の保存周期t(基準画像の作成周期)が大きくなるが、この場合における基準画像の更新間隔は25ms〜33msである。また、フレームレートが15fps〜60fpsの動画を撮影する場合における基準画像の更新間隔は17ms〜67msである。このことより、高フレームレートの動画を撮影する場合に、複数フレーム毎に基準画像を生成する方法でフリッカ補正を行った場合においても、基準画像の更新間隔は大きく変わらないことがわかる。 As shown in the figure, when a moving image with a high frame rate (for example, a frame rate of 90 fps to 480 fps) is shot, the frame image storage cycle t (reference image creation cycle) for creating a reference image is increased. The update interval of the reference image is 25 ms to 33 ms. The update interval of the reference image when shooting a moving image with a frame rate of 15 fps to 60 fps is 17 ms to 67 ms. From this, it can be seen that, when shooting a high frame rate moving image, even if flicker correction is performed by a method of generating a reference image for each of a plurality of frames, the update interval of the reference image does not change significantly.
なお、本実施形態では、撮影する動画のフレームレートと光源の明滅周波数とに基づいて、基準画像作成用のフレーム画像の保存周期t(基準画像の更新周期)を自動的に求めたが、これに限らず、基準画像作成用のフレーム画像の保存周期tをさらに長い周期とすることも可能である。例えば、被写体の動きが遅い場合、基準画像作成用のフレーム画像の保存周期tをさらに長くすることが可能である。基準画像作成用のフレーム画像の保存周期tをさらに長くする場合、基準画像作成用のフレーム画像の保存周期tを、上述した計算で求めた値の整数倍の値に設定すればよい。これにより、処理時間および消費電力をさらに低減させることが可能となる。 In this embodiment, the frame image storage cycle t (reference image update cycle) for creating the reference image is automatically obtained based on the frame rate of the moving image to be shot and the blinking frequency of the light source. However, the storage period t of the frame image for creating the reference image can be set to a longer period. For example, when the movement of the subject is slow, the storage period t of the frame image for creating the reference image can be further increased. In order to further increase the storage period t of the frame image for creating the reference image, the storage period t of the frame image for creating the reference image may be set to a value that is an integral multiple of the value obtained by the above-described calculation. As a result, the processing time and power consumption can be further reduced.
以上、この発明の第1の実施形態および第2の実施形態について図面を参照して詳述してきたが、具体的な構成はこの実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の設計等も含まれる。 Although the first embodiment and the second embodiment of the present invention have been described in detail with reference to the drawings, the specific configuration is not limited to this embodiment and does not depart from the gist of the present invention. Range design etc. are also included.
1・・・画像処理装置、11・・・入力部、12・・・必要枚数算出部、13・・・撮像部、14・・・一時記憶部、15・・・基準画像生成部、16・・・ゲイン算出部、17・・・補正部、18・・・記憶部、19・・・制御部
DESCRIPTION OF
Claims (4)
基準画像生成部が、前記最小公倍数を前記明滅周波数b倍した周期をn等分したタイミングで撮像したn枚のフレーム画像を平均化して基準画像を生成する基準画像生成ステップと、
補正部が、前記基準画像に基づいて、撮像した前記動画のフリッカ補正を行う補正ステップと、
を含むことを特徴とするフリッカ補正方法。 The calculation unit calculates the least common multiple of 1 / a and 1 / b from the frame rate a [fps] of the moving image to be captured and the blinking frequency b [Hz] of the light source, and calculates the denominator value of the calculated least common multiple. a calculation step of calculating a minimum divisor n excluding 1 included in the numerator value when converted to a;
Reference image generating unit, a reference image generating step of generating a reference image n frame images of the captured cycle the least common multiple and the blink frequency b times at a timing n equal parts by averaging,
A correction unit that performs flicker correction of the captured moving image based on the reference image;
A flicker correction method comprising:
ことを特徴とする請求項1に記載のフリッカ補正方法。 2. The reference image generation step, wherein the reference image is updated when a frame image having the same brightness as the most recently captured frame image is obtained from the n frame images. The flicker correction method described in 1.
ことを特徴とする請求項2に記載のフリッカ補正方法。 The flicker correction method according to claim 2, wherein in the reference image generation step, the reference image is updated when a predetermined time or more has elapsed since the previous update.
前記フレームレートa[fps]と前記明滅周波数b[Hz]とから、1/aと1/bとの最小公倍数を算出し、算出した最小公倍数の分母の値をaに変換した場合の分子の値に含まれる1を除く最小の約数nを算出する算出部と、
前記最小公倍数を前記明滅周波数b倍した周期をn等分したタイミングで撮像したn枚のフレーム画像を平均化して基準画像を生成する基準画像生成部と、
前記基準画像生成部が生成した前記基準画像に基づいて、前記撮像部が撮像した前記動画のフリッカ補正を行う補正部と、
を備えることを特徴とする画像処理装置。 An imaging unit that captures a moving image with a frame rate a [fps] under a light source having a blinking frequency b [Hz];
The least common multiple of 1 / a and 1 / b is calculated from the frame rate a [fps] and the blinking frequency b [Hz], and the denominator value of the calculated least common multiple is converted to a. A calculation unit for calculating a minimum divisor n excluding 1 included in the value;
A reference image generation unit that generates a reference image n frame images of the captured cycle the least common multiple and the blink frequency b times at a timing n equal parts by averaging,
A correction unit that performs flicker correction of the moving image captured by the imaging unit based on the reference image generated by the reference image generation unit;
An image processing apparatus comprising:
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2011040148A JP5711005B2 (en) | 2011-02-25 | 2011-02-25 | Flicker correction method and image processing apparatus |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2011040148A JP5711005B2 (en) | 2011-02-25 | 2011-02-25 | Flicker correction method and image processing apparatus |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2012178685A JP2012178685A (en) | 2012-09-13 |
| JP5711005B2 true JP5711005B2 (en) | 2015-04-30 |
Family
ID=46980254
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2011040148A Expired - Fee Related JP5711005B2 (en) | 2011-02-25 | 2011-02-25 | Flicker correction method and image processing apparatus |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP5711005B2 (en) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10567699B2 (en) | 2014-11-06 | 2020-02-18 | Sony Corporation | Information processing apparatus to improve image quality by removing flicker component from captured image |
| JP7022027B2 (en) * | 2018-07-30 | 2022-02-17 | Kddi株式会社 | Information processing equipment and programs |
| CN116546334B (en) * | 2023-04-12 | 2026-02-06 | 杭州华橙软件技术有限公司 | Video shooting method and device |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2000350102A (en) * | 1999-06-02 | 2000-12-15 | Sharp Corp | Flicker correction circuit and imaging device of imaging apparatus |
| JP2008109370A (en) * | 2006-10-25 | 2008-05-08 | Sanyo Electric Co Ltd | Image correcting device and method, and imaging apparatus |
| JP2009021813A (en) * | 2007-07-11 | 2009-01-29 | Canon Inc | Flicker correction apparatus and flicker correction method |
| JP2009081684A (en) * | 2007-09-26 | 2009-04-16 | Panasonic Corp | Flicker reduction device |
| JP2009152919A (en) * | 2007-12-21 | 2009-07-09 | Olympus Imaging Corp | Imaging apparatus and image signal processing method |
-
2011
- 2011-02-25 JP JP2011040148A patent/JP5711005B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2012178685A (en) | 2012-09-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP4626689B2 (en) | Imaging apparatus, correction circuit, and correction method | |
| JP4856765B2 (en) | Imaging apparatus and flicker detection method | |
| CN100596171C (en) | Image data processing device, image data processing method and imaging system | |
| JP6944272B2 (en) | Motion detector and its control method | |
| JP2015115922A (en) | Imaging apparatus and imaging method | |
| JP5612017B2 (en) | Camera shake reduction system | |
| CN104541499B (en) | Camera device, integrated circuit, and flicker reduction method | |
| JP2016081427A (en) | Image processor, image processing method and program | |
| US10911675B2 (en) | Method for providing shake correction, signal processing device performing the method, and imaging device including the signal processing device | |
| CN114125314A (en) | Brightness synchronization method, device, storage medium and equipment | |
| JP5711005B2 (en) | Flicker correction method and image processing apparatus | |
| JP2020108101A (en) | Information processing apparatus, imaging apparatus, information processing method, and imaging apparatus control method | |
| US20140063285A1 (en) | Image data processing apparatus, imaging apparatus, and image data processing method | |
| JP4323343B2 (en) | Imaging apparatus and flicker detection method | |
| JP2017069741A (en) | Imaging apparatus, flicker detection method, and program | |
| US9883102B2 (en) | Image processing apparatus, image processing method, program, and camera | |
| WO2012147337A1 (en) | Flicker detection device, flicker detection method, and flicker detection program | |
| JP6652303B2 (en) | Flash band determination device, control method thereof, control program, and imaging device | |
| CN106063251B (en) | Image processing apparatus and image processing method | |
| TW202013312A (en) | Image generating method and electronic apparatus | |
| JP6080579B2 (en) | Imaging apparatus and control method thereof | |
| JP5896558B2 (en) | Flicker suppression device and high-speed camera | |
| JP6778014B2 (en) | Imaging device and its control method, program, storage medium | |
| JP6797566B2 (en) | Image pickup device, control method of image pickup device, and image processing device | |
| CN112135063B (en) | Image output method and electronic device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20140115 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20141009 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20141118 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20150116 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A821 Effective date: 20150119 |
|
| 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: 20150224 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20150305 |
|
| R151 | Written notification of patent or utility model registration |
Ref document number: 5711005 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
| S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| LAPS | Cancellation because of no payment of annual fees |