JP5928290B2 - Image processing apparatus, image processing method, and image processing program - Google Patents

Image processing apparatus, image processing method, and image processing program Download PDF

Info

Publication number
JP5928290B2
JP5928290B2 JP2012229508A JP2012229508A JP5928290B2 JP 5928290 B2 JP5928290 B2 JP 5928290B2 JP 2012229508 A JP2012229508 A JP 2012229508A JP 2012229508 A JP2012229508 A JP 2012229508A JP 5928290 B2 JP5928290 B2 JP 5928290B2
Authority
JP
Japan
Prior art keywords
line
screen
flash
image data
lines
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2012229508A
Other languages
Japanese (ja)
Other versions
JP2013192201A (en
Inventor
龍治 白川
龍治 白川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
JVCKenwood Corp
Original Assignee
JVCKenwood Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by JVCKenwood Corp filed Critical JVCKenwood Corp
Priority to JP2012229508A priority Critical patent/JP5928290B2/en
Priority to US13/749,184 priority patent/US8947588B2/en
Priority to EP13000704.0A priority patent/EP2629508B1/en
Publication of JP2013192201A publication Critical patent/JP2013192201A/en
Application granted granted Critical
Publication of JP5928290B2 publication Critical patent/JP5928290B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Exposure Control For Cameras (AREA)
  • Transforming Light Signals Into Electric Signals (AREA)
  • Studio Devices (AREA)

Description

本発明は、動画像の撮影時に撮影者以外の他者のフラッシュ等によって、画像の明るさが不連続となった画面を補正することができる画像処理装置、画像処理方法、画像処理プログラムに関する。   The present invention relates to an image processing apparatus, an image processing method, and an image processing program capable of correcting a screen in which the brightness of an image is discontinuous by a flash of a third party other than a photographer when shooting a moving image.

近年、ビデオカメラ等の撮像装置においては、CMOS(Complementary Metal Oxide Semiconductor)センサが数多く採用されている。CMOSセンサにおける撮像信号の読み出しは、全画素で同一タイミングでなく、ライン単位で順次、リセット、露光、読み出しを行うことにより、読み出しタイミングがライン方向に順次ずれていくローリングシャッタ方式にて行われる。   2. Description of the Related Art In recent years, many complementary metal oxide semiconductor (CMOS) sensors have been employed in imaging devices such as video cameras. Reading of the imaging signal in the CMOS sensor is performed by a rolling shutter system in which the readout timing is sequentially shifted in the line direction by sequentially performing reset, exposure, and readout in units of lines, not at the same timing in all pixels.

このため、例えば結婚式等において多数のビデオカメラやスチルカメラが、同一の被写体を同時に撮影する場合において、他者のフラッシュによる発光期間が短く強い光が一部のラインのみの露光期間中にCMOSセンサに入射することがある。この場合、撮像する画面の一部で露光量が異なり、画面内に白帯状の明るい領域が発生して不連続な画像となってしまう。この問題点はフラッシュに限らず、フラッシュと同様の発光期間が短く強い光がCMOSセンサに入射した場合も同様に発生する。   For this reason, for example, when a large number of video cameras or still cameras photograph the same subject at the same time, such as at a wedding ceremony, CMOS is emitted during the exposure period of only a part of the lines, where the flashing period of the other person's flash is short and intense light is emitted. May enter the sensor. In this case, the exposure amount differs in a part of the screen to be imaged, and a white band-like bright area is generated in the screen, resulting in a discontinuous image. This problem is not limited to the flash, but also occurs when strong light having a short light emission period similar to the flash is incident on the CMOS sensor.

この問題点の解決策が例えば特許文献1〜3に記載されているように種々提案されている。   Various solutions to this problem have been proposed as described in Patent Documents 1 to 3, for example.

特開2010−213220号公報JP 2010-213220 A 特開2011−15222号公報JP 2011-15222 A 特開2011−101208号公報JP 2011-101208 A

フラッシュ等の発光期間が短く強い光がCMOSセンサに入射して画面内で画像の明るさが不連続となったことを、極力、誤検出少なく検出して補正することが求められる。また、画面内で画像の明るさが不連続となったことを検出するためにメモリリソースが増大することは好ましくない。メモリリソースが増大せず、画像の明るさが不連続となったことを検出することが求められる。さらに、画像の明るさが不連続となったことを検出して補正した場合に補正処理による遅延を極力少なくすることが求められる。   It is required to detect and correct as little as possible misdetection that the brightness of the image is discontinuous in the screen due to the light having a short light emission period such as a flash entering the CMOS sensor. Further, it is not preferable that the memory resources increase in order to detect that the brightness of the image is discontinuous in the screen. It is required to detect that the brightness of an image becomes discontinuous without increasing memory resources. Furthermore, it is required to minimize the delay caused by the correction process when it is detected and corrected that the brightness of the image is discontinuous.

本発明はこのような要望に対応するため、画面内で画像の明るさが不連続となったことを精度よく検出することができる画像処理装置、画像処理方法、画像処理プログラムを提供することを目的とする。また、メモリリソースを増大させることなく、画面内で画像の明るさが不連続となったことを検出することができる画像処理装置、画像処理方法、画像処理プログラムを提供することを目的とする。さらに、画像の明るさの不連続を補正した場合に補正処理による遅延を少なくすることができる画像処理装置、画像処理方法、画像処理プログラムを提供することを目的とする。   In order to meet such a demand, the present invention provides an image processing apparatus, an image processing method, and an image processing program capable of accurately detecting that the brightness of an image is discontinuous on the screen. Objective. It is another object of the present invention to provide an image processing apparatus, an image processing method, and an image processing program that can detect that the brightness of an image is discontinuous in a screen without increasing memory resources. It is another object of the present invention to provide an image processing apparatus, an image processing method, and an image processing program that can reduce delay due to correction processing when discontinuity in image brightness is corrected.

本発明は、上述した従来の技術の課題を解決するため、画像データの現在の画面におけるそれぞれのラインのライン平均輝度と、前記現在の画面の少なくとも1画面前の画面である過去の画面の全画面平均輝度と算出し、それぞれのラインの前記ライン平均輝度と前記全画面平均輝度とを比較することによって、画面の一部のラインがフラッシュの発光によって高輝度となっているか否かを検出するフラッシュ検出部(2,20)と、前記画像データの前記過去の画面を保持する保持部(4)と、前記フラッシュ検出部によって前記現在の画面の一部のラインが高輝度となっていることが検出されたら、前記現在の画面における高輝度となっているラインを前記保持部に保持された前記過去の画面のラインに置換することにより画像データを補正するフラッシュ補正部(8)とを備えることを特徴とする画像処理装置を提供する。   In order to solve the above-described problems of the conventional technology, the present invention provides a line average brightness of each line on the current screen of the image data and all of the past screens that are at least one screen before the current screen. Calculates the average screen brightness and compares the line average brightness of each line with the total screen average brightness to detect whether some lines of the screen are bright due to flash emission. The flash detection unit (2, 20), the holding unit (4) that holds the past screen of the image data, and a part of the line on the current screen are brightened by the flash detection unit. Is detected, the image data is replaced by replacing the high-brightness line on the current screen with the previous screen line held in the holding unit. To provide an image processing apparatus, characterized in that it comprises a flash correction unit positive for the (8).

また、本発明は、上述した従来の技術の課題を解決するため、画像データにおける現在の画面におけるそれぞれのラインのライン平均輝度を算出し、前記画像データにおける前記現在の画面の少なくとも1画面前の画面である過去の画面の全画面平均輝度を算出し、それぞれのラインの前記ライン平均輝度と前記全画面平均輝度とを比較することによって、画面の一部のラインがフラッシュの発光によって高輝度となっているか否かを検出し、前記画像データの前記過去の画面を保持部に保持し、前記現在の画面の一部のラインが高輝度となっていることが検出されたら、前記現在の画面における高輝度となっているラインを前記保持部に保持された前記過去の画面のラインに置換することにより画像データを補正することを特徴とする画像処理方法を提供する。   In addition, in order to solve the above-described problems of the related art, the present invention calculates the line average brightness of each line on the current screen in the image data, and at least one screen before the current screen in the image data. By calculating the total screen average brightness of the past screen, which is a screen, and comparing the line average brightness and the total screen average brightness of each line, a part of the screen has a high brightness due to flash emission. The previous screen of the image data is held in a holding unit, and when it is detected that some lines of the current screen have high brightness, the current screen An image characterized in that image data is corrected by replacing a line having high luminance in the line with a line of the past screen held in the holding unit. To provide a management method.

さらに、本発明は、上述した従来の技術の課題を解決するため、コンピュータに、画像データにおける現在の画面におけるそれぞれのラインのライン平均輝度を算出する機能と、前記画像データにおける前記現在の画面の少なくとも1画面前の画面である過去の画面の全画面平均輝度を算出する機能と、それぞれのラインの前記ライン平均輝度と前記全画面平均輝度とを比較することによって、画面の一部のラインがフラッシュの発光によって高輝度となっているか否かを検出する機能と、前記現在の画面の一部のラインが高輝度となっていることが検出されたら、前記現在の画面における高輝度となっているラインを保持部に保持された前記過去の画面のラインに置換することにより画像データを補正する機能とを実現させることを特徴とする画像処理プログラムを提供する。   Furthermore, in order to solve the above-described problems of the conventional technology, the present invention provides a computer with a function of calculating the line average luminance of each line in the current screen in the image data, and the current screen in the image data. By comparing the line average luminance of each line with the average luminance of the entire screen and the average luminance of the entire screen of the past screen which is at least one previous screen, a part of the screen lines When it is detected that the brightness of the flash is high and whether or not a part of the current screen has high brightness, the brightness of the current screen becomes high. And a function of correcting image data by replacing the existing line with the line of the past screen held in the holding unit, To provide that image processing program.

本発明の画像処理装置、画像処理方法、画像処理プログラムによれば、画面内で画像の明るさが不連続となったことを精度よく検出することができる。また、本発明の画像処理装置、画像処理方法、画像処理プログラムによれば、メモリリソースを増大させることなく、画面内で画像の明るさが不連続となったことを検出することができる。さらに、本発明の画像処理装置、画像処理方法、画像処理プログラムによれば、画像の明るさの不連続を補正した場合に補正処理による遅延を少なくすることができる。   According to the image processing apparatus, the image processing method, and the image processing program of the present invention, it is possible to accurately detect that the brightness of the image is discontinuous in the screen. Further, according to the image processing apparatus, the image processing method, and the image processing program of the present invention, it is possible to detect that the brightness of the image is discontinuous on the screen without increasing the memory resources. Furthermore, according to the image processing apparatus, the image processing method, and the image processing program of the present invention, it is possible to reduce the delay due to the correction process when the brightness discontinuity of the image is corrected.

第1実施形態の画像処理装置を示すブロック図である。1 is a block diagram illustrating an image processing apparatus according to a first embodiment. CMOSセンサを用いた動画像の撮影時にフラッシュの発光によって発生する画像の明るさが不連続となる現象を説明するための図である。It is a figure for demonstrating the phenomenon in which the brightness of the image which generate | occur | produces by light emission of a flash at the time of imaging | photography of a moving image using a CMOS sensor becomes discontinuous. 第1実施形態の画像処理装置における撮影及び記録処理の全体的な流れを示すフローチャートである。It is a flowchart which shows the whole flow of imaging | photography and the recording process in the image processing apparatus of 1st Embodiment. 第1実施形態におけるフラッシュ検出・補正処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of the flash detection and correction process in 1st Embodiment. 図4におけるステップS305,S310で用いる閾値の好ましい例を説明するための図である。It is a figure for demonstrating the preferable example of the threshold value used by step S305, S310 in FIG. 第1実施形態による画像データの補正を説明するための図である。It is a figure for demonstrating correction | amendment of the image data by 1st Embodiment. 第2実施形態の画像処理装置を示すブロック図である。It is a block diagram which shows the image processing apparatus of 2nd Embodiment. 第2実施形態におけるフラッシュ検出・補正処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of the flash detection and correction process in 2nd Embodiment. 第2実施形態による効果を説明するための図である。It is a figure for demonstrating the effect by 2nd Embodiment. 第3実施形態におけるフラッシュ検出・補正処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of the flash detection and correction process in 3rd Embodiment. 第3実施形態による動作を説明するための隣接領域を示す図である。It is a figure which shows the adjacent area | region for demonstrating the operation | movement by 3rd Embodiment. 第3実施形態による動作を説明するための混合特性を示す図である。It is a figure which shows the mixing characteristic for demonstrating the operation | movement by 3rd Embodiment. 第4実施形態におけるフラッシュ検出・補正処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of the flash detection and correction process in 4th Embodiment. 第4及び第5実施形態による効果を説明するための図である。It is a figure for demonstrating the effect by 4th and 5th embodiment. 第5実施形態におけるフラッシュ検出・補正処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of the flash detection and correction process in 5th Embodiment.

以下、本発明の画像処理装置、画像処理方法、画像処理プログラムの各実施形態について、添付図面を参照して説明する。各実施形態においては、画像処理装置をビデオカメラに適用し、ビデオカメラで行われる画像処理方法、ビデオカメラに搭載されているコンピュータに画像処理を実行させる画像処理プログラムを例として説明する。   Hereinafter, embodiments of an image processing apparatus, an image processing method, and an image processing program of the present invention will be described with reference to the accompanying drawings. In each embodiment, an image processing apparatus applied to a video camera, an image processing method performed by the video camera, and an image processing program that causes a computer mounted on the video camera to execute image processing will be described as examples.

<第1実施形態>
図1を用いて、第1実施形態の画像処理装置であるビデオカメラ101の全体構成について説明する。ビデオカメラ101は、撮像部1,フラッシュ検出部2,画像信号処理部3,バッファメモリ4,圧縮伸張処理部5,出力信号処理部6,表示部7,フラッシュ補正部8,制御部9,メモリ10,記録再生部11,操作スイッチ12を備える。
<First Embodiment>
The overall configuration of a video camera 101 that is an image processing apparatus according to the first embodiment will be described with reference to FIG. The video camera 101 includes an imaging unit 1, a flash detection unit 2, an image signal processing unit 3, a buffer memory 4, a compression / decompression processing unit 5, an output signal processing unit 6, a display unit 7, a flash correction unit 8, a control unit 9, a memory 10 includes a recording / reproducing unit 11 and an operation switch 12.

撮像部1は、レンズや絞り等の光学系(図示せず)、CMOSセンサ1s、露出やピントの制御機構(図示せず)等を有する。一例として、撮像部1は3つのCMOSセンサ1sを有し、3つのCMOSセンサ1sから赤,緑,青それぞれの色信号であるR,G,B信号を示す電気信号を出力する。勿論、CMOSセンサ1sは1つであってもよい。撮像部1は、レンズを介してCMOSセンサ1sに入力された光情報を所定のタイミングで電気信号として取り出し、電気信号をフラッシュ検出部2及び画像信号処理部3に供給する。   The imaging unit 1 includes an optical system (not shown) such as a lens and an aperture, a CMOS sensor 1s, an exposure and focus control mechanism (not shown), and the like. As an example, the imaging unit 1 includes three CMOS sensors 1s, and outputs electrical signals indicating R, G, and B signals that are red, green, and blue color signals from the three CMOS sensors 1s. Of course, the number of CMOS sensors 1s may be one. The imaging unit 1 extracts optical information input to the CMOS sensor 1 s through the lens as an electrical signal at a predetermined timing, and supplies the electrical signal to the flash detection unit 2 and the image signal processing unit 3.

フラッシュ検出部2は、ライン平均輝度算出部21,ライン平均輝度保持部22,全画面平均輝度算出部23,全画面平均輝度保持部24,差分算出部25,フラッシュ判定部26を有する。フラッシュ検出部2は、制御部9による制御に従って以下のようにフラッシュの発光を検出する。   The flash detection unit 2 includes a line average luminance calculation unit 21, a line average luminance holding unit 22, a full screen average luminance calculation unit 23, a full screen average luminance holding unit 24, a difference calculation unit 25, and a flash determination unit 26. The flash detection unit 2 detects the flash emission according to the control by the control unit 9 as follows.

ライン平均輝度算出部21は、撮像部1から供給された電気信号におけるラインごとの明るさの平均を算出する。第1実施形態においては、R,G,B信号の内、G信号に基づいてラインごとの明るさの平均を算出する。具体的には、ライン平均輝度算出部21は、G信号の値を1ラインの有効画素分に渡って加算し、有効画素数で除算することによって1ラインの明るさの平均(ライン平均輝度)を算出する。ライン平均輝度を算出する基にする信号はG信号に限定されるものではない。   The line average luminance calculation unit 21 calculates the average brightness for each line in the electrical signal supplied from the imaging unit 1. In the first embodiment, the average brightness for each line is calculated based on the G signal among the R, G, and B signals. Specifically, the line average luminance calculating unit 21 adds the value of the G signal over the effective pixels of one line, and divides by the number of effective pixels to average the brightness of one line (line average luminance). Is calculated. The signal based on which the line average luminance is calculated is not limited to the G signal.

ライン平均輝度算出部21によって算出されたライン平均輝度は、ライン平均輝度保持部22及び全画面平均輝度算出部23に入力される。ライン平均輝度保持部22は、ライン平均輝度算出部21によって算出されたライン平均輝度を一時的に保持する。全画面平均輝度算出部23は、1画面(1フレーム)全体の明るさの平均を算出する。具体的には、全画面平均輝度算出部23は、順次入力されるライン平均輝度を1画面の有効ラインに渡って加算し、有効ライン数で除算することによって1画面全体の明るさの平均(全画面平均輝度)を算出する。全画面平均輝度保持部24は、全画面平均輝度を一時的に保持する。   The line average luminance calculated by the line average luminance calculation unit 21 is input to the line average luminance holding unit 22 and the full screen average luminance calculation unit 23. The line average luminance holding unit 22 temporarily holds the line average luminance calculated by the line average luminance calculating unit 21. The entire screen average luminance calculation unit 23 calculates the average brightness of one screen (one frame). Specifically, the entire screen average luminance calculation unit 23 adds the average line luminance sequentially input over the effective lines of one screen, and divides by the number of effective lines, thereby averaging the brightness of the entire one screen ( The average luminance of the entire screen) is calculated. The full screen average luminance holding unit 24 temporarily holds the full screen average luminance.

差分算出部25には、ライン平均輝度保持部22で保持されたライン平均輝度と、全画面平均輝度保持部24で保持された全画面平均輝度とが入力される。なお、全画面平均輝度を算出した画面とライン平均輝度を算出した画面とは1画面ずれており、全画面平均輝度を算出した画面は、ライン平均輝度を算出した画面の1画面前の画面である。1画面前の画面の全画面平均輝度を1画面の期間保持しておき、2画面前の画面の全画面平均輝度として用いてもよい。また、1画面前の画面の全画面平均輝度と2画面前の画面の全画面平均輝度との双方を保持し、1画面前の画面がフラッシュの発光の影響を受けている場合に、2画面前の画面の全画面平均輝度を用いるようにしてもよい。   The difference calculating unit 25 receives the line average luminance held by the line average luminance holding unit 22 and the full screen average luminance held by the full screen average luminance holding unit 24. Note that the screen for which the average average luminance is calculated is different from the screen for which the average average luminance is calculated by one screen. The screen for which the average average luminance is calculated is the screen one screen before the screen for which the average average luminance is calculated. is there. The entire screen average brightness of the previous screen may be retained for one screen period and used as the entire screen average brightness of the previous two screens. Also, if both the screen average brightness of the previous screen and the screen average brightness of the previous two screens are retained and the previous screen is affected by the flash emission, You may make it use the whole screen average brightness | luminance of a previous screen.

第1実施形態では、ライン平均輝度を算出している画面を現在の画面、全画面平均輝度を算出した画面を1画面前の画面とする。差分算出部25は、現在の画面におけるそれぞれのライン平均輝度と1画面前の画面における全画面平均輝度との差分を順次算出する。差分算出部25は差分の絶対値をとり、差分値として出力する。   In the first embodiment, the screen on which the line average brightness is calculated is the current screen, and the screen on which the total screen average brightness is calculated is the previous screen. The difference calculation unit 25 sequentially calculates the difference between each line average luminance on the current screen and the entire screen average luminance on the previous screen. The difference calculation unit 25 takes the absolute value of the difference and outputs it as a difference value.

差分算出部25によって算出された差分値は、フラッシュ判定部26に入力される。フラッシュ判定部26は、ラインごとの差分値が設定された閾値以上であるか否かを判定するとともに、差分値が閾値以上である状態が予め設定したライン数以上継続するか否かを判定する。フラッシュ判定部26は、差分値が閾値以上である状態が予め設定したライン数以上継続したと判定した場合に、フラッシュの発光によって画像の明るさが不連続となったと検出する。フラッシュ判定部26は、フラッシュが発光したことを示す検出信号と併せて、フラッシュの発光の開始時点である差分値が閾値以上となった最初のライン番号を示すデータと、差分値が閾値未満となった最初のライン番号を示すデータとを出力する。差分値が閾値未満となった最初のラインの1ライン前のラインがフラッシュの発光の最終ラインである。   The difference value calculated by the difference calculation unit 25 is input to the flash determination unit 26. The flash determination unit 26 determines whether or not the difference value for each line is equal to or greater than a set threshold value, and determines whether or not the state where the difference value is equal to or greater than the threshold value continues for a preset number of lines. . When it is determined that the state where the difference value is equal to or greater than the threshold value continues for a preset number of lines or more, the flash determination unit 26 detects that the brightness of the image is discontinuous due to flash emission. The flash determination unit 26, together with the detection signal indicating that the flash is emitted, the data indicating the first line number when the difference value at the start of flash emission is equal to or greater than the threshold, and the difference value is less than the threshold. The data indicating the first line number is output. The line one line before the first line where the difference value is less than the threshold is the last line of flash emission.

なお、フラッシュ判定部26は、例えば、フラッシュが発光したと判定した場合にはフラッシュが発光したことを示す検出信号として“1”を、フラッシュが発光しなかったと判定した場合にはフラッシュが発光しなかったことを示す検出信号として“0”を生成すればよい。   For example, the flash determination unit 26 sets “1” as a detection signal indicating that the flash is emitted when it is determined that the flash is emitted, and the flash is emitted when it is determined that the flash is not emitted. What is necessary is just to produce | generate "0" as a detection signal which shows not having existed.

以上の説明より分かるように、フラッシュ検出部2は、ライン平均輝度、全画面平均輝度、差分値を算出し、差分値を判定してフラッシュの発光を検出するだけであるので、フレームメモリのような大容量のメモリリソースを備える必要はない。なお、ここではフラッシュの発光を検出としたが、上記のように、フラッシュと同様の発光期間が短く強い光がCMOSセンサ1sに入射した場合にもフラッシュ検出部2は画像の明るさが不連続となったことを検出する。このような場合も含めてフラッシュの発光の検出とする。   As can be seen from the above description, the flash detection unit 2 only calculates line average brightness, full screen average brightness, and difference value, and determines the difference value to detect flash emission. It is not necessary to provide a large memory resource. Note that although the flash emission is detected here, as described above, the flash detection unit 2 also has a discontinuous image brightness even when strong light having a short emission period is incident on the CMOS sensor 1s. It detects that it became. Including such a case, the flash emission is detected.

フラッシュ検出部2は、現在の画面におけるそれぞれのラインのライン平均輝度と、例えば1画面前の画面である過去の画面の全画面平均輝度とを比較するので、画面の一部のラインがフラッシュの発光によって高輝度となっている場合には、高輝度となっている全てのラインで差分値が閾値以上となる。仮に現在の画面内で隣接するラインのライン平均輝度を比較した場合には、正常なラインと高輝度となったラインの境界のみしか差分値が閾値以上とならない。従って、本実施形態においては、画面内で画像の明るさが不連続となったことを誤検出少なく検出することが可能である。   The flash detection unit 2 compares the line average brightness of each line on the current screen with, for example, the screen average brightness of the past screen which is the previous screen, so that some lines of the screen are flashed. When the luminance is high due to light emission, the difference value is equal to or greater than the threshold value for all lines having high luminance. If the average line brightness of adjacent lines in the current screen is compared, the difference value is equal to or greater than the threshold value only at the boundary between the normal line and the line with high brightness. Therefore, in the present embodiment, it is possible to detect that the brightness of the image is discontinuous on the screen with few false detections.

画像信号処理部3は、撮像部1から供給された電気信号を所定の信号方式に変換する。上記のように第1実施形態においては、電気信号はR,G,B信号であるため、ホワイトバランスやゲインを調整し、ガンマ処理等を行った後に、輝度信号Yと色差信号Cb,Crに変換する。フラッシュ検出部2は、輝度信号Yに基づいてライン平均輝度及び全画面平均輝度を算出してもよい。バッファメモリ(保持部)4は、画像信号処理部3より出力された輝度信号Yと色差信号Cb,Crの画像データを一時的に保持する。色差信号Cb,Crを帯域制限して輝度信号Yと時間軸多重すれば、画像処理に必要なメモリや演算リソースを少なくすることができる。 The image signal processing unit 3 converts the electrical signal supplied from the imaging unit 1 into a predetermined signal system. Oite the first embodiment as described above, electrical signals R, G, since a B signal, and adjust the white balance and gain, after the gamma processing and the like, the luminance signal Y and color difference signals Cb, Convert to Cr. The flash detection unit 2 may calculate the line average luminance and the full screen average luminance based on the luminance signal Y. The buffer memory (holding unit) 4 temporarily holds the image data of the luminance signal Y and the color difference signals Cb and Cr output from the image signal processing unit 3. If the color difference signals Cb and Cr are band-limited and the luminance signal Y is time-axis multiplexed, memory and calculation resources necessary for image processing can be reduced.

フラッシュの発光が検出された場合には、画像信号処理部3からバッファメモリ4へと入力されて保持された画像データが後述するフラッシュ補正部8による画像データの補正処理の際に用いられる。   When the flash emission is detected, the image data input from the image signal processing unit 3 to the buffer memory 4 and held therein is used in the image data correction processing by the flash correction unit 8 described later.

圧縮伸張処理部5は、バッファメモリ4より読み出した画像データをMPEG-2,MPEG-4 AVC/H.264,JPEG等の圧縮方式によって圧縮処理して符号化データを生成するとともに、記録再生部11に記録された符号化データを再生して読み出した場合に符号化データを伸張処理する。   The compression / decompression processing unit 5 compresses the image data read from the buffer memory 4 by a compression method such as MPEG-2, MPEG-4 AVC / H.264, JPEG, etc. to generate encoded data, and also records and reproduces the data. When the encoded data recorded in 11 is reproduced and read, the encoded data is decompressed.

出力信号処理部6は、バッファメモリ4より読み出した画像データを外部機器(図示せず)に出力するとともに、後段の表示部7の入力フォーマットに合わせて例えばNTSC信号方式に変換し、表示部7の表示画面の大きさに合わせて画像データのサイズを変更する。これによって、画像データは表示部7に表示可能なデータとなり、表示部7に供給されて表示される。出力信号処理部6には制御部9から出力されたオンスクリーン信号も入力され、出力信号処理部6はオンスクリーン信号を画像データに重畳する。   The output signal processing unit 6 outputs the image data read from the buffer memory 4 to an external device (not shown) and converts it to, for example, the NTSC signal system in accordance with the input format of the display unit 7 at the subsequent stage. The size of the image data is changed according to the size of the display screen. As a result, the image data becomes data that can be displayed on the display unit 7 and is supplied to the display unit 7 for display. The on-screen signal output from the control unit 9 is also input to the output signal processing unit 6, and the output signal processing unit 6 superimposes the on-screen signal on the image data.

フラッシュ補正部8には、フラッシュ判定部26より出力された検出信号が入力される。フラッシュ補正部8は、補正制御部81と補正処理部82とを有する。フラッシュ補正部8は、制御部9による制御に従って、フラッシュの発光によって明るさが不連続となった画像データを補正する。フラッシュ検出部2がフラッシュの発光を検出した場合には、補正制御部81にはフラッシュが発光したことを示す検出信号(“1”)と、フラッシュ発光の最初のライン番号及びフラッシュ発光終了後の最初のライン番号を示すデータとが入力される。フラッシュ発光終了後の最初のライン番号を示すデータの代わりに、フラッシュ発光の最終のライン番号を示すデータを入力してもよい。フラッシュ検出部2がフラッシュの発光を検出しなかった場合には、補正制御部81にはフラッシュが発光しなかったことを示す検出信号(“0”)が入力される。   The detection signal output from the flash determination unit 26 is input to the flash correction unit 8. The flash correction unit 8 includes a correction control unit 81 and a correction processing unit 82. The flash correction unit 8 corrects image data whose brightness has become discontinuous due to flash emission under the control of the control unit 9. When the flash detection unit 2 detects the flash emission, the correction control unit 81 detects the flash emission signal (“1”), the first line number of the flash emission, and after the flash emission ends. Data indicating the first line number is input. Instead of data indicating the first line number after the end of flash emission, data indicating the last line number of flash emission may be input. When the flash detection unit 2 does not detect the flash emission, the correction control unit 81 receives a detection signal (“0”) indicating that the flash did not emit.

制御部9には、後述する低遅延モードと画面単位切換モードとのいずれかが設定されている。フラッシュ検出部2及びフラッシュ補正部8は、制御部9に設定されているモードの情報を参照する。補正制御部81は、補正処理部82が制御部9に設定されているモードに応じた補正処理動作を実行するよう補正処理部82を制御する。なお、画面単位切換モードは必須ではなく、必要に応じて低遅延モードと画面単位切換モードとを選択するようにすればよい。   The control unit 9 is set with either a low delay mode or a screen unit switching mode, which will be described later. The flash detection unit 2 and the flash correction unit 8 refer to the mode information set in the control unit 9. The correction control unit 81 controls the correction processing unit 82 so that the correction processing unit 82 executes a correction processing operation corresponding to the mode set in the control unit 9. Note that the screen unit switching mode is not essential, and the low delay mode and the screen unit switching mode may be selected as necessary.

まず、フラッシュ検出部2がフラッシュの発光を検出しなかった場合の補正処理部82の動作について説明する。低遅延モードに設定されている場合、補正処理部82は、画像信号処理部3より出力されて補正処理部82へと入力された画像データをそのままバッファメモリ4へと供給する。バッファメモリ4から読み出された画像データは、圧縮伸張処理部5及び出力信号処理部6へと供給されて、上述した圧縮伸張処理部5と出力信号処理部6とにおけるそれぞれの処理が行われる。   First, the operation of the correction processing unit 82 when the flash detection unit 2 does not detect the flash emission will be described. When the low delay mode is set, the correction processing unit 82 supplies the image data output from the image signal processing unit 3 and input to the correction processing unit 82 to the buffer memory 4 as it is. The image data read from the buffer memory 4 is supplied to the compression / decompression processing unit 5 and the output signal processing unit 6, and the respective processes in the compression / decompression processing unit 5 and the output signal processing unit 6 are performed. .

画面単位切換モードに設定されている場合、補正処理部82には、画像信号処理部3からバッファメモリ4へと入力されて読み出された1画面遅延の画像データが入力され、補正処理部82は、入力された1画面遅延の画像データをそのままバッファメモリ4へと供給する。同様に、バッファメモリ4から読み出された画像データは、圧縮伸張処理部5及び出力信号処理部6へと供給されて、上述した圧縮伸張処理部5と出力信号処理部6とにおけるそれぞれの処理が行われる。   When the screen unit switching mode is set, the correction processing unit 82 is inputted with the image data of one-screen delay input and read from the image signal processing unit 3 to the buffer memory 4, and the correction processing unit 82. Supplies the input image data with one screen delay to the buffer memory 4 as it is. Similarly, the image data read from the buffer memory 4 is supplied to the compression / decompression processing unit 5 and the output signal processing unit 6, and the respective processes in the compression / decompression processing unit 5 and the output signal processing unit 6 described above. Is done.

次に、フラッシュ検出部2がフラッシュの発光を検出した場合の補正処理部82の動作について説明する。低遅延モードに設定されている場合、補正処理部82は、画像信号処理部3からバッファメモリ4へと入力された1画面遅延の画像データを読み出す。補正処理部82は、画像信号処理部3より出力されて補正処理部82へと入力された画像データにおけるフラッシュの発光によって明るさが不連続となった複数のラインを、バッファメモリ4から読み出した1画面遅延の画像データにおける対応する複数のラインに置換することによって画像データを補正する。補正処理部82によって補正された画像データは、同様に、バッファメモリ4を介して圧縮伸張処理部5及び出力信号処理部6へと供給される。   Next, the operation of the correction processing unit 82 when the flash detection unit 2 detects the flash emission will be described. When the low delay mode is set, the correction processing unit 82 reads the image data with one screen delay input from the image signal processing unit 3 to the buffer memory 4. The correction processing unit 82 reads, from the buffer memory 4, a plurality of lines whose brightness is discontinuous due to flash emission in the image data output from the image signal processing unit 3 and input to the correction processing unit 82. The image data is corrected by replacing with a plurality of corresponding lines in the image data with one screen delay. Similarly, the image data corrected by the correction processing unit 82 is supplied to the compression / decompression processing unit 5 and the output signal processing unit 6 via the buffer memory 4.

バッファメモリ4によって画像信号処理部3より出力された画像データを2画面分遅延させて、補正処理部82へと入力された画像データにおけるフラッシュの発光によって明るさが不連続となった複数のラインを、2画面遅延の画像データにおける対応する複数のラインに置換してもよい。   A plurality of lines in which the image data output from the image signal processing unit 3 by the buffer memory 4 is delayed by two screens and the brightness becomes discontinuous due to flash emission in the image data input to the correction processing unit 82. May be replaced with a plurality of corresponding lines in the image data with two screen delays.

画面単位切換モードに設定されている場合、補正処理部82は、入力された1画面遅延の画像データにおけるフラッシュの発光によって明るさが不連続となった複数のラインを含む画面を過去の画面に置換することによって画像データを補正する。補正処理部82によって補正された画像データは、同様に、バッファメモリ4を介して圧縮伸張処理部5及び出力信号処理部6へと供給される。   When the screen unit switching mode is set, the correction processing unit 82 converts a screen including a plurality of lines whose brightness becomes discontinuous due to flash emission in the input one-screen delay image data to a past screen. The image data is corrected by the replacement. Similarly, the image data corrected by the correction processing unit 82 is supplied to the compression / decompression processing unit 5 and the output signal processing unit 6 via the buffer memory 4.

画面単位切換モードを設ける場合には、バッファメモリ4は、画像信号処理部3より出力された画像データを少なくとも2画面分、保持する必要がある。フラッシュの発光のタイミングによっては、3画面の期間分過去の画面が必要となる。なお、第1実施形態では、バッファメモリ4は画像データを3画面分、保持することとする。低遅延モードのみとする場合には、バッファメモリ4は画像データを少なくとも1画面分、保持すればよい。   When the screen unit switching mode is provided, the buffer memory 4 needs to hold the image data output from the image signal processing unit 3 for at least two screens. Depending on the timing of flash emission, a past screen is required for a period of three screens. In the first embodiment, the buffer memory 4 holds image data for three screens. When only the low delay mode is set, the buffer memory 4 may hold at least one screen of image data.

制御部9は、CPUを有するマイクロコンピュータによって構成することができる。制御部9はビデオカメラ101の全体を制御する制御プログラムを記憶した記憶部を有し、制御プログラムに基づいてビデオカメラ101の全体を制御する。第1実施形態による画像処理を画像処理プログラムによって実現する場合には、制御プログラムの一部として第1実施形態の画像処理を実行させる画像処理プログラムを含むようにすればよい。この場合、制御部9は画像処理プログラムを実行させてフラッシュの発光を検出し、フラッシュが発光した場合に画像データを補正する。   The control unit 9 can be configured by a microcomputer having a CPU. The control unit 9 has a storage unit that stores a control program for controlling the entire video camera 101, and controls the entire video camera 101 based on the control program. When the image processing according to the first embodiment is realized by an image processing program, an image processing program for executing the image processing according to the first embodiment may be included as a part of the control program. In this case, the control unit 9 executes the image processing program to detect flash emission, and corrects the image data when the flash emits light.

制御部9には、制御部9の作業用メモリとしてのメモリ10が接続されている。また、制御部9には、記録再生部11と操作スイッチ12とが接続されている。制御部9は操作スイッチ12によって撮像した動画像を記録する指示がなされたら、圧縮伸張処理部5より出力された符号化データを記録再生部11に記録するよう制御する。また、制御部9は操作スイッチ12によって撮像した動画像を記録する指示がなされたら、記録再生部11に符号化データを再生させて読み出し、圧縮伸張処理部5へと供給するよう制御する。制御部9は、操作スイッチ12による操作に従ってオンスクリーン信号を発生して、出力信号処理部6へと供給する。   A memory 10 as a working memory of the control unit 9 is connected to the control unit 9. In addition, a recording / reproducing unit 11 and an operation switch 12 are connected to the control unit 9. When the control unit 9 is instructed to record the moving image captured by the operation switch 12, the control unit 9 controls to record the encoded data output from the compression / decompression processing unit 5 in the recording / reproducing unit 11. Further, when an instruction to record a moving image captured by the operation switch 12 is given, the control unit 9 controls the recording / reproducing unit 11 to reproduce and read out the encoded data and supply it to the compression / decompression processing unit 5. The control unit 9 generates an on-screen signal according to an operation by the operation switch 12 and supplies it to the output signal processing unit 6.

図1では、フラッシュ検出部2をハードウェアにて構成した例を示しているが、ソフトウェアによって構成してもよい。即ち、第1実施形態の画像処理プログラムの一部であるフラッシュ検出プログラムを実行させることによって、フラッシュ検出部2と同等の構成を実現してもよい。また、フラッシュ補正部8もソフトウェアによって構成してもよい。即ち、第1実施形態の画像処理プログラムの一部であるフラッシュ補正プログラムを実行させることによって、フラッシュ補正部8と同等の構成を実現してもよい。   Although FIG. 1 shows an example in which the flash detection unit 2 is configured by hardware, it may be configured by software. That is, a configuration equivalent to the flash detection unit 2 may be realized by executing a flash detection program that is a part of the image processing program of the first embodiment. The flash correction unit 8 may also be configured by software. That is, a configuration equivalent to the flash correction unit 8 may be realized by executing a flash correction program that is a part of the image processing program of the first embodiment.

ここで、図2を用いて、動画像の撮影時に撮影者以外の他者のフラッシュが発光した場合に発生する画像の明るさが不連続となる現象について説明する。ローリングシャッタ方式を採用するCMOSセンサ1sはラインLn単位で撮像した画素データを読み出していくので、撮像部1による被写体の撮像ST1,ST2,ST3,ST4…は、図2の(b)に示すように、画面の最初のラインLnから最後のラインLnまでタイミングが時間方向に順次ずれていく。1つのラインLnの撮像は、図2の(a)に示すように、露光時間と画素データの読み出し時間とを含む。   Here, with reference to FIG. 2, a phenomenon in which the brightness of the image that occurs when the flash of another person other than the photographer emits light when shooting a moving image is discontinuous will be described. Since the CMOS sensor 1s adopting the rolling shutter system reads out pixel data imaged in units of line Ln, subject imaging ST1, ST2, ST3, ST4... By the imaging unit 1 is as shown in FIG. In addition, the timing sequentially shifts in the time direction from the first line Ln to the last line Ln. The imaging of one line Ln includes an exposure time and a pixel data readout time, as shown in FIG.

撮像部1による撮像ST1,ST2,ST3,ST4…によって、撮像部1からは図2の(c)に示すように、有効データD1,D2,D3,D4…が出力される。時刻t1にて他者のフラッシュによる発光FLがあり、CMOSセンサ1sに入射したとする。この場合、撮像ST2の一点鎖線で示す位置から最後のラインLnまでの各ラインLnと、撮像ST3の最初のラインLnから一点鎖線で示す位置までの各ラインLnは発光FLによる影響を受けることになる。   As shown in (c) of FIG. 2, the effective data D1, D2, D3, D4... Are output from the imaging unit 1 by the imaging ST1, ST2, ST3, ST4. It is assumed that there is a light emission FL caused by another person's flash at time t1 and enters the CMOS sensor 1s. In this case, each line Ln from the position indicated by the alternate long and short dash line to the last line Ln and each line Ln from the first line Ln to the position indicated by the alternate long and short dash line of the imaging ST3 are affected by the light emission FL. Become.

第1実施形態による画像データの補正を行わないとすると、表示部7に表示される画像(記録再生部11に記録される画像)Im1,Im2,Im3,Im4…は図2の(d)に示すようになる。画像Im1,Im4は発光FLによる影響を受けておらず、画面の明るさが連続して正常な画像である。画像Im2は、一点鎖線以降の下端部で白帯状に明るくなっており、画像の明るさが不連続となった正常でない画像である。ハッチングを付した部分が高輝度の部分を示す。画像Im3は、上端から一点鎖線までの上端部で同様に白帯状に明るくなっており、画像の明るさが不連続となった正常でない画像である。   If the image data correction according to the first embodiment is not performed, images displayed on the display unit 7 (images recorded on the recording / reproducing unit 11) Im1, Im2, Im3, Im4,... Are shown in FIG. As shown. The images Im1 and Im4 are not affected by the light emission FL, and the screen brightness is normal continuously. The image Im2 is an abnormal image in which the lower end portion after the one-dot chain line is brightened in a white band shape, and the brightness of the image is discontinuous. A hatched portion indicates a portion with high luminance. The image Im3 is an abnormal image in which the upper end portion from the upper end to the alternate long and short dash line is similarly brightened in a white band shape, and the brightness of the image becomes discontinuous.

なお、撮影者が所有するビデオカメラ101のフラッシュを発光させる場合には、フラッシュの発光のタイミングを図2の(b)に示す撮像のタイミングと合わせるので、図2の(d)に示すような画像の明るさが不連続となる現象は発生しない。   Note that when the flash of the video camera 101 owned by the photographer is emitted, the flash emission timing is matched with the imaging timing shown in FIG. 2B, and as shown in FIG. The phenomenon that the brightness of the image becomes discontinuous does not occur.

図3,図4を用いて、第1実施形態によるビデオカメラ101の動作についてさらに詳細に説明する。図3は、ビデオカメラ101による撮影及び記録処理の全体的な流れを示している。図3において、制御部9は、ステップS1にて、操作スイッチ12による撮影開始の指示があったか否かを判定する。撮影開始の指示があったと判定されれば(YES)、制御部9は、ステップS2にて、絞り及びシャッタースピード等の条件に合わせて撮像部1を制御して撮影を開始させる。なお、操作スイッチ12によるビデオカメラ101の電源投入の指示を撮影開始の指示としてもよい。撮影開始の指示があったと判定されなければ(NO)、制御部9は処理をステップS1に戻してステップS1を繰り返す。   The operation of the video camera 101 according to the first embodiment will be described in more detail with reference to FIGS. FIG. 3 shows the overall flow of shooting and recording processing by the video camera 101. In FIG. 3, the control unit 9 determines whether or not there is an instruction to start shooting with the operation switch 12 in step S <b> 1. If it is determined that there is an instruction to start shooting (YES), the control unit 9 starts shooting by controlling the imaging unit 1 in accordance with conditions such as an aperture and a shutter speed in step S2. Note that an instruction to turn on the video camera 101 by the operation switch 12 may be an instruction to start shooting. If it is not determined that there is an instruction to start shooting (NO), the control unit 9 returns the process to step S1 and repeats step S1.

制御部9は、ステップS3にて、フラッシュ検出部2によるフラッシュ検出処理及びフラッシュ補正部8によるフラッシュ補正処理を実行させる。また、制御部9は、ステップS3と並行して、ステップS4にて、画像信号処理部3による画像信号処理を実行させる。ステップS3のフラッシュ検出・補正処理の詳細については後述する。制御部9は、ステップS5にて、出力信号処理部6を制御して表示部7に撮影した画像を表示させる。   In step S <b> 3, the control unit 9 causes the flash detection process by the flash detection unit 2 and the flash correction process by the flash correction unit 8 to be executed. The control unit 9 causes the image signal processing unit 3 to execute image signal processing in step S4 in parallel with step S3. Details of the flash detection / correction processing in step S3 will be described later. In step S5, the control unit 9 controls the output signal processing unit 6 to display the captured image on the display unit 7.

制御部9は、ステップS6にて、操作スイッチ12による記録開始の指示があったか否かを判定する。記録開始の指示があったと判定されれば(YES)、制御部9は、ステップS7にて、圧縮伸張処理部5より出力された符号化データを記録再生部11に記録させる。記録開始の指示があったと判定されなければ(NO)、制御部9は、処理をステップS10に移行させる。   In step S <b> 6, the control unit 9 determines whether or not there is an instruction to start recording by the operation switch 12. If it is determined that there is an instruction to start recording (YES), the control unit 9 causes the recording / reproducing unit 11 to record the encoded data output from the compression / decompression processing unit 5 in step S7. If it is not determined that there is an instruction to start recording (NO), the control unit 9 shifts the process to step S10.

制御部9は、ステップS8にて、記録終了の指示があったか否かを判定する。記録終了の指示があったと判定されれば(YES)、制御部9は、ステップS9にて、記録再生部11への記録を停止させる。記録終了の指示があったと判定されなければ(NO)、制御部9は処理をステップS7に戻してステップS7を繰り返す。そして、制御部9は、ステップS10にて、操作スイッチ12による撮影終了の指示があったか否かを判定する。撮影終了の指示があったと判定されれば(YES)、制御部9は処理を終了させる。撮影終了の指示があったと判定されなければ(NO)、制御部9は、処理をステップS2に戻してステップS2以降を繰り返す。操作スイッチ12によるビデオカメラ101の電源切断の指示を撮影終了の指示としてもよい。   In step S8, the controller 9 determines whether or not there is an instruction to end recording. If it is determined that there is an instruction to end recording (YES), the control unit 9 stops recording in the recording / reproducing unit 11 in step S9. If it is not determined that there is an instruction to end recording (NO), the control unit 9 returns the process to step S7 and repeats step S7. Then, in step S10, the control unit 9 determines whether or not there has been an instruction to end shooting using the operation switch 12. If it is determined that there is an instruction to end shooting (YES), the control unit 9 ends the process. If it is not determined that there is an instruction to end shooting (NO), the control unit 9 returns the process to step S2 and repeats step S2 and subsequent steps. An instruction to turn off the power of the video camera 101 by the operation switch 12 may be used as an instruction to end shooting.

図4を用いて、図3に示すステップS3のフラッシュ検出・補正処理の詳細について説明する。以下の各ステップは、制御部9による制御に基づいてフラッシュ検出部2及びフラッシュ補正部8によって実行される。第1実施形態におけるステップS3をステップS3とする。 Details of the flash detection / correction processing in step S3 shown in FIG. 3 will be described with reference to FIG. The following steps are executed by the flash detection unit 2 and the flash correction unit 8 based on control by the control unit 9. Step S3 in the first embodiment and step S3 1.

図4において、フラッシュ検出部2は、ステップS301にて、有効ラインにおける有効画素の画素値を加算する処理を有効ラインごとに順次実行する。有効ラインとは垂直ブランキング期間を除く期間のラインであり、有効画素とは水平ブランキング期間を除く期間の画素である。フラッシュ検出部2は、ステップS302にて、ステップS301にて得た画素値の加算値を有効画素数で除算してライン平均輝度を算出し、ライン平均輝度を保持する。   In FIG. 4, in step S301, the flash detection unit 2 sequentially executes a process of adding pixel values of effective pixels in the effective line for each effective line. An effective line is a line in a period excluding a vertical blanking period, and an effective pixel is a pixel in a period excluding a horizontal blanking period. In step S302, the flash detection unit 2 calculates the line average luminance by dividing the addition value of the pixel values obtained in step S301 by the number of effective pixels, and holds the line average luminance.

フラッシュ検出部2は、ステップS303にて、ライン平均輝度を順次加算する処理を実行する。フラッシュ検出部2は、ステップS304にて、ステップS302で算出したライン平均輝度と1画面前の全画面平均輝度との差分演算処理を実行する。ステップS304における差分演算処理は、ステップS302でライン平均輝度を算出するたびに実行される。フラッシュ検出部2は、ステップS305にて、差分値が閾値以上のラインを検出したか否かを判定する。この際の閾値は、好ましくは被写体の状況によって変化させるべきであるが、実験によって最適な値を求めて設定すればよい。他者のフラッシュの発光によって明るさが大きく変化した状態を検出するため、閾値は、入力されたG信号のダイナミックレンジよりも十分に大きい値とすることが好ましい。なお、閾値を小さくするほど、フラッシュ発光の検出感度を高めることができる。   In step S303, the flash detection unit 2 executes a process of sequentially adding the line average luminance. In step S304, the flash detection unit 2 executes a difference calculation process between the line average luminance calculated in step S302 and the entire screen average luminance of the previous screen. The difference calculation process in step S304 is executed every time the line average luminance is calculated in step S302. In step S305, the flash detection unit 2 determines whether a line having a difference value equal to or greater than a threshold value is detected. The threshold value at this time should preferably be changed according to the condition of the subject, but an optimum value may be obtained by experiment and set. In order to detect a state in which the brightness is greatly changed by the light emission of another person's flash, the threshold value is preferably set to a value sufficiently larger than the dynamic range of the input G signal. In addition, the detection sensitivity of flash emission can be increased as the threshold value is decreased.

差分値が閾値以上のラインを検出したと判定されれば(YES)、フラッシュ検出部2は、処理をステップS306に移行させる。なお、この際、フラッシュ検出部2は、検出したラインがフレームの最初のラインから何ライン目かを示す検出ライン情報を記憶しておく。記憶する検出ライン情報はラインが連続して検出される場合は最初の1ライン目のみでよい。一方、差分値が閾値以上のラインを検出したと判定されなければ(NO)、フラッシュ検出部2は、既に検出ライン情報を記憶している場合は、それを消去するとともに、処理をステップS314に移行させる。差分値が閾値以上のラインを検出しなければ、フラッシュは発光していないということである。   If it is determined that a line having a difference value equal to or greater than the threshold value is detected (YES), the flash detection unit 2 shifts the process to step S306. At this time, the flash detection unit 2 stores detected line information indicating the number of detected lines from the first line of the frame. The detected line information to be stored may be only the first line when the lines are continuously detected. On the other hand, if it is not determined that a line having a difference value equal to or greater than the threshold value has been detected (NO), the flash detection unit 2 deletes the detected line information if already stored, and the process proceeds to step S314. Transition. If no line with a difference value equal to or greater than the threshold value is detected, the flash is not emitting light.

フラッシュ検出部2は、ステップS306にて、差分値が閾値以上である状態が所定ライン数以上継続したか否かを判定する。所定ライン数以上継続したと判定されれば(YES)、フラッシュ検出部2は、処理をステップS307に移行させ、所定ライン数以上継続したと判定されなければ(NO)、フラッシュ検出部2は、処理をステップS314に移行させる。   In step S306, the flash detection unit 2 determines whether or not the state where the difference value is equal to or greater than the threshold value continues for a predetermined number of lines or more. If it is determined that the predetermined number of lines or more have been continued (YES), the flash detecting unit 2 shifts the process to step S307. If it is not determined that the predetermined number of lines or more has been continued (NO), the flash detecting unit 2 The process proceeds to step S314.

ステップS306を設けることによって、ステップS305での閾値を小さくしたとしても誤検出を防止することができる。ステップS306でのライン数も実験によって最適な値を求めて設定すればよい。差分値が閾値以上のラインを検出したとしても、差分値が閾値以上である状態が所定ライン数以上継続しなかった場合は、フラッシュは発光していないと判断することができる。   By providing step S306, erroneous detection can be prevented even if the threshold value in step S305 is reduced. The number of lines in step S306 may be set by obtaining an optimum value by experiment. Even if a line having a difference value equal to or greater than the threshold value is detected, if the state where the difference value is equal to or greater than the threshold value has not continued for a predetermined number of lines, it can be determined that the flash is not emitting light.

ステップS306にて所定ライン数以上継続したと判定された場合には、フラッシュが発光したということである。そこで、フラッシュ検出部2は、ステップS307にて、フラッシュが発光していないことを示す検出信号“0”からフラッシュが発光したことを示す検出信号“1”へと切り換え、この切り換えた検出信号と、記憶している検出ライン情報とをフラッシュ補正部8に供給するとともに、検出ライン情報を消去する。フラッシュ検出部2及びフラッシュ補正部8は、ステップS308にて、設定されているモードが低遅延モードであるか否かを判定する。低遅延モードであると判定されれば(YES)、フラッシュ補正部8は、処理をステップS309に移行させる。低遅延モードであると判定されなければ(NO)、フラッシュ検出部2は、処理をステップS316に移行させる。   If it is determined in step S306 that the predetermined number of lines or more have been continued, this means that the flash has been emitted. In step S307, the flash detection unit 2 switches from the detection signal “0” indicating that the flash is not emitting to the detection signal “1” indicating that the flash is emitted, The stored detection line information is supplied to the flash correction unit 8 and the detection line information is erased. In step S308, the flash detection unit 2 and the flash correction unit 8 determine whether or not the set mode is the low delay mode. If it is determined that the mode is the low delay mode (YES), the flash correction unit 8 shifts the processing to step S309. If it is not determined that the mode is the low delay mode (NO), the flash detection unit 2 shifts the process to step S316.

フラッシュ補正部8は、ステップS309にて、供給された検出ライン情報が示す、1画面前のラインへの置換を開始する。フラッシュ検出部2は、ステップS310にて、差分値が閾値未満のラインを検出したか否かを判定する。差分値が閾値未満のラインを検出したと判定されれば(YES)、フラッシュ検出部2は、処理をステップS311に移行させる。なお、この際、フラッシュ検出部2は、検出したラインがフレームの最初のラインから何ライン目かを示す検出ライン情報を記憶しておく。記憶する検出ライン情報はラインが連続して検出される場合は最初の1ライン目のみでよい。一方、差分値が閾値未満のラインを検出したと判定されなければ(NO)、フラッシュ検出部2は、記憶していた検出ライン情報を消去するとともに、処理をステップS314に移行させる。   In step S309, the flash correction unit 8 starts replacement with the previous line indicated by the supplied detection line information. In step S310, the flash detection unit 2 determines whether a line having a difference value less than the threshold value is detected. If it is determined that a line having a difference value less than the threshold value is detected (YES), the flash detection unit 2 shifts the process to step S311. At this time, the flash detection unit 2 stores detected line information indicating the number of detected lines from the first line of the frame. The detected line information to be stored may be only the first line when the lines are continuously detected. On the other hand, if it is not determined that a line having a difference value less than the threshold value has been detected (NO), the flash detection unit 2 deletes the stored detection line information and shifts the process to step S314.

フラッシュ検出部2は、ステップS311にて、差分値が閾値未満である状態が所定ライン数以上継続したか否かを判定する。所定ライン数以上継続したと判定されれば(YES)、フラッシュ検出部2は、処理をステップS312に移行させ、所定ライン数以上継続したと判定されなければ(NO)、フラッシュ検出部2は、処理をステップS314に移行させる。   In step S311, the flash detection unit 2 determines whether or not the state where the difference value is less than the threshold value continues for a predetermined number of lines or more. If it is determined that the predetermined number of lines or more have been continued (YES), the flash detection unit 2 shifts the process to step S312. If it is not determined that the predetermined number of lines or more has been continued (NO), the flash detection unit 2 The process proceeds to step S314.

ステップS311を設けることによって、ステップS310での閾値を小さくしたとしても誤検出を防止することができる。ステップS305での閾値とステップS310での閾値は同じ値である。ステップS311でのライン数も実験によって最適な値を求めて設定すればよい。ステップS306での所定ライン数とステップS311での所定ライン数とは同じでよい。差分値が閾値未満のラインを検出したとしても、差分値が閾値未満である状態が所定ライン数以上継続しなかった場合は、フラッシュの発光は終了していないと判断することができる。   By providing step S311, erroneous detection can be prevented even if the threshold value in step S310 is reduced. The threshold value in step S305 and the threshold value in step S310 are the same value. The number of lines in step S311 may be set by obtaining an optimum value by experiment. The predetermined number of lines in step S306 and the predetermined number of lines in step S311 may be the same. Even if a line having a difference value less than the threshold value is detected, if the state where the difference value is less than the threshold value does not continue for a predetermined number of lines or more, it can be determined that the flash emission has not ended.

フラッシュ検出部2は、ステップS312にて、検出信号“1”を検出信号“0”へと切り換え、この切り換えた検出信号と、記憶している検出ライン情報とをフラッシュ補正部8に供給するとともに検出ライン情報を消去する。フラッシュ補正部8は、ステップS313にて、供給された検出ライン情報が示す、1画面前のラインへの置換を終了し、フラッシュ検出部2は、処理をステップS314に移行させる。フラッシュ検出部2は、ステップS314にて、全有効ラインに対する判定が終了したか否かを判定する。全有効ラインに対する判定が終了したと判定されれば(YES)、フラッシュ検出部2は、処理をステップS315に移行させ、全有効ラインが終了したと判定されなければ(NO)、フラッシュ検出部2は、処理をステップS301に戻してステップS301以降を繰り返す。   In step S312, the flash detection unit 2 switches the detection signal “1” to the detection signal “0”, and supplies the switched detection signal and the stored detection line information to the flash correction unit 8. Delete detection line information. In step S313, the flash correction unit 8 ends the replacement with the previous line indicated by the supplied detection line information, and the flash detection unit 2 moves the process to step S314. In step S314, the flash detection unit 2 determines whether the determination for all active lines has been completed. If it is determined that the determination for all the effective lines is completed (YES), the flash detection unit 2 shifts the process to step S315, and if it is not determined that all the effective lines are completed (NO), the flash detection unit 2 Returns the process to step S301 and repeats step S301 and subsequent steps.

フラッシュ検出部2は、ステップS315にて、ライン平均輝度の加算値を有効ライン数で除算して全画面平均輝度を算出し、全画面平均輝度を保持して、図3のステップS5へと移行させる。   In step S315, the flash detection unit 2 calculates the total screen average brightness by dividing the added value of the line average brightness by the number of effective lines, holds the total screen average brightness, and proceeds to step S5 in FIG. Let

一方、ステップS308にて低遅延モードであると判定されなかった(即ち、画面単位切換モードであると判定された)場合、フラッシュ検出部2は、ステップS316にて、全有効ラインに対する判定が終了したか否かを判定する。全有効ラインに対する判定が終了したと判定されなければ(NO)、フラッシュ検出部2は、ステップS316の処理を繰り返す。全有効ラインに対する判定が終了したと判定されれば(YES)、フラッシュ検出部2は、ステップS317にて、ライン平均輝度の加算値を有効ライン数で除算して全画面平均輝度を算出し、全画面平均輝度を保持する。   On the other hand, if it is not determined in step S308 that the mode is the low delay mode (that is, it is determined that the screen unit switching mode is selected), the flash detection unit 2 ends the determination for all the effective lines in step S316. Determine whether or not. If it is not determined that the determination for all active lines is completed (NO), the flash detection unit 2 repeats the process of step S316. If it is determined that the determination for all the effective lines is completed (YES), in step S317, the flash detection unit 2 calculates the total screen average luminance by dividing the added value of the line average luminance by the number of effective lines. Holds the full screen average brightness.

フラッシュ補正部8は、ステップS318にて、次の画面に移行したか否かを判定する。次の画面に移行したか否かの情報は、フラッシュ検出部2または制御部9からフラッシュ補正部8へと供給すればよい。次の画面に移行したと判定されなければ(NO)、フラッシュ補正部8は、ステップS318の処理を繰り返す。次の画面に移行したと判定されれば(YES)、フラッシュ補正部8は、ステップS319にて、フラッシュの発光が検出された現在の画面を過去の正常画面に置換して、図3のステップS5へと移行させる。   In step S318, the flash correction unit 8 determines whether or not the screen has shifted to the next screen. Information on whether or not the screen has shifted to the next screen may be supplied from the flash detection unit 2 or the control unit 9 to the flash correction unit 8. If it is not determined that the screen has shifted to the next screen (NO), the flash correction unit 8 repeats the process of step S318. If it is determined that the screen has shifted to the next screen (YES), in step S319, the flash correction unit 8 replaces the current screen in which flash emission has been detected with a past normal screen, and the step of FIG. The process proceeds to S5.

ところで、図4に示すフローチャートにおいては、ステップS305で用いる閾値とステップS310で用いる閾値とを同じ値としているが、ステップS305で用いる閾値と、ステップS310で用いる閾値とを異なる値としてもよい。   In the flowchart shown in FIG. 4, the threshold used in step S305 and the threshold used in step S310 are the same value, but the threshold used in step S305 and the threshold used in step S310 may be different.

ステップS305で用いる閾値とステップS310で用いる閾値とを異なる値とした場合、フラッシュ検出部2は、次のように動作することになる。フラッシュ検出部2は、ライン平均輝度と全画面平均輝度との差分値が第1の閾値以上であるラインに基づいて、フラッシュの発光によって高輝度となっている複数のラインの開始ラインを決定する。但し、図4においては、開始ラインは、ステップS306にて差分値が第1の閾値以上である状態が所定ライン数以上継続したと判定された場合に決定することになる。   When the threshold used in step S305 and the threshold used in step S310 are different values, the flash detection unit 2 operates as follows. The flash detection unit 2 determines start lines of a plurality of lines that have high brightness due to flash emission based on a line whose difference value between the line average brightness and the full screen average brightness is equal to or greater than the first threshold. . However, in FIG. 4, the start line is determined when it is determined in step S306 that the state where the difference value is equal to or greater than the first threshold value has continued for a predetermined number of lines or more.

フラッシュ検出部2は、ライン平均輝度と全画面平均輝度との差分値が、第1の閾値より小さい値である第2の閾値未満であるラインに基づいて、フラッシュの発光によって高輝度となっている複数のラインの終了ラインを決定する。差分値が第2の閾値未満となったラインの1つ前のラインが終了ラインとなる。但し、図4においては、終了ラインは、ステップS311にて差分値が第2の閾値未満である状態が所定ライン数以上継続したと判定された場合に決定することになる。   The flash detection unit 2 has high luminance due to flash emission based on a line in which a difference value between the line average luminance and the entire screen average luminance is less than a second threshold that is a value smaller than the first threshold. Determine the end line of multiple lines. The line immediately before the line whose difference value is less than the second threshold is the end line. However, in FIG. 4, the end line is determined when it is determined in step S311 that the state where the difference value is less than the second threshold value continues for a predetermined number of lines or more.

図5において、(a)は、画面内の垂直位置と差分値との関係の一例を示している。横軸の垂直位置は、0が画面上端部である。画像データは、フラッシュの発光がなければ図5の(a)に示すような特性を有するとする。図5の(a)に示す特性では、画面の下端部近傍において差分値が低下している。図5の(b)に示すように、画面の垂直方向中央部においてフラッシュの発光があったとすると、差分値は急上昇する。   5A shows an example of the relationship between the vertical position in the screen and the difference value. As for the vertical position of the horizontal axis, 0 is the upper end of the screen. It is assumed that the image data has characteristics as shown in FIG. 5A if there is no flash emission. In the characteristic shown in FIG. 5A, the difference value is lowered near the lower end of the screen. As shown in FIG. 5B, if there is flash emission at the center in the vertical direction of the screen, the difference value increases rapidly.

ステップS305,S310で用いる閾値が値TH1であったとすると、差分値は画面の下端部までフラッシュの発光による影響を受けているものの、下端部よりも上方の位置で、フラッシュの発光による影響が終了したと検出してしまう。そこで、ステップS305で用いる閾値を閾値TH1とし、ステップS310で用いる閾値を、閾値TH1よりも小さい値の閾値TH2とすることが好ましい。ステップS310で用いる閾値を閾値TH2とすることにより、画面の下端部までフラッシュの発光による影響を受けていることが正しく検出される。   Assuming that the threshold used in steps S305 and S310 is the value TH1, the difference value is affected by the flash emission up to the lower end of the screen, but the effect of the flash emission ends at a position above the lower end. Will be detected. Therefore, it is preferable that the threshold used in step S305 is the threshold TH1, and the threshold used in step S310 is the threshold TH2 having a value smaller than the threshold TH1. By setting the threshold used in step S310 to the threshold TH2, it is correctly detected that the lower end of the screen is affected by the flash emission.

図6を用いて、第1実施形態による画像データの補正について説明する。図6の(a)は、図2の(d)に示す補正前の画像Im1,Im2,Im3,Im4…を示している。制御部9に低遅延モードが設定されている場合には、フラッシュ補正部8は次のように画像データを補正する。   Image data correction according to the first embodiment will be described with reference to FIG. 6A shows images Im1, Im2, Im3, Im4,... Before correction shown in FIG. When the low delay mode is set in the control unit 9, the flash correction unit 8 corrects the image data as follows.

フラッシュ検出部2は、図6の(a)に示す画像Im2においては、図4のステップS305,S306によって、画像Im2における一点鎖線以降の画面の途中から高輝度となっている複数のラインを検出する。画像Im2では、画面の下端のラインまで高輝度となっているので、フラッシュ補正部8は、図4のステップS309以降の処理によって、図6の(a)に示すように、画像Im2におけるハッチングを付した部分の高輝度となっている複数のラインを、画像Im1における対応する複数のラインに置換する。   In the image Im2 shown in FIG. 6A, the flash detection unit 2 detects a plurality of lines having high luminance from the middle of the screen after the one-dot chain line in the image Im2 in steps S305 and S306 in FIG. To do. In the image Im2, since the brightness is high up to the line at the lower end of the screen, the flash correction unit 8 performs the hatching in the image Im2 as shown in FIG. 6A by the processing after step S309 in FIG. The plurality of lines having high luminance in the attached portion are replaced with the corresponding plurality of lines in the image Im1.

フラッシュ検出部2は、図6の(a)に示す画像Im3においては、図4のステップS305,S306によって、画像Im3における画面の上端から高輝度となっている複数のラインを検出する。フラッシュ検出部2は、図4のステップS310,S311によって、画像Im3における一点鎖線以降の正常な画像の複数のラインを検出する。フラッシュ補正部8は、図4のステップS309以降の処理によって、図6の(a)に示すように、画像Im3におけるハッチングを付した部分の高輝度となっている複数のラインを、画像Im2における対応する複数のラインに置換する。   In the image Im3 shown in FIG. 6A, the flash detection unit 2 detects a plurality of lines having high luminance from the upper end of the screen in the image Im3 in steps S305 and S306 in FIG. The flash detection unit 2 detects a plurality of lines of a normal image after the one-dot chain line in the image Im3 by steps S310 and S311 of FIG. As shown in FIG. 6A, the flash correction unit 8 performs processing after step S309 in FIG. 4 to display a plurality of lines having high luminance in the hatched portion in the image Im3 in the image Im2. Replace with multiple corresponding lines.

結果として、フラッシュ補正部8は、図6の(b)に示すように、画像Im2を画像Im2’へと補正し、画像Im3を画像Im3’へと補正する。従って、フラッシュ補正部8からバッファメモリ4へと供給される画像データは、図6の(b)に示す画像Im1,Im2’,Im3’,Im4…となる。ここでは、画像Im3を、画像Im2を用いて補正して画像Im3’としたが、画像Im1を用いて補正してもよい。この場合には、バッファメモリ4は2画面前の画像データを保持しておくことが必要になる。   As a result, as shown in FIG. 6B, the flash correction unit 8 corrects the image Im2 to the image Im2 'and corrects the image Im3 to the image Im3'. Therefore, the image data supplied from the flash correction unit 8 to the buffer memory 4 is the images Im1, Im2 ', Im3', Im4,... Shown in FIG. Here, the image Im3 is corrected using the image Im2 to be an image Im3 ', but may be corrected using the image Im1. In this case, the buffer memory 4 needs to hold the image data of the previous two screens.

この低遅延モードでは、画像データの遅延は、画像信号処理部3における信号処理に起因する複数ライン程度の時間であり、実質的にはほとんど遅延がない。例えば、ビデオカメラ101でマニュアルにて動画像を撮影する場合には、表示部7に表示されている画像を確認しながらビデオカメラ101における種々の設定を調整する。画像データに大幅な遅延があると、リアルタイムで画像を確認することができず、適切な操作が困難となる場合がある。第1実施形態による低遅延モードでは遅延がほとんどないので、リアルタイムで画像を確認でき、適切な操作も可能となる。   In this low delay mode, the delay of the image data is a time of about a plurality of lines due to the signal processing in the image signal processing unit 3, and there is substantially no delay. For example, when a moving image is manually captured by the video camera 101, various settings in the video camera 101 are adjusted while confirming the image displayed on the display unit 7. If there is a significant delay in the image data, the image cannot be confirmed in real time, and proper operation may be difficult. Since there is almost no delay in the low delay mode according to the first embodiment, an image can be confirmed in real time, and an appropriate operation can be performed.

一方、制御部9に画面単位切換モードが設定されている場合には、フラッシュ補正部8は次のように画像データを補正する。前述のように、画面単位切換モードが設定されている場合には、フラッシュ補正部8は、画像データの補正の有無にかかわらず、バッファメモリ4から1画面遅延の画像データを読み出してバッファメモリ4を介して圧縮伸張処理部5及び出力信号処理部6へと供給する。従って、図6の(c)に示すように、図6の(a)の補正前の画像Im1,Im2のタイミングで、画像Im1,Im2よりそれぞれ1画面前の画像Im0,Im1が出力される。   On the other hand, when the screen unit switching mode is set in the control unit 9, the flash correction unit 8 corrects the image data as follows. As described above, when the screen unit switching mode is set, the flash correction unit 8 reads the image data of one screen delay from the buffer memory 4 regardless of whether the image data is corrected or not. To the compression / decompression processing unit 5 and the output signal processing unit 6. Accordingly, as shown in FIG. 6C, images Im0 and Im1 that are one screen before the images Im1 and Im2, respectively, are output at the timing of the images Im1 and Im2 before correction in FIG.

フラッシュ補正部8は、図4のステップS319によって、高輝度部分を有する画像Im2の代わりに画像Im1を出力し、高輝度部分を有する画像Im3の代わりに画像Im1を出力する。従って、フラッシュ補正部8からバッファメモリ4へと供給される画像データは、図6の(b)に示す画像Im0,Im1,Im1,Im1,Im4…となる。この場合、高輝度部分を有する画像が2画面連続しているので、バッファメモリ4は3画面前の画像データを保持しておくことが必要になる。   In step S319 of FIG. 4, the flash correction unit 8 outputs the image Im1 instead of the image Im2 having the high luminance part, and outputs the image Im1 instead of the image Im3 having the high luminance part. Therefore, the image data supplied from the flash correction unit 8 to the buffer memory 4 is the images Im0, Im1, Im1, Im1, Im4,... Shown in FIG. In this case, since two images having a high-luminance portion are continuous, it is necessary for the buffer memory 4 to hold the image data of the previous three screens.

<第2実施形態>
図7に示す第2実施形態において、図1と同一部分には同一符号を付し、その説明を適宜省略することとする。第2実施形態の画像処理装置であるビデオカメラ102は、フラッシュ検出部2の代わりにフラッシュ検出部20を備える。フラッシュ検出部20は、ブロック平均輝度算出部201,ブロック平均輝度保持部202,ライン平均輝度算出部203,ライン平均輝度保持部204,全画面平均輝度算出部205,全画面平均輝度保持部206,差分算出部207,フラッシュ判定部208を有する。
Second Embodiment
In the second embodiment shown in FIG. 7, the same parts as those in FIG. 1 are denoted by the same reference numerals, and the description thereof is omitted as appropriate. A video camera 102 as an image processing apparatus according to the second embodiment includes a flash detection unit 20 instead of the flash detection unit 2. The flash detection unit 20 includes a block average luminance calculation unit 201, a block average luminance holding unit 202, a line average luminance calculation unit 203, a line average luminance holding unit 204, a full screen average luminance calculation unit 205, a full screen average luminance holding unit 206, A difference calculation unit 207 and a flash determination unit 208 are included.

フラッシュ検出部20は、制御部9による制御に従って以下のようにフラッシュの発光を検出する。ブロック平均輝度算出部201は、撮像部1から供給された電気信号における1ラインの有効画素を複数のブロックに分割しブロックごとの明るさの平均を算出する。ブロックの数は2のべき乗であることが好ましい。具体的には、ブロック平均輝度算出部201は、G信号の値を各ブロックの有効画素分に渡って加算し、有効画素数で除算することによって1ブロックの明るさの平均(ブロック平均輝度)を算出する。   The flash detection unit 20 detects flash emission according to control by the control unit 9 as follows. The block average luminance calculation unit 201 divides one line of effective pixels in the electrical signal supplied from the imaging unit 1 into a plurality of blocks, and calculates the average brightness for each block. The number of blocks is preferably a power of two. Specifically, the block average luminance calculation unit 201 adds the value of the G signal over the effective pixels of each block, and divides the value by the number of effective pixels to average the brightness of one block (block average luminance). Is calculated.

ブロック平均輝度算出部201によって算出されたブロック平均輝度は、ブロック平均輝度保持部202及びライン平均輝度算出部203に入力される。ライン平均輝度算出部203は、1ラインにおけるブロック平均輝度を加算し、1ラインのブロック数で除算することによって1ラインの明るさの平均(ライン平均輝度)を算出する。ライン平均輝度算出部203によって算出されたライン平均輝度は、ライン平均輝度保持部204及び全画面平均輝度算出部205に入力される。ライン平均輝度保持部204は、ライン平均輝度算出部203によって算出されたライン平均輝度を一時的に保持する。   The block average luminance calculated by the block average luminance calculation unit 201 is input to the block average luminance holding unit 202 and the line average luminance calculation unit 203. The line average luminance calculation unit 203 calculates the average (line average luminance) of the brightness of one line by adding the block average luminance in one line and dividing by the number of blocks in one line. The line average luminance calculated by the line average luminance calculation unit 203 is input to the line average luminance holding unit 204 and the full screen average luminance calculation unit 205. The line average luminance holding unit 204 temporarily holds the line average luminance calculated by the line average luminance calculating unit 203.

全画面平均輝度算出部205は、順次入力されるライン平均輝度を1画面の有効ラインに渡って加算し、有効ライン数で除算することによって1画面全体の明るさの平均(全画面平均輝度)を算出する。全画面平均輝度保持部206は、全画面平均輝度を一時的に保持する。   The total screen average brightness calculation unit 205 adds the average line brightness sequentially input over the effective lines of one screen, and divides by the number of effective lines to average the brightness of the entire screen (average average screen brightness). Is calculated. The full screen average brightness holding unit 206 temporarily holds the full screen average brightness.

差分算出部207には、ブロック平均輝度保持部202で保持されたブロック平均輝度と、ライン平均輝度保持部204で保持されたライン平均輝度と、全画面平均輝度保持部206で保持された全画面平均輝度とが入力される。差分算出部207は、ブロック平均輝度と全画面平均輝度との差分と、ライン平均輝度と全画面平均輝度との差分とをそれぞれ順次算出する。差分算出部207は差分の絶対値をとり、差分値として出力する。   The difference calculation unit 207 includes a block average luminance held by the block average luminance holding unit 202, a line average luminance held by the line average luminance holding unit 204, and a full screen held by the full screen average luminance holding unit 206. The average luminance is input. The difference calculation unit 207 sequentially calculates a difference between the block average luminance and the entire screen average luminance, and a difference between the line average luminance and the entire screen average luminance. The difference calculation unit 207 takes the absolute value of the difference and outputs it as a difference value.

差分算出部207によって算出されたそれぞれの差分値は、フラッシュ判定部208に入力される。フラッシュ判定部208は、ライン平均輝度と全画面平均輝度との差分値が設定された閾値(閾値1)以上であるか否かを判定する。フラッシュ判定部208は、ライン平均輝度と全画面平均輝度との差分値が閾値以上の場合には、それぞれのブロック平均輝度と全画面平均輝度との差分値が設定された閾値(閾値2)以上であるか否かを判定する。閾値1と閾値2とは異なる値であってよい。閾値1と閾値2とは異なる値とする場合には、閾値1よりも閾値2の値を大きくすることが好ましい。   Each difference value calculated by the difference calculation unit 207 is input to the flash determination unit 208. The flash determination unit 208 determines whether or not the difference value between the line average luminance and the entire screen average luminance is equal to or greater than a set threshold (threshold 1). When the difference value between the line average luminance and the entire screen average luminance is equal to or greater than the threshold, the flash determination unit 208 is equal to or greater than the threshold (threshold 2) in which the difference value between each block average luminance and the entire screen average luminance is set. It is determined whether or not. The threshold value 1 and the threshold value 2 may be different values. When the threshold value 1 and the threshold value 2 are different from each other, it is preferable to make the value of the threshold value 2 larger than the threshold value 1.

フラッシュ判定部208は、ラインごとの差分値が閾値1以上であり、ブロックごとの差分値が閾値2以上である状態が予め設定したライン数以上継続するか否かを判定する。フラッシュ判定部208は、それぞれの差分値が閾値1,2以上である状態が予め設定したライン数以上継続したと判定した場合に、フラッシュの発光によって画像の明るさが不連続となったと検出する。   The flash determination unit 208 determines whether or not the state where the difference value for each line is equal to or greater than the threshold value 1 and the difference value for each block is equal to or greater than the threshold value 2 continues for a predetermined number of lines or more. The flash determination unit 208 detects that the brightness of the image has become discontinuous due to flash emission when it is determined that the state where the respective difference values are the threshold values 1 and 2 or more continues for a preset number of lines. .

フラッシュ判定部208は、フラッシュが発光したと判定した場合には、フラッシュの発光の開始時点である、ライン平均輝度と全画面平均輝度との差分値が閾値1以上であり、かつそれぞれのブロック平均輝度と全画面平均輝度との差分値が閾値2以上となった最初のライン番号を示すデータと、ライン平均輝度と全画面平均輝度との差分値が閾値1以上と、それぞれのブロック平均輝度と全画面平均輝度との差分値が閾値2以上との少なくとも一方の条件を満たさなくなった最初のライン番号を示すデータとを出力する。フラッシュ判定部208は、フラッシュが発光したことを示す検出信号も出力する。   If the flash determination unit 208 determines that the flash is emitted, the difference value between the line average luminance and the entire screen average luminance, which is the start point of flash emission, is equal to or greater than the threshold 1, and each block average The data indicating the first line number for which the difference value between the luminance and the entire screen average luminance is equal to or greater than the threshold 2, the difference value between the line average luminance and the entire screen average luminance is equal to or greater than the threshold 1, and the respective block average luminances Data indicating the first line number that does not satisfy at least one of the conditions that the difference value with respect to the entire screen average luminance is not less than the threshold value 2 is output. The flash determination unit 208 also outputs a detection signal indicating that the flash has emitted light.

第2実施形態においては、図3に示すステップS3のフラッシュ検出・補正処理を図8に示すステップS3とする。図8を用いて、ステップS3のフラッシュ検出・補正処理の詳細について説明する。図8において、フラッシュ検出部20は、ステップS321にて、有効ラインにおける各ブロックの有効画素の画素値を加算する処理を有効ラインごとに順次実行する。フラッシュ検出部20は、ステップS322にて、ステップS321にて得た各ブロックの画素値の加算値をブロック内の有効画素数で除算してブロック平均輝度を算出し、ブロック平均輝度を保持する。 In the second embodiment, the step S3 2 shown in FIG. 8 flash detection and correction in the step S3 shown in FIG. With reference to FIG. 8, it will be described in detail flash detection and correction in the step S3 2. In FIG. 8, in step S321, the flash detection unit 20 sequentially executes a process of adding the pixel values of the effective pixels of each block in the effective line for each effective line. In step S322, the flash detection unit 20 calculates the block average luminance by dividing the addition value of the pixel values of each block obtained in step S321 by the number of effective pixels in the block, and holds the block average luminance.

フラッシュ検出部20は、ステップS323にて、1ライン内のブロック平均輝度を加算し、ステップS324にて、ブロック平均輝度の加算値をブロック数で除算してライン平均輝度を算出し、ライン平均輝度を保持する。フラッシュ検出部20は、ステップS325にて、ライン平均輝度を順次加算する処理を実行する。フラッシュ検出部20は、ステップS326にて、ステップS322で算出したブロック平均輝度と1画面前の全画面平均輝度との差分演算と、ステップS324で算出したライン平均輝度と1画面前の全画面平均輝度との差分演算とのそれぞれの処理を実行する。ステップS326における差分演算処理は、ステップS324でライン平均輝度を算出するたびに実行される。   In step S323, the flash detection unit 20 adds the block average luminance in one line, and in step S324, calculates the line average luminance by dividing the added value of the block average luminance by the number of blocks. Hold. In step S325, the flash detection unit 20 executes a process of sequentially adding the line average luminance. In step S326, the flash detection unit 20 calculates a difference between the block average luminance calculated in step S322 and the entire screen average luminance of the previous screen, and the line average luminance calculated in step S324 and the entire screen average of the previous screen. Each process of difference calculation with luminance is executed. The difference calculation process in step S326 is executed every time the line average luminance is calculated in step S324.

フラッシュ検出部20は、ステップS327にて、ライン平均輝度と全画面平均輝度との差分値が閾値(閾値1)以上のラインを検出したか否かを判定する。ステップS327〜S329,S333,S334は、フラッシュ判定部208によって判定される。ライン平均輝度と全画面平均輝度との差分値が閾値以上のラインを検出したと判定されれば(YES)、フラッシュ検出部20は、処理をステップS328に移行させ、ライン平均輝度と全画面平均輝度との差分値が閾値以上のラインを検出したと判定されなければ(NO)、フラッシュ検出部20は、処理をステップS337に移行させる。ライン平均輝度と全画面平均輝度との差分値が閾値以上のラインを検出しなければ、フラッシュは発光していないということである。   In step S327, the flash detection unit 20 determines whether or not a line having a difference value between the line average luminance and the entire screen average luminance equal to or greater than a threshold (threshold 1) is detected. Steps S327 to S329, S333, and S334 are determined by the flash determination unit 208. If it is determined that a line whose difference value between the line average luminance and the entire screen average luminance is equal to or greater than the threshold is detected (YES), the flash detection unit 20 moves the process to step S328, and the line average luminance and the entire screen average. If it is not determined that a line having a difference value with respect to the luminance is not less than the threshold value (NO), the flash detection unit 20 shifts the process to step S337. If a line having a difference value between the line average brightness and the full screen average brightness of a threshold value or more is not detected, the flash is not emitting light.

フラッシュ検出部20は、ライン平均輝度と全画面平均輝度との差分値が閾値以上のラインを検出した場合、さらに、ステップS328にて、そのライン内のそれぞれのブロック平均輝度と全画面平均輝度との差分値が閾値(閾値2)以上であるか否かを判定する。フラッシュ検出部20は、それぞれのブロック平均輝度と全画面平均輝度との差分値が閾値以上であると判定されれば(YES)、フラッシュ検出部20は、処理をステップS329に移行させる。なお、この際、フラッシュ検出部2は、検出したラインがフレームの最初のラインから何ライン目かを示す検出ライン情報を記憶しておく。記憶する検出ライン情報はラインが連続して検出される場合は最初の1ライン目のみでよい。   If the flash detection unit 20 detects a line whose difference value between the line average luminance and the full screen average luminance is equal to or greater than the threshold value, the flash detection unit 20 further calculates the block average luminance and the full screen average luminance in the line in step S328. It is determined whether or not the difference value is equal to or greater than a threshold value (threshold value 2). If the flash detection unit 20 determines that the difference value between each block average luminance and the entire screen average luminance is equal to or greater than the threshold (YES), the flash detection unit 20 shifts the processing to step S329. At this time, the flash detection unit 2 stores detected line information indicating the number of detected lines from the first line of the frame. The detected line information to be stored may be only the first line when the lines are continuously detected.

一方、それぞれのブロック平均輝度と全画面平均輝度との差分値が閾値以上であると判定されなければ(NO)、フラッシュ検出部20は、既に検出ライン情報を記憶している場合は、それを消去するとともに、処理をステップS337に移行させる。   On the other hand, if it is not determined that the difference value between each block average luminance and the entire screen average luminance is equal to or greater than the threshold (NO), the flash detection unit 20 stores the detected line information if it is already stored. While deleting, the process proceeds to step S337.

フラッシュ検出部20は、ステップS329にて、ライン平均輝度と全画面平均輝度との差分値が閾値以上であり、それぞれのブロック平均輝度と全画面平均輝度との差分値が閾値以上であるという2つの条件を満たすラインが所定ライン数以上継続したか否かを判定する。この2つの条件を満たす状態を特定状態とする。特定状態が所定ライン数以上継続したと判定されれば(YES)、フラッシュ検出部20は処理をステップS330に移行させ、特定状態が所定ライン数以上継続したと判定されなければ(NO)、フラッシュ検出部20は処理をステップS337に移行させる。   In step S329, the flash detection unit 20 determines that the difference value between the line average luminance and the entire screen average luminance is greater than or equal to the threshold, and the difference value between each block average luminance and the entire screen average luminance is greater than or equal to the threshold. It is determined whether or not the number of lines that satisfy one condition continues for a predetermined number of lines or more. A state satisfying these two conditions is defined as a specific state. If it is determined that the specific state has continued for a predetermined number of lines or more (YES), the flash detection unit 20 moves the process to step S330, and if it is not determined that the specific state has continued for a predetermined number of lines or more (NO), the flash The detection unit 20 moves the process to step S337.

第2実施形態においては、上記の2つの条件を満たす特定状態のラインが所定ライン数以上継続したとき、フラッシュが発光したと判定する。仮に、ライン平均輝度と全画面平均輝度との差分値が閾値以上である状態が所定ライン数以上継続する状態が発生しても、ライン内のそれぞれのブロック平均輝度と全画面平均輝度との差分値が閾値以上であるという条件を満たさない場合には、フラッシュは発光していないと判定されることになる。この理由については後述する。   In the second embodiment, when the number of lines in a specific state that satisfy the above two conditions continues for a predetermined number or more, it is determined that the flash has emitted. Even if a state in which the difference between the line average luminance and the entire screen average luminance is equal to or greater than the threshold value continues for a predetermined number of lines or more, the difference between each block average luminance in the line and the entire screen average luminance. If the condition that the value is greater than or equal to the threshold value is not satisfied, it is determined that the flash is not emitting light. The reason for this will be described later.

フラッシュ検出部20は、上記の2つの条件を満たす特定状態のラインが所定ライン数以上継続したら、ステップS330にて、フラッシュが発光していないことを示す検出信号“0”からフラッシュが発光したことを示す検出信号“1”へと切り換え、この切り換えた検出信号と、記憶している検出ライン情報とをフラッシュ補正部8に供給するとともに、検出ライン情報を消去する。フラッシュ検出部20及びフラッシュ補正部8は、ステップS331にて、設定されているモードが低遅延モードであるか否かを判定する。低遅延モードであると判定されれば(YES)、フラッシュ補正部8は、処理をステップS332に移行させる。低遅延モードであると判定されなければ(NO)、フラッシュ検出部20は、処理をステップS339に移行させる。   When the number of lines in a specific state satisfying the above two conditions continues for a predetermined number or more, the flash detection unit 20 indicates that the flash has been emitted from the detection signal “0” indicating that the flash is not emitting in step S330. Is switched to the detection signal “1” indicating that the detected signal and the stored detection line information are supplied to the flash correction unit 8 and the detection line information is erased. In step S331, the flash detection unit 20 and the flash correction unit 8 determine whether or not the set mode is the low delay mode. If it is determined that the mode is the low delay mode (YES), the flash correction unit 8 shifts the process to step S332. If it is not determined that the mode is the low delay mode (NO), the flash detection unit 20 shifts the process to step S339.

フラッシュ補正部8は、ステップS332にて、供給された検出ライン情報が示す、1画面前のラインへの置換を開始する。フラッシュ検出部20は、ステップS333にて、ライン平均輝度と全画面平均輝度との差分値が閾値未満であるか、または、それぞれのブロック平均輝度と全画面平均輝度との差分値が閾値未満であるラインを検出したか否かを判定する。即ち、フラッシュ検出部20は、ステップS333にて、上記の2つの条件の少なくとも一方を満たさないラインが現れたか否かを判定する。   In step S332, the flash correction unit 8 starts replacement with the previous line indicated by the supplied detection line information. In step S333, the flash detection unit 20 determines that the difference value between the line average luminance and the entire screen average luminance is less than the threshold value, or the difference value between each block average luminance and the entire screen average luminance is less than the threshold value. It is determined whether or not a certain line has been detected. That is, the flash detection unit 20 determines whether or not a line that does not satisfy at least one of the above two conditions appears in step S333.

上記の2つの条件の少なくとも一方を満たさないラインが現れたと判定されれば(YES)、フラッシュ検出部20は処理をステップS334に移行させる。なお、この際、フラッシュ検出部2は、検出したラインがフレームの最初のラインから何ライン目かを示す検出ライン情報を記憶しておく。記憶する検出ライン情報はラインが連続して検出される場合は最初の1ライン目のみでよい。   If it is determined that a line that does not satisfy at least one of the two conditions has appeared (YES), the flash detection unit 20 moves the process to step S334. At this time, the flash detection unit 2 stores detected line information indicating the number of detected lines from the first line of the frame. The detected line information to be stored may be only the first line when the lines are continuously detected.

一方、上記の2つの条件の少なくとも一方を満たさないラインが現れたと判定されなければ(NO)、フラッシュ検出部20は、記憶していた検出ライン情報を消去するとともに、処理をステップS337に移行させる。   On the other hand, if it is not determined that a line that does not satisfy at least one of the above two conditions has appeared (NO), the flash detection unit 20 deletes the stored detection line information and shifts the process to step S337. .

フラッシュ検出部20は、ステップS334にて、上記の2つの条件の少なくとも一方を満たさない状態が所定ライン数以上継続したか否かを判定する。所定ライン数以上継続したと判定されれば(YES)、フラッシュ検出部20は処理をステップS335に移行させ、所定ライン数以上継続したと判定されなければ(NO)、フラッシュ検出部20は処理をステップS337に移行させる。   In step S334, the flash detection unit 20 determines whether or not a state in which at least one of the above two conditions is not satisfied continues for a predetermined number of lines or more. If it is determined that the predetermined number of lines or more have been continued (YES), the flash detection unit 20 proceeds to step S335. If it is not determined that the predetermined number of lines or more has been continued (NO), the flash detection unit 20 performs the process. The process proceeds to step S337.

フラッシュ検出部20は、ステップS335にて、検出信号“1”を検出信号“0”へと切り換え、この切り換えた検出信号と、記憶している検出ライン情報とをフラッシュ補正部8に供給するとともに検出ライン情報を消去する。フラッシュ補正部8は、ステップS336にて、供給された検出ライン情報が示す、1画面前のラインへの置換を終了し、フラッシュ検出部20は、処理をステップS337に移行させる。   In step S335, the flash detection unit 20 switches the detection signal “1” to the detection signal “0”, and supplies the switched detection signal and the stored detection line information to the flash correction unit 8. Delete detection line information. In step S336, the flash correction unit 8 ends the replacement with the previous line indicated by the supplied detection line information, and the flash detection unit 20 shifts the process to step S337.

フラッシュ検出部20は、ステップS337にて、全有効ラインに対する判定が終了したか否かを判定する。全有効ラインに対する判定が終了したと判定されれば(YES)、フラッシュ検出部20は、処理をステップS338に移行させ、全有効ラインが終了したと判定されなければ(NO)、フラッシュ検出部20は、処理をステップS321に戻してステップS321以降を繰り返す。   In step S337, the flash detection unit 20 determines whether the determination for all active lines has been completed. If it is determined that the determination for all active lines is completed (YES), the flash detection unit 20 shifts the process to step S338. If it is not determined that all effective lines are completed (NO), the flash detection unit 20 Returns the processing to step S321 and repeats step S321 and subsequent steps.

フラッシュ検出部20は、ステップS338にて、ライン平均輝度の加算値を有効ライン数で除算して全画面平均輝度を算出し、全画面平均輝度を保持して、図3のステップS5へと移行させる。   In step S338, the flash detection unit 20 divides the added value of the line average luminance by the number of effective lines to calculate the entire screen average luminance, holds the entire screen average luminance, and proceeds to step S5 in FIG. Let

一方、ステップS331にて低遅延モードであると判定されなかった(即ち、画面単位切換モードであると判定された)場合、フラッシュ検出部20はステップS316〜S319と同じであり、説明を省略する。   On the other hand, if it is not determined in step S331 that the mode is the low delay mode (that is, it is determined that the screen unit switching mode is selected), the flash detection unit 20 is the same as steps S316 to S319, and a description thereof is omitted. .

第2実施形態においても、第1実施形態と同様、ステップS333においてライン平均輝度と全画面平均輝度との差分値と比較する閾値を、ステップS327においてライン平均輝度と全画面平均輝度との差分値と比較する閾値よりも小さな値とすることが好ましい。   Also in the second embodiment, as in the first embodiment, the threshold value to be compared with the difference value between the line average luminance and the entire screen average luminance in step S333, and the difference value between the line average luminance and the entire screen average luminance in step S327. It is preferable to set a value smaller than a threshold value to be compared with.

第2実施形態によれば、第1実施形態よりもフラッシュが発光したか否かの検出精度を向上させることができる。図9を用いて、検出精度を向上させることができる理由について説明する。図9は、画面内に部分的に矩形状の高輝度領域Arhが含まれる画像Imiの例を示している。ハッチングを付した高輝度領域Arhは例えば白レベルであるとする。高輝度領域Arhは矩形状でなくてもよい。有効ラインLneにおいては、ライン平均輝度は比較的高い値となる。有効ラインLne以外のラインでも高輝度領域Arhが存在している垂直方向の範囲では同様である。従って、第1実施形態においては、高輝度領域Arhが存在している垂直方向の範囲でフラッシュが発光したと誤判定する可能性がある。   According to the second embodiment, it is possible to improve the detection accuracy as to whether or not the flash has emitted, compared to the first embodiment. The reason why the detection accuracy can be improved will be described with reference to FIG. FIG. 9 shows an example of an image Imi in which a high-luminance area Arh having a rectangular shape is partially included in the screen. The hatched high luminance area Arh is assumed to have a white level, for example. The high brightness area Arh may not be rectangular. In the effective line Lne, the line average luminance is a relatively high value. The same applies to a range other than the effective line Lne in the vertical range where the high luminance area Arh exists. Therefore, in the first embodiment, there is a possibility that the flash is erroneously determined to emit light in the vertical range where the high luminance area Arh exists.

図9では、1ラインを4つのブロックB1〜B4に分割した例を示している。ブロック平均輝度算出部201で算出されるブロック平均輝度は、ブロックB1ではさほど高い値とはならない。ブロック平均輝度はブロックB2,B3では高い値となり、ブロックB4ではブロックB2,B3よりも小さな値となる。有効ラインLneにおいて、図8のステップS327にて、ライン平均輝度と全画面平均輝度との差分値が閾値以上であると判定されたとしても、ステップS328にて、少なくともブロックB1で、ブロック平均輝度と全画面平均輝度との差分値が閾値以上であると判定されない。 FIG. 9 shows an example in which one line is divided into four blocks B1 to B4. The block average brightness calculated by the block average brightness calculation unit 201 is not so high in the block B1. The block average luminance is a high value in the blocks B2 and B3, and a smaller value in the block B4 than in the blocks B2 and B3. In the effective line Lne, even if it is determined in step S327 in FIG. 8 that the difference value between the line average luminance and the entire screen average luminance is equal to or greater than the threshold value, in step S328, at least the block average luminance in block B1. Is not determined to be greater than or equal to the threshold value.

従って、第2実施形態によれば、図9の例のように部分的な高輝度領域Arhを含む画像Imiであっても、フラッシュが発光したと誤判定する可能性を大幅に低減させることができる。   Therefore, according to the second embodiment, it is possible to greatly reduce the possibility of erroneously determining that the flash has been emitted even in the case of the image Imi including the partial high brightness area Arh as in the example of FIG. it can.

<第3実施形態>
第3実施形態の画像処理装置の構成は、図1に示す第1実施形態のビデオカメラ101または図7に示す第2実施形態のビデオカメラ102と同様であり、フラッシュ補正部8での画像データの補正処理が第1及び第2実施形態とは異なっている。図10〜図12を用いて、第3実施形態における画像データの補正処理について説明する。第3実施形態においては、図3に示すステップS3のフラッシュ検出・補正処理を図10に示すステップS3とする。図10を用いて、ステップS3のフラッシュ検出・補正処理の詳細について説明する。
<Third Embodiment>
The configuration of the image processing apparatus of the third embodiment is the same as that of the video camera 101 of the first embodiment shown in FIG. 1 or the video camera 102 of the second embodiment shown in FIG. This correction process is different from those in the first and second embodiments. Image data correction processing according to the third embodiment will be described with reference to FIGS. In the third embodiment, the flash detection / correction process in step S3 shown in FIG. 3 is referred to as step S33 shown in FIG. With reference to FIG. 10, detailed description will be given of a flash detection and correction in the step S3 3.

図10は、画像処理装置の構成を、フラッシュ検出部2を有する図1のビデオカメラ101とした場合を例にしている。特に図示しないが、フラッシュ検出部20を有する図7のビデオカメラ102においても、図10のステップS3と同様の処理を行うことが可能である。図10において、図4と同一のステップには同一の符号を付し、その説明を適宜省略する。 FIG. 10 shows an example in which the configuration of the image processing apparatus is the video camera 101 of FIG. 1 having the flash detection unit 2. Although not shown particularly, in the video camera 102 in FIG. 7 having a flash detection unit 20, it is possible to perform the same processing as Step S3 3 in FIG. 10, the same steps as those in FIG. 4 are denoted by the same reference numerals, and the description thereof is omitted as appropriate.

図10において、ステップS304以前は図4と同じであり、図示を省略している。図10のステップS307までは図4と同じである。フラッシュ検出部2がステップS307にてフラッシュが発光していないことを示す検出信号“0”からフラッシュが発光したことを示す検出信号“1”へと切り換え、この切り換えた検出信号と、記憶している検出ライン情報とをフラッシュ補正部8に供給したら、フラッシュ補正部8は、ステップS351にて、供給された検出ライン情報が示すフラッシュ開始ラインよりも上方に位置し、フラッシュ開始ラインに隣接する隣接領域を設定する。   In FIG. 10, the steps before step S304 are the same as those in FIG. Steps up to step S307 in FIG. 10 are the same as those in FIG. In step S307, the flash detection unit 2 switches from the detection signal “0” indicating that the flash is not emitted to the detection signal “1” indicating that the flash is emitted, and stores the switched detection signal. In step S351, the flash correction unit 8 is located above the flash start line indicated by the supplied detection line information and is adjacent to the flash start line. Set the area.

具体的には、図11の(a)に示すように、フラッシュ補正部8は、供給された検出ライン情報が示す最初のフラッシュ検出ラインであるフラッシュ開始ラインLnfsに隣接する複数ラインの隣接領域Aadjsを設定する。隣接領域Aadjsは例えば5〜10ライン程度でよい。   Specifically, as illustrated in FIG. 11A, the flash correction unit 8 includes a plurality of adjacent areas Aadjs adjacent to the flash start line Lnfs which is the first flash detection line indicated by the supplied detection line information. Set. The adjacent area Aadjs may be about 5 to 10 lines, for example.

フラッシュ補正部8は、低遅延モードであると判定されたとき、ステップS352にて、隣接領域Aadjsにおいて、現在の画面のラインと1画面前の画面のラインとを混合して隣接領域Aadjsの新たなラインを生成し、隣接領域Aadjs内のラインを新たなラインに置換する。フラッシュ補正部8は、ステップS353にて、フラッシュ開始ラインLnfs以降、1画面前のラインへの置換を開始する。   When it is determined that the low-delay mode is set, the flash correction unit 8 mixes the current screen line with the previous screen line in the adjacent area Aadjs in step S352, and creates a new adjacent area Aadjs. A new line is generated, and the line in the adjacent area Aadjs is replaced with a new line. In step S353, the flash correction unit 8 starts replacement with the previous line after the flash start line Lnfs.

フラッシュ検出部2がステップS312にて検出信号“1”を検出信号“0”へと切り換え、この切り換えた検出信号と、記憶している検出ライン情報とをフラッシュ補正部8に供給したら、フラッシュ補正部8は、ステップS354にて、供給された検出ライン信号が示すフラッシュ終了ライン(ステップS310にて検出したフラッシュ発光終了後の最初のラインの1ライン前のライン)下方に位置し、フラッシュ終了ラインに隣接する隣接領域を設定する。具体的には、図11の(b)に示すように、フラッシュ補正部8は、フラッシュ終了ラインLnfeに隣接する複数ラインの隣接領域Aadjeを設定する。隣接領域Aadjeも例えば5〜10ライン程度でよい。   When the flash detection unit 2 switches the detection signal “1” to the detection signal “0” in step S312, and supplies the switched detection signal and stored detection line information to the flash correction unit 8, flash correction is performed. The unit 8 is located below the flash end line (line one line before the first line after the end of flash emission detected in step S310) indicated by the supplied detection line signal in step S354, and the flash end line. An adjacent area adjacent to is set. Specifically, as shown in FIG. 11B, the flash correction unit 8 sets a plurality of adjacent areas Aadje adjacent to the flash end line Lnfe. The adjacent area Aadje may be about 5 to 10 lines, for example.

フラッシュ補正部8は、ステップS313にて、1画面前のラインへの置換を終了し、ステップS355にて、隣接領域Aadjeにおいて、現在の画面のラインと1画面前の画面のラインとを混合して隣接領域Aadjeの新たなラインを生成し、隣接領域Aadje内のラインを新たなラインに置換する。他のステップによる処理は図4で説明した通りである。   In step S313, the flash correction unit 8 finishes replacing the previous line with the screen, and in step S355, mixes the current screen line and the previous screen line in the adjacent area Aadje. Then, a new line of the adjacent area Aadje is generated, and the line in the adjacent area Aadje is replaced with a new line. The processing by other steps is as described in FIG.

図11の(a)において、隣接領域Aadjsの最初のラインをLS、隣接領域Aadjsの最後のラインをLEとし、隣接領域Aadjsの画素位置をLf(i,j)とすると、現在の画面の画像データの合成重み付け係数Wf(i,j)と、1画面前の画面の画像データの合成重み付け係数Wb(i,j)は式(1)となる。図10のステップS352では、式(1)に基づいて現在の画面のラインと1画面前の画面のラインとを混合して隣接領域Aadjsの新たなラインを生成する。式(1)では、画素位置Lf(i,j)としているが、1画面前の画面の画像データと現在の画面の画像データとはライン単位で混合するので、画像の水平方向の位置を示すiの情報はなくてもよい。   In FIG. 11A, assuming that the first line of the adjacent area Aadjs is LS, the last line of the adjacent area Aadjs is LE, and the pixel position of the adjacent area Aadjs is Lf (i, j), the current screen image The composite weighting coefficient Wf (i, j) of data and the composite weighting coefficient Wb (i, j) of the image data of the screen one screen before are expressed by Expression (1). In step S352 of FIG. 10, a new line in the adjacent area Aadjs is generated by mixing the line on the current screen and the line on the previous screen based on Expression (1). In Expression (1), the pixel position Lf (i, j) is used, but the image data of the previous screen and the image data of the current screen are mixed in units of lines, and thus indicate the horizontal position of the image. There is no need for i information.

Figure 0005928290
Figure 0005928290

図11の(b)において、隣接領域Aadjeの最初のラインをLS、隣接領域Aadjeの最後のラインをLEとし、隣接領域Aadjeの画素位置をLf(i,j)とすると、現在の画面の画像データの合成重み付け係数Wf(i,j)と、1画面前の画面の画像データの合成重み付け係数Wb(i,j)は式(2)となる。同様に、式(2)では、画素位置Lf(i,j)としているが、1画面前の画面の画像データと現在の画面の画像データとはライン単位で混合するので、画像の水平方向の位置を示すiの情報はなくてもよい。   In FIG. 11B, assuming that the first line of the adjacent area Aadje is LS, the last line of the adjacent area Aadje is LE, and the pixel position of the adjacent area Aadje is Lf (i, j), the image of the current screen The composition weighting coefficient Wf (i, j) of data and the composition weighting coefficient Wb (i, j) of the image data of the screen one screen before are expressed by Expression (2). Similarly, in the expression (2), the pixel position Lf (i, j) is used. However, since the image data of the previous screen and the image data of the current screen are mixed in line units, There is no need for i information indicating the position.

Figure 0005928290
Figure 0005928290

式(1)による現在の画面のラインと1画面前の画面のラインとを混合特性は図12の(a)となる。図12の(a)において、実線は現在の画面のラインの混合率を示し、破線は1画面前の画面のラインの混合率を示している。図12の(a)に示すように、図11の(a)に示す画像Im2の場合には、画面の上端側から隣接領域Aadjsの手前までは現在の画面のラインのみである。ステップS352によって、隣接領域Aadjsの最初のラインLSから最後のラインLEまで現在の画面のラインの混合率が順次減少していく一方、1画面前の画面のラインの混合率が順次増加していく。最後のラインLE以降、ステップS353によって1画面前の画面のラインのみとなる。なお、フラッシュ開始ラインLnfsと最後のラインLEとを同一のラインとしてもよい。   The mixing characteristic of the current screen line and the previous screen line according to equation (1) is as shown in FIG. In FIG. 12A, the solid line indicates the mixing ratio of the lines on the current screen, and the broken line indicates the mixing ratio of the lines on the previous screen. As shown in FIG. 12A, in the case of the image Im2 shown in FIG. 11A, the current screen line is only from the upper end side of the screen to the front of the adjacent area Aadjs. In step S352, the mixing ratio of the lines on the current screen is sequentially decreased from the first line LS to the last line LE of the adjacent area Aadjs, while the mixing ratio of the lines on the screen one screen before is sequentially increased. . After the last line LE, only the line of the previous screen is displayed in step S353. Note that the flash start line Lnfs and the last line LE may be the same line.

式(2)による現在の画面のラインと1画面前の画面のラインとを混合特性は図12の(b)となる。図12の(b)において、実線は現在の画面のラインの混合率を示し、破線は1画面前の画面のラインの混合率を示している。図12の(b)に示すように、図11の(b)に示す画像Im3の場合には、画面の上端側から隣接領域Aadjeの手前までは1画面前の画面のラインのみである。ステップS356によって、隣接領域Aadjeの最初のラインLSから最後のラインLEまで1画面前の画面のラインの混合率が順次減少していく一方、現在の画面のラインの混合率が順次増加していく。最後のラインLE以降、現在の画面のラインのみとなる。なお、フラッシュ終了ラインLnfeと最初のラインLSとを同一のラインとしてもよい。   FIG. 12B shows the mixing characteristics of the current screen line and the previous screen line according to the equation (2). In FIG. 12B, the solid line indicates the mixing ratio of the lines on the current screen, and the broken line indicates the mixing ratio of the lines on the previous screen. As shown in (b) of FIG. 12, in the case of the image Im3 shown in (b) of FIG. 11, the line from the upper end of the screen to the front of the adjacent area Aadje is only the screen line one screen before. In step S356, the line mixing ratio of the previous screen from the first line LS to the last line LE of the adjacent area Aadje is sequentially decreased, while the line mixing ratio of the current screen is sequentially increased. . After the last line LE, there are only lines on the current screen. The flush end line Lnfe and the first line LS may be the same line.

第3実施形態によれば、図2に示す画像Im2のように画面の途中から高輝度となっている場合には、フラッシュ開始ラインLnfsに対して上方に位置するフラッシュの影響を受けていない隣接領域Aadjsにおいて、最初のラインLSから最後のラインLEに進行するに従って1画面前の画面のラインに徐々に切り替わっていく。従って、現在の画面の画像データと1画面前の画面の画像データとを混合する不自然さが低減される。   According to the third embodiment, when the brightness is high from the middle of the screen as in the image Im2 shown in FIG. 2, the adjacent to the flash start line Lnfs is not affected by the flash located above. In the area Aadjs, the screen line is gradually switched to the screen on the previous screen as it progresses from the first line LS to the last line LE. Therefore, the unnaturalness of mixing the image data of the current screen and the image data of the previous screen is reduced.

また、第3実施形態によれば、図2に示す画像Im3のように画面の途中まで高輝度で途中から正常な画像となっている場合には、フラッシュ終了ラインLnfeに対して下方に位置するフラッシュの影響を受けていない隣接領域Aadjeにおいて、最初のラインLSから最後のラインLEに進行するに従って現在の画面のラインに徐々に切り替わっていく。従って、現在の画面の画像データと1画面前の画面の画像データとを混合する不自然さが低減される。   In addition, according to the third embodiment, when the image is high-brightness and normal from the middle like the image Im3 shown in FIG. 2, it is positioned below the flash end line Lnfe. In the adjacent area Aadje that is not affected by the flash, the line is gradually switched to the line on the current screen as it proceeds from the first line LS to the last line LE. Therefore, the unnaturalness of mixing the image data of the current screen and the image data of the previous screen is reduced.

上述した式(1),(2)の代わりに、式(3)を用いて画素単位で現在の画面の画像データと1画面前の画面の画像データとを混合してもよい。式(3)において、Mf(i,j)は画素の明るさであり、ThH,ThLはThH>ThLを満たす明るさの閾値である。この場合には、フラッシュ検出部2,20で検出したそれぞれの有効画素の明るさをフラッシュ補正部8に入力すればよい。   Instead of the above formulas (1) and (2), the image data of the current screen and the image data of the previous screen may be mixed in units of pixels using the formula (3). In Expression (3), Mf (i, j) is the brightness of the pixel, and ThH and ThL are brightness thresholds that satisfy ThH> ThL. In this case, the brightness of each effective pixel detected by the flash detection units 2 and 20 may be input to the flash correction unit 8.

Figure 0005928290
Figure 0005928290

式(3)によれば、隣接領域Aadjs及び隣接領域Aadjeにおいて、それぞれの画素の明るさMf(i,j)が小さい方の値の閾値ThLよりも小さければ、現在の画面の画像データの合成重み付け係数Wf(i,j)が1となり、1画面前の画面の画像データの合成重み付け係数Wb(i,j)が0となる。即ち、画素の明るさMf(i,j)が閾値ThLよりも小さいということはフラッシュの発光による影響を受けていない可能性が高く、現在の画面の画素データのみとする。   According to the equation (3), in the adjacent area Aadjs and the adjacent area Aadje, if the brightness Mf (i, j) of each pixel is smaller than the threshold value ThL of the smaller value, the composition of the image data of the current screen The weighting coefficient Wf (i, j) becomes 1, and the composite weighting coefficient Wb (i, j) of the image data of the screen one screen before becomes 0. That is, if the pixel brightness Mf (i, j) is smaller than the threshold ThL, there is a high possibility that the pixel is not affected by the flash emission, and only the pixel data of the current screen is used.

また、それぞれの画素の明るさMf(i,j)が大きい方の閾値ThHよりも大きければ、現在の画面の画像データの合成重み付け係数Wf(i,j)が0となり、1画面前の画面の画像データの合成重み付け係数Wb(i,j)が1となる。即ち、画素の明るさMf(i,j)が閾値ThHよりも大きいということはフラッシュの発光による影響を受けている可能性が高く、1画面前の画面の画素データのみとする。   If the brightness Mf (i, j) of each pixel is larger than the larger threshold value ThH, the composite weighting coefficient Wf (i, j) of the image data of the current screen becomes 0, and the screen one screen before The composite weighting coefficient Wb (i, j) of the image data is 1. That is, if the pixel brightness Mf (i, j) is larger than the threshold value ThH, there is a high possibility that it is affected by the light emission of the flash, and only the pixel data of the previous screen is used.

それぞれの画素の明るさMf(i,j)が閾値ThL以上閾値ThH以下であれば、式(3)の特性で現在の画面の画素データと1画面前の画面の画素データとが適応的に混合されることになる。   If the brightness Mf (i, j) of each pixel is greater than or equal to the threshold ThL and less than or equal to the threshold ThH, the pixel data of the current screen and the pixel data of the previous screen are adaptively represented by the characteristic of Equation (3). Will be mixed.

<第4実施形態>
第4実施形態の画像処理装置の構成は、図7に示す第2実施形態のビデオカメラ102と同様であり、フラッシュ検出部20におけるフラッシュ発光の検出処理が第2実施形態とは異なっている。図13,図14を用いて、第4実施形態におけるフラッシュ発光の検出処理について説明する。第4実施形態においては、図3に示すステップS3のフラッシュ検出・補正処理を図13に示すステップS3とする。図13を用いて、ステップS3のフラッシュ検出・補正処理の詳細について説明する。図13において、図8と同一のステップには同一の符号を付し、その説明を適宜省略する。
<Fourth embodiment>
The configuration of the image processing apparatus of the fourth embodiment is the same as that of the video camera 102 of the second embodiment shown in FIG. 7, and the flash emission detection process in the flash detection unit 20 is different from that of the second embodiment. The flash emission detection process in the fourth embodiment will be described with reference to FIGS. In the fourth embodiment, the step S3 4 shown in FIG. 13 the flash detection and correction in the step S3 shown in FIG. With reference to FIG. 13, detailed description will be given of a flash detection and correction in the step S3 4. In FIG. 13, the same steps as those in FIG. 8 are denoted by the same reference numerals, and the description thereof is omitted as appropriate.

ステップS321〜S326の処理は、図8と同じである。フラッシュ検出部20は、ステップS327にて、ライン平均輝度と全画面平均輝度との差分値が閾値(閾値1)以上のラインを検出したか否かを判定する。ライン平均輝度と全画面平均輝度との差分値が閾値以上のラインを検出したと判定されれば(YES)、フラッシュ検出部20は、処理をステップS361に移行させ、ライン平均輝度と全画面平均輝度との差分値が閾値以上のラインを検出したと判定されなければ(NO)、フラッシュ検出部20は、処理をステップS337に移行させる。   The processing in steps S321 to S326 is the same as that in FIG. In step S327, the flash detection unit 20 determines whether or not a line having a difference value between the line average luminance and the entire screen average luminance equal to or greater than a threshold (threshold 1) is detected. If it is determined that a line whose difference value between the line average luminance and the entire screen average luminance is equal to or larger than the threshold is detected (YES), the flash detection unit 20 shifts the process to step S361, and the line average luminance and the entire screen average. If it is not determined that a line having a difference value with respect to the luminance is not less than the threshold value (NO), the flash detection unit 20 shifts the process to step S337.

フラッシュ検出部20は、ライン平均輝度と全画面平均輝度との差分値が閾値以上のラインを検出した場合、ステップS361にて、1ライン前の全てのブロックにおいて、ブロック平均輝度と全画面平均輝度との差分値が閾値未満であるか否かを判定する。ステップS361における閾値は、ステップS328における閾値2と同じでもよく、多少異ならせてもよい。ここではステップS361における閾値を閾値2とする。   If the flash detection unit 20 detects a line whose difference value between the line average luminance and the entire screen average luminance is equal to or larger than the threshold, in step S361, the block average luminance and the entire screen average luminance in all the blocks one line before. It is determined whether or not the difference value is less than a threshold value. The threshold value in step S361 may be the same as the threshold value 2 in step S328, or may be slightly different. Here, the threshold value in step S361 is set to threshold value 2.

1ライン前の全てのブロックにおいて、ブロック平均輝度と全画面平均輝度との差分値が閾値(閾値2)未満であると判定されれば(YES)、フラッシュ検出部20は、処理をステップS328に移行させ、1つのブロックでもブロック平均輝度と全画面平均輝度との差分値が閾値(閾値2)以上であれば(NO)、フラッシュ検出部20は、処理をステップS337に移行させる。   If it is determined that the difference value between the block average luminance and the entire screen average luminance is less than the threshold value (threshold value 2) in all blocks one line before (YES), the flash detection unit 20 advances the process to step S328. If the difference value between the block average brightness and the entire screen average brightness is equal to or greater than the threshold (threshold 2) even in one block (NO), the flash detection unit 20 shifts the process to step S337.

ステップS328以降の処理は、図8と同じである。フラッシュ検出部20は、ステップS329にて、ライン平均輝度と全画面平均輝度との差分値が閾値以上であり、それぞれのブロック平均輝度と全画面平均輝度との差分値が閾値以上であるという2つの条件を満たす特定状態のラインが所定ライン数以上継続したか否かを判定する。第4実施形態においては、ステップS361にて、1ライン前の全てのブロックにおいて、ブロック平均輝度と全画面平均輝度との差分値が閾値未満であると判定されたときのみ、現在のラインが特定状態に該当するラインであると判定して、ステップS329の処理が実行されることになる。   The processing after step S328 is the same as that in FIG. In step S329, the flash detection unit 20 determines that the difference value between the line average luminance and the entire screen average luminance is greater than or equal to the threshold, and the difference value between each block average luminance and the entire screen average luminance is greater than or equal to the threshold. It is determined whether or not a line in a specific state satisfying one condition has continued for a predetermined number of lines or more. In the fourth embodiment, the current line is specified only when it is determined in step S361 that the difference value between the block average luminance and the full screen average luminance is less than the threshold in all blocks one line before. It is determined that the line corresponds to the state, and the process of step S329 is executed.

図14を用いて、ステップS361を設けることによる効果について説明する。図14は、画面内に部分的に例えば台形状の高輝度領域Arh1が含まれる画像Imi1の例を示している。ハッチングを付した高輝度領域Arh1は例えば白レベルであるとする。高輝度領域Arh1は台形状でなくてもよく、高輝度となっている領域の最上端の位置が水平方向の位置においてばらついているような画像であってもよい。画像Imi1の1フレーム前は、高輝度領域Arh1を含まない通常の画像であるとする。   The effect of providing step S361 will be described using FIG. FIG. 14 shows an example of an image Imi1 in which, for example, a trapezoidal high luminance area Arh1 is partially included in the screen. The hatched high luminance area Arh1 is assumed to be at a white level, for example. The high luminance area Arh1 does not have to be trapezoidal and may be an image in which the position of the uppermost end of the high luminance area varies in the horizontal position. It is assumed that one frame before the image Imi1 is a normal image that does not include the high luminance area Arh1.

図14では理解を容易にするため、高輝度領域Arh1における有効ラインLne1の1ライン前の有効ラインLne0が図示の位置であるとする。有効ラインLne0においては、ブロックB1ではブロック平均輝度と全画面平均輝度との差分値は比較的小さい値となるものの、ブロックB2〜B4ではブロック平均輝度と全画面平均輝度との差分値は比較的大きな値となる。従って、有効ラインLne1が現在のラインであるとき、1ライン前の全てのブロックにおいて、ブロック平均輝度と全画面平均輝度との差分値が閾値未満とはならない。従って、フラッシュ検出部20は、ステップS361の処理によって、高輝度領域Arh1がフラッシュの発光による高輝度領域であると誤検出することはない。   In FIG. 14, for the sake of easy understanding, it is assumed that the effective line Lne0 one line before the effective line Lne1 in the high luminance area Arh1 is the position shown in the drawing. In the effective line Lne0, the difference value between the block average luminance and the full screen average luminance is relatively small in the block B1, but the difference value between the block average luminance and the full screen average luminance is relatively small in the blocks B2 to B4. Large value. Therefore, when the effective line Lne1 is the current line, the difference value between the block average luminance and the entire screen average luminance is not less than the threshold in all the blocks one line before. Therefore, the flash detection unit 20 does not erroneously detect that the high-luminance area Arh1 is a high-luminance area due to flash emission by the process of step S361.

現在のラインが有効ラインLne1以降となった場合には、ブロックB1〜B4の全てで、ブロック平均輝度と全画面平均輝度との差分値は比較的大きな値となる。従って、同様に、フラッシュ検出部20は、ステップS361の処理によって、高輝度領域Arh1がフラッシュの発光による高輝度領域であると誤検出することはない。   When the current line is after the effective line Lne1, the difference value between the block average luminance and the entire screen average luminance is relatively large in all of the blocks B1 to B4. Accordingly, similarly, the flash detection unit 20 does not erroneously detect that the high-brightness area Arh1 is a high-brightness area due to flash emission by the process of step S361.

第4実施形態においては、差分算出部207は、1ライン前のそれぞれのブロックのブロック平均輝度と全画面平均輝度との差分値を保持しておけばよい。   In the fourth embodiment, the difference calculation unit 207 may hold a difference value between the block average luminance of each block one line before and the entire screen average luminance.

第4実施形態によれば、図14の例のように高輝度領域Arh1を含む画像Imi1であっても、フラッシュが発光したと誤判定する可能性を第2実施形態よりも低減させることができる。   According to the fourth embodiment, even in the case of an image Imi1 including the high brightness area Arh1 as in the example of FIG. 14, the possibility of misjudging that the flash has been emitted can be reduced as compared with the second embodiment. .

第4実施形態では、現在のラインの1ライン前におけるブロック平均輝度と全画面平均輝度との差分値が閾値未満であるか否かを判定しているが、例えば2〜3ライン前におけるブロック平均輝度と全画面平均輝度との差分値が閾値未満であるか否かを判定してもよい。即ち、現在のラインの近傍であり、現在のラインより上方のラインにおけるブロック平均輝度と全画面平均輝度との差分値が閾値未満であるか否かを判定すればよい。なお、ステップS327,S361,S328の順は、図13に示す順に限定されることはなく、順番を適宜入れ替えてもよい。   In the fourth embodiment, it is determined whether or not the difference value between the block average brightness one line before the current line and the entire screen average brightness is less than the threshold. For example, the block average before two to three lines You may determine whether the difference value of a brightness | luminance and a full screen average brightness | luminance is less than a threshold value. That is, it is only necessary to determine whether or not the difference value between the block average luminance and the full screen average luminance in the vicinity of the current line and above the current line is less than the threshold value. Note that the order of steps S327, S361, and S328 is not limited to the order shown in FIG. 13, and the order may be changed as appropriate.

第4実施形態においても、第1実施形態と同様、ステップS333においてライン平均輝度と全画面平均輝度との差分値と比較する閾値を、ステップS327においてライン平均輝度と全画面平均輝度との差分値と比較する閾値よりも小さな値とすることが好ましい。   Also in the fourth embodiment, as in the first embodiment, the threshold value to be compared with the difference value between the line average luminance and the entire screen average luminance in step S333, and the difference value between the line average luminance and the entire screen average luminance in step S327. It is preferable to set a value smaller than a threshold value to be compared with.

以上説明した第4実施形態の構成と第3実施形態の構成とを組み合わせることが好ましい。   It is preferable to combine the configuration of the fourth embodiment described above and the configuration of the third embodiment.

<第5実施形態>
第5実施形態の画像処理装置の構成は、図7に示す第2実施形態のビデオカメラ102と同様であり、フラッシュ検出部20におけるフラッシュ発光の検出処理が第2実施形態とは異なっている。図15を用いて、第5実施形態におけるフラッシュ発光の検出処理について説明する。第5実施形態においては、図3に示すステップS3のフラッシュ検出・補正処理を図15に示すステップS3とする。図15を用いて、ステップS3のフラッシュ検出・補正処理の詳細について説明する。図15において、図8と同一のステップには同一の符号を付し、その説明を適宜省略する。
<Fifth Embodiment>
The configuration of the image processing apparatus of the fifth embodiment is the same as that of the video camera 102 of the second embodiment shown in FIG. 7, and the flash emission detection process in the flash detection unit 20 is different from that of the second embodiment. The flash emission detection process in the fifth embodiment will be described with reference to FIG. In the fifth embodiment, the step S3 5 shown in FIG. 15 the flash detection and correction in the step S3 shown in FIG. With reference to FIG. 15, detailed description will be given of a flash detection and correction in the step S3 5. In FIG. 15, the same steps as those in FIG. 8 are denoted by the same reference numerals, and the description thereof is omitted as appropriate.

ステップS321〜S326の処理は、図8と同じである。フラッシュ検出部20は、ステップS327にて、ライン平均輝度と全画面平均輝度との差分値が閾値(閾値1)以上のラインを検出したか否かを判定する。ライン平均輝度と全画面平均輝度との差分値が閾値以上のラインを検出したと判定されれば(YES)、フラッシュ検出部20は、処理をステップS371に移行させ、ライン平均輝度と全画面平均輝度との差分値が閾値以上のラインを検出したと判定されなければ(NO)、フラッシュ検出部20は、処理をステップS337に移行させる。   The processing in steps S321 to S326 is the same as that in FIG. In step S327, the flash detection unit 20 determines whether or not a line having a difference value between the line average luminance and the entire screen average luminance equal to or greater than a threshold (threshold 1) is detected. If it is determined that a line whose difference value between the line average luminance and the entire screen average luminance is equal to or greater than the threshold is detected (YES), the flash detection unit 20 shifts the process to step S371, and the line average luminance and the entire screen average. If it is not determined that a line having a difference value with respect to the luminance is not less than the threshold value (NO), the flash detection unit 20 shifts the process to step S337.

フラッシュ検出部20は、ライン平均輝度と全画面平均輝度との差分値が閾値以上のラインを検出した場合、ステップS371にて、現在のラインと同一の画面内において、現在のラインのそれぞれのブロック平均輝度と、1ライン前のそれぞれのブロック平均輝度との差分値が所定の閾値以上であるか否かを判定する。フラッシュ検出部20は、現在のラインと1ライン前とで、同じ水平方向の位置のブロックのブロック平均輝度どうしを比較する。ステップS371における閾値(閾値3)は、ステップS328における閾値2と同じである必要はなく、値を適宜設定すればよい。   If the flash detection unit 20 detects a line whose difference value between the line average luminance and the entire screen average luminance is equal to or larger than the threshold value, in step S371, each block of the current line in the same screen as the current line is detected. It is determined whether or not the difference value between the average luminance and the average luminance of each block one line before is equal to or greater than a predetermined threshold value. The flash detection unit 20 compares the block average luminances of the blocks at the same horizontal position between the current line and the previous line. The threshold value (threshold value 3) in step S371 does not have to be the same as the threshold value 2 in step S328, and may be set as appropriate.

現在のラインのブロック平均輝度と1ライン前のブロック平均輝度との差分値が全て閾値以上であると判定されれば(YES)、フラッシュ検出部20は、処理をステップS328に移行させ、1つのブロックでもブロック平均輝度の差分値が閾値未満であれば(NO)、フラッシュ検出部20は、処理をステップS337に移行させる。   If it is determined that the difference values between the block average brightness of the current line and the block average brightness of the previous line are all equal to or greater than the threshold (YES), the flash detection unit 20 moves the process to step S328, If the difference value of the block average luminance is less than the threshold value even for the block (NO), the flash detection unit 20 moves the process to step S337.

ステップS328以降の処理は、図8と同じである。第5実施形態においては、ステップS371にて、現在のラインのブロック平均輝度と1ライン前のブロック平均輝度との差分値が全て閾値以上であると判定されたときのみ、現在のラインが特定状態に該当するラインであると判定して、ステップS329の処理が実行されることになる。   The processing after step S328 is the same as that in FIG. In the fifth embodiment, the current line is in the specific state only when it is determined in step S371 that the difference values between the block average brightness of the current line and the block average brightness of the previous line are all equal to or greater than the threshold value. Therefore, the process of step S329 is executed.

図14を用いて、ステップS371を設けることによる効果について説明する。第5実施形態の場合には、有効ラインLne1が現在のラインであるとき、有効ラインLne1のブロックB1〜B4のブロック平均輝度と、1ライン前の有効ラインLne0のブロックB1〜B4のブロック平均輝度とを比較すると、ブロックB1では閾値以上となるものの、ブロックB2〜B4では閾値以上とはならない。有効ラインLne0や有効ラインLne0より上方のラインが現在のラインである場合も同様に、全て閾値以上であるとは判定されない。従って、フラッシュ検出部20は、ステップS371の処理によって、高輝度領域Arh1がフラッシュの発光による高輝度領域であると誤検出することはない。   The effect by providing step S371 will be described using FIG. In the case of the fifth embodiment, when the effective line Lne1 is the current line, the block average luminance of the blocks B1 to B4 of the effective line Lne1 and the block average luminance of the blocks B1 to B4 of the effective line Lne0 one line before. , The block B1 is equal to or greater than the threshold, but the blocks B2 to B4 are not equal to or greater than the threshold. Similarly, when the effective line Lne0 or the line above the effective line Lne0 is the current line, it is not determined that all are equal to or greater than the threshold value. Therefore, the flash detection unit 20 does not erroneously detect that the high brightness area Arh1 is a high brightness area due to flash emission by the process of step S371.

現在のラインが有効ラインLne1以降となった場合には、ブロックB1〜B4の全てで、現在のラインのブロック平均輝度と1ライン前のブロック平均輝度との差分値が比較的小さな値となる。従って、同様に、フラッシュ検出部20は、ステップS371の処理によって、高輝度領域Arh1がフラッシュの発光による高輝度領域であると誤検出することはない。   When the current line is after the effective line Lne1, the difference value between the block average luminance of the current line and the block average luminance of the previous line is relatively small in all the blocks B1 to B4. Accordingly, similarly, the flash detection unit 20 does not erroneously detect that the high-brightness area Arh1 is a high-brightness area due to flash emission by the process of step S371.

第5実施形態においては、差分算出部207は、1ライン前のそれぞれのブロックのブロック平均輝度を保持しておき、現在のラインのブロック平均輝度と1ライン前のブロック平均輝度との差分値を算出すればよい。   In the fifth embodiment, the difference calculation unit 207 holds the block average luminance of each block one line before, and calculates the difference value between the block average luminance of the current line and the block average luminance of the previous line. What is necessary is just to calculate.

第5実施形態によれば、図14の例のように高輝度領域Arh1を含む画像Imi1であっても、フラッシュが発光したと誤判定する可能性を第2実施形態よりも低減させることができる。   According to the fifth embodiment, it is possible to reduce the possibility of erroneous determination that the flash has emitted even in the case of the image Imi1 including the high luminance area Arh1 as in the example of FIG. .

第5実施形態においては、現在のラインのブロック平均輝度と1ライン前のブロック平均輝度との差分値が閾値以上であるか否かを判定しているが、例えば現在のラインのブロック平均輝度と2〜3ライン前のブロック平均輝度との差分値が閾値以上であるか否かを判定してもよい。即ち、同一画面内において、現在のラインのブロック平均輝度と、現在のラインの近傍であり、現在のラインより上方のラインにおけるブロック平均輝度との差分値が閾値以上であるか否かを判定すればよい。なお、ステップS327,S371,S328の順は、図15に示す順に限定されることはなく、順番を適宜入れ替えてもよい。   In the fifth embodiment, it is determined whether or not the difference value between the block average luminance of the current line and the block average luminance of the previous line is equal to or greater than a threshold value. You may determine whether the difference value with the block average brightness | luminance of 2-3 lines before is more than a threshold value. That is, in the same screen, it is determined whether or not the difference value between the block average brightness of the current line and the block average brightness of the line near the current line and above the current line is equal to or greater than the threshold value. That's fine. Note that the order of steps S327, S371, and S328 is not limited to the order shown in FIG. 15, and the order may be appropriately changed.

第5実施形態においても、第1実施形態と同様、ステップS333においてライン平均輝度と全画面平均輝度との差分値と比較する閾値を、ステップS327においてライン平均輝度と全画面平均輝度との差分値と比較する閾値よりも小さな値とすることが好ましい。   Also in the fifth embodiment, as in the first embodiment, the threshold value to be compared with the difference value between the line average luminance and the whole screen average luminance in step S333, and the difference value between the line average luminance and the whole screen average luminance in step S327. It is preferable to set a value smaller than a threshold value to be compared with.

以上説明した第5実施形態の構成と第3実施形態の構成とを組み合わせることが好ましい。第4実施形態の構成と第5実施形態の構成とを組み合わせることも可能である。   It is preferable to combine the configuration of the fifth embodiment described above and the configuration of the third embodiment. It is also possible to combine the configuration of the fourth embodiment and the configuration of the fifth embodiment.

本発明は以上説明した各実施形態に限定されるものではなく、本発明の要旨を逸脱しない範囲において種々変更可能である。各実施形態ではビデオカメラを例としたが、画像データを扱う任意の電子機器において本発明の画像処理装置、画像処理方法、画像処理プログラムを用いることができる。例えば、画像表示装置やコンピュータ等の情報処理装置において各実施形態の画像処理装置を搭載し、画面の一部が高輝度となっている画像データを画像表示装置や情報処理装置の内部で補正するようにしてもよい。   The present invention is not limited to the embodiments described above, and various modifications can be made without departing from the scope of the present invention. In each embodiment, a video camera is taken as an example. However, the image processing apparatus, the image processing method, and the image processing program of the present invention can be used in any electronic device that handles image data. For example, the image processing apparatus according to each embodiment is mounted on an information processing apparatus such as an image display apparatus or a computer, and image data in which part of the screen has high brightness is corrected inside the image display apparatus or information processing apparatus. You may do it.

また、各実施形態においては、画像信号処理部3での処理を終了した映像データを補正する構成を示したが、画像信号処理部3での処理する前の映像データを補正してもよい。各実施形態においては、画像信号処理部3や圧縮伸張処理部5とは独立して設けたバッファメモリ4を用いる構成を示したが、画像信号処理部3や圧縮伸張処理部5で使用するバッファメモリを用いてもよく、回路(ブロック)構成は適宜に変更が可能である。   Moreover, in each embodiment, although the structure which correct | amends the video data which complete | finished the process in the image signal process part 3 was shown, you may correct | amend the video data before the process in the image signal process part 3. FIG. In each embodiment, the configuration using the buffer memory 4 provided independently of the image signal processing unit 3 and the compression / decompression processing unit 5 has been described. However, the buffer used in the image signal processing unit 3 and the compression / decompression processing unit 5 is described. A memory may be used, and the circuit (block) configuration can be changed as appropriate.

本発明の画像処理プログラムを記録媒体に記録して提供してもよく、インターネット等の通信回線にて画像処理プログラムを配信してもよい。記録媒体に記録された画像処理プログラムや通信回線にて配信された画像処理プログラムを画像処理装置に記憶させて、上述した画像処理方法を実行させるようにしてもよい。   The image processing program of the present invention may be provided by being recorded on a recording medium, or the image processing program may be distributed through a communication line such as the Internet. An image processing program recorded on a recording medium or an image processing program distributed via a communication line may be stored in an image processing apparatus to execute the above-described image processing method.

1 撮像部
1s CMOSセンサ
2,20 フラッシュ検出部
3 画像信号処理部
4 バッファメモリ(保持部)
5 圧縮伸張処理部
6 出力信号処理部
7 表示部
8 フラッシュ補正部
9 制御部(コンピュータ)
10 メモリ
11 記録再生部
12 操作スイッチ
21,203 ライン平均輝度算出部
23,205 全画面平均輝度算出部
25,207 差分算出部
26,208 フラッシュ判定部
101,102 ビデオカメラ
201 ブロック平均輝度算出部
DESCRIPTION OF SYMBOLS 1 Image pick-up part 1s CMOS sensor 2,20 Flash detection part 3 Image signal processing part 4 Buffer memory (holding part)
5 Compression / Expansion Processing Unit 6 Output Signal Processing Unit 7 Display Unit 8 Flash Correction Unit 9 Control Unit (Computer)
DESCRIPTION OF SYMBOLS 10 Memory 11 Recording / reproducing part 12 Operation switch 21,203 Line average brightness | luminance calculation part 23,205 Whole screen average brightness | luminance calculation part 25,207 Difference calculation part 26,208 Flash determination part 101,102 Video camera 201 Block average brightness | luminance calculation part

Claims (12)

画像データの現在の画面におけるそれぞれのラインのライン平均輝度と、前記現在の画面の少なくとも1画面前の画面である過去の画面の全画面平均輝度と算出し、それぞれのラインの前記ライン平均輝度と前記全画面平均輝度とを比較することによって、画面の一部のラインがフラッシュの発光によって高輝度となっているか否かを検出するフラッシュ検出部と、
前記画像データの前記過去の画面を保持する保持部と、
前記フラッシュ検出部によって前記現在の画面の一部のラインが高輝度となっていることが検出されたら、前記現在の画面における高輝度となっているラインを前記保持部に保持された前記過去の画面のラインに置換することにより画像データを補正するフラッシュ補正部と、
を備えることを特徴とする画像処理装置。
The line average brightness of each line in the current screen of the image data and the total screen average brightness of the past screen that is at least one screen before the current screen are calculated, and the line average brightness of each line A flash detection unit that detects whether or not a part of the screen has high brightness due to flash emission by comparing the entire screen average brightness;
A holding unit for holding the past screen of the image data;
When the flash detection unit detects that some lines of the current screen have high brightness, the past lines stored in the holding unit are displayed with high brightness lines on the current screen. A flash correction unit that corrects image data by replacing it with a line on the screen;
An image processing apparatus comprising:
前記フラッシュ検出部は、前記ライン平均輝度と前記全画面平均輝度との差分が第1の閾値以上であるラインに基づいて、フラッシュの発光によって高輝度となっている複数のラインの開始ラインを決定し、前記ライン平均輝度と前記全画面平均輝度との差分が、前記第1の閾値より小さい値である第2の閾値未満であるラインに基づいて、フラッシュの発光によって高輝度となっている複数のラインの終了ラインを決定することを特徴とする請求項1記載の画像処理装置。   The flash detection unit determines start lines of a plurality of lines having high luminance due to flash emission based on a line having a difference between the line average luminance and the full screen average luminance equal to or greater than a first threshold. A plurality of lines having a difference between the line average luminance and the full-screen average luminance that is high due to flash emission based on a line that is less than a second threshold that is smaller than the first threshold. The image processing apparatus according to claim 1, wherein an end line of the first line is determined. 前記フラッシュ検出部は、フラッシュの発光によって高輝度となっている最初のラインであるフラッシュ開始ラインと最後のラインであるフラッシュ終了ラインとを検出し、
前記フラッシュ補正部は、前記フラッシュ開始ラインよりも上方に位置し、前記フラッシュ開始ラインに隣接する第1の隣接領域と、前記フラッシュ終了ラインよりも下方に位置し、前記フラッシュ終了ラインに隣接する第2の隣接領域とをそれぞれ設定し、前記第1の隣接領域では、前記第1の隣接領域の最初のラインから最後のラインに進行するに従って前記現在の画面の画像データを順次減少させ、前記過去の画面の画像データを順次増加させるように両者の画像データを混合し、前記第2の隣接領域では、前記第2の隣接領域の最初のラインから最後のラインに進行するに従って前記過去の画面の画像データを順次減少させ、前記現在の画面の画像データを順次増加させるように両者の画像データを混合する
ことを特徴とする請求項1または2に記載の画像処理装置。
The flash detection unit detects a flash start line and a flash end line that are the first line that has become bright due to flash emission, and the last line,
The flash correction unit is positioned above the flash start line, adjacent to the flash start line, positioned below the flash end line, and adjacent to the flash end line. 2 adjacent regions are set, and in the first adjacent region, the image data of the current screen is sequentially reduced as the first line advances from the first line to the last line of the first adjacent region, and the past Both image data are mixed so as to sequentially increase the image data of the screen of the previous screen, and in the second adjacent area, the past screen of the previous screen is progressed from the first line to the last line of the second adjacent area. The both image data are mixed so that the image data is sequentially decreased and the image data of the current screen is sequentially increased. The image processing apparatus according to 1 or 2.
前記フラッシュ検出部は、フラッシュの発光によって高輝度となっている最初のラインであるフラッシュ開始ラインと最後のラインであるフラッシュ終了ラインとを検出し、
前記フラッシュ補正部は、前記フラッシュ開始ラインよりも上方に位置し、前記フラッシュ開始ラインに隣接する第1の隣接領域と、前記フラッシュ終了ラインよりも下方に位置し、前記フラッシュ終了ラインに隣接する第2の隣接領域とをそれぞれ設定し、前記第1及び第2の隣接領域では、前記第1及び第2の隣接領域内のそれぞれの画素の明るさが第の閾値より小さければ前記現在の画面の画素データのみとし、前記第の閾値より大きい値である第の閾値より大きければ前記過去の画面の画素データのみとし、前記第の閾値以上前記第の閾値以下であれば前記現在の画面の画素データと前記過去の画面の画素データとを混合する
ことを特徴とする請求項1または2に記載の画像処理装置。
The flash detection unit detects a flash start line and a flash end line that are the first line that has become bright due to flash emission, and the last line,
The flash correction unit is positioned above the flash start line, adjacent to the flash start line, positioned below the flash end line, and adjacent to the flash end line. If the brightness of each pixel in the first and second adjacent areas is smaller than a third threshold in the first and second adjacent areas, the current screen is set. Only the pixel data of the past screen if it is larger than the fourth threshold value, which is larger than the third threshold value, and the current data if it is greater than or equal to the third threshold value and less than or equal to the fourth threshold value. The image processing apparatus according to claim 1, wherein the pixel data of the screen and the pixel data of the past screen are mixed.
画像データにおける現在の画面におけるそれぞれのラインのライン平均輝度を算出し、
前記画像データにおける前記現在の画面の少なくとも1画面前の画面である過去の画面の全画面平均輝度を算出し、
それぞれのラインの前記ライン平均輝度と前記全画面平均輝度とを比較することによって、画面の一部のラインがフラッシュの発光によって高輝度となっているか否かを検出し、
前記画像データの前記過去の画面を保持部に保持し、
前記現在の画面の一部のラインが高輝度となっていることが検出されたら、前記現在の画面における高輝度となっているラインを前記保持部に保持された前記過去の画面のラインに置換することにより画像データを補正する
ことを特徴とする画像処理方法。
Calculate the line average brightness of each line on the current screen in the image data,
Calculating an average brightness of the entire screen of a past screen that is at least one screen before the current screen in the image data;
By comparing the line average brightness of each line and the entire screen average brightness, it is detected whether or not some lines of the screen are high brightness by flash emission,
Holding the past screen of the image data in a holding unit;
When it is detected that some lines of the current screen have high brightness, the lines having high brightness on the current screen are replaced with the lines of the past screen held in the holding unit. An image processing method characterized by correcting image data by doing.
前記ライン平均輝度と前記全画面平均輝度との差分が第1の閾値以上であるラインに基づいて、フラッシュの発光によって高輝度となっている複数のラインの開始ラインを決定し、前記ライン平均輝度と前記全画面平均輝度との差分が、前記第1の閾値より小さい値である第2の閾値未満であるラインに基づいて、フラッシュの発光によって高輝度となっている複数のラインの終了ラインを決定することを特徴とする請求項5記載の画像処理方法。   Based on a line having a difference between the line average luminance and the full screen average luminance equal to or greater than a first threshold, a start line of a plurality of lines having high luminance due to flash emission is determined, and the line average luminance is determined. And an end line of a plurality of lines having high luminance due to flash emission based on a line having a difference between the average luminance of the entire screen and the whole screen average luminance of less than the second threshold which is smaller than the first threshold. The image processing method according to claim 5, wherein the determination is performed. フラッシュの発光によって高輝度となっている最初のラインであるフラッシュ開始ラインと最後のラインであるフラッシュ終了ラインとを検出し、
前記フラッシュ開始ラインよりも上方に位置し、前記フラッシュ開始ラインに隣接する第1の隣接領域と、前記フラッシュ終了ラインよりも下方に位置し、前記フラッシュ終了ラインに隣接する第2の隣接領域とをそれぞれ設定し、
前記第1の隣接領域では、前記第1の隣接領域の最初のラインから最後のラインに進行するに従って前記現在の画面の画像データを順次減少させ、前記過去の画面の画像データを順次増加させるように両者の画像データを混合し、
前記第2の隣接領域では、前記第2の隣接領域の最初のラインから最後のラインに進行するに従って前記過去の画面の画像データを順次減少させ、前記現在の画面の画像データを順次増加させるように両者の画像データを混合する
ことを特徴とする請求項5または6に記載の画像処理方法。
Detecting the flash start line that is the first line that is bright due to the flash emission and the flash end line that is the last line,
A first adjacent region located above the flash start line and adjacent to the flash start line; and a second adjacent region located below the flash end line and adjacent to the flash end line. Set each one
In the first adjacent region, the image data of the current screen is sequentially decreased and the image data of the past screen is sequentially increased as progressing from the first line to the last line of the first adjacent region. To mix both image data,
In the second adjacent area, the image data of the past screen is sequentially decreased and the image data of the current screen is sequentially increased as progressing from the first line to the last line of the second adjacent area. The image processing method according to claim 5, wherein both image data are mixed together.
フラッシュの発光によって高輝度となっている最初のラインであるフラッシュ開始ラインと最後のラインであるフラッシュ終了ラインとを検出し、
前記フラッシュ開始ラインよりも上方に位置し、前記フラッシュ開始ラインに隣接する第1の隣接領域と、前記フラッシュ終了ラインよりも下方に位置し、前記フラッシュ終了ラインに隣接する第2の隣接領域とをそれぞれ設定し、
前記第1及び第2の隣接領域では、前記第1及び第2の隣接領域内のそれぞれの画素の明るさが第の閾値より小さければ前記現在の画面の画素データのみとし、前記第の閾値より大きい値である第の閾値より大きければ前記過去の画面の画素データのみとし、前記第の閾値以上前記第の閾値以下であれば前記現在の画面の画素データと前記過去の画面の画素データとを混合する
ことを特徴とする請求項5または6に記載の画像処理方法。
Detecting the flash start line that is the first line that is bright due to the flash emission and the flash end line that is the last line,
A first adjacent region located above the flash start line and adjacent to the flash start line; and a second adjacent region located below the flash end line and adjacent to the flash end line. Set each one
In the first and second adjacent areas, if the brightness of each pixel in the first and second adjacent areas is smaller than a third threshold value, only the pixel data of the current screen is set, and the third fourth only the pixel data of the past on the screen is larger and the threshold, the third threshold value or greater than the fourth of the current if the threshold value or less screen pixel data and the previous screen is larger than the threshold value The image processing method according to claim 5, wherein the pixel data is mixed.
コンピュータに、
画像データにおける現在の画面におけるそれぞれのラインのライン平均輝度を算出する機能と、
前記画像データにおける前記現在の画面の少なくとも1画面前の画面である過去の画面の全画面平均輝度を算出する機能と、
それぞれのラインの前記ライン平均輝度と前記全画面平均輝度とを比較することによって、画面の一部のラインがフラッシュの発光によって高輝度となっているか否かを検出する機能と、
前記現在の画面の一部のラインが高輝度となっていることが検出されたら、前記現在の画面における高輝度となっているラインを保持部に保持された前記過去の画面のラインに置換することにより画像データを補正する機能と、
を実現させることを特徴とする画像処理プログラム。
On the computer,
A function for calculating the line average brightness of each line on the current screen in the image data;
A function of calculating a total screen average brightness of a past screen that is at least one screen before the current screen in the image data;
A function of detecting whether or not some lines of the screen have high brightness due to flash emission by comparing the line average brightness of each line and the entire screen average brightness;
When it is detected that some lines of the current screen have high brightness, the lines having high brightness on the current screen are replaced with the lines of the past screen held in the holding unit. A function to correct the image data by
An image processing program characterized by realizing the above.
コンピュータに、前記ライン平均輝度と前記全画面平均輝度との差分が第1の閾値以上であるラインに基づいて、フラッシュの発光によって高輝度となっている複数のラインの開始ラインを決定させ、前記ライン平均輝度と前記全画面平均輝度との差分が、前記第1の閾値より小さい値である第2の閾値未満であるラインに基づいて、フラッシュの発光によって高輝度となっている複数のラインの終了ラインを決定させる機能を実現させることを特徴とする請求項9記載の画像処理プログラム。   Based on a line having a difference between the line average brightness and the full screen average brightness equal to or greater than a first threshold, the computer determines start lines of a plurality of lines that are bright due to flash emission, Based on a line whose difference between the line average brightness and the full screen average brightness is less than the second threshold value, which is smaller than the first threshold value, a plurality of lines having high brightness due to flash emission. The image processing program according to claim 9, wherein a function for determining an end line is realized. 前記コンピュータに、
フラッシュの発光によって高輝度となっている最初のラインであるフラッシュ開始ラインと最後のラインであるフラッシュ終了ラインとを検出する機能と、
前記フラッシュ開始ラインよりも上方に位置し、前記フラッシュ開始ラインに隣接する第1の隣接領域と、前記フラッシュ終了ラインよりも下方に位置し、前記フラッシュ終了ラインに隣接する第2の隣接領域とをそれぞれ設定する機能と、
前記第1の隣接領域では、前記第1の隣接領域の最初のラインから最後のラインに進行するに従って前記現在の画面の画像データを順次減少させ、前記過去の画面の画像データを順次増加させるように両者の画像データを混合する機能と、
前記第2の隣接領域では、前記第2の隣接領域の最初のラインから最後のラインに進行するに従って前記過去の画面の画像データを順次減少させ、前記現在の画面の画像データを順次増加させるように両者の画像データを混合する機能と、
を実現させることを特徴とする請求項9または10に記載の画像処理プログラム。
In the computer,
A function for detecting a flash start line that is a first line and a flash end line that is a last line that is bright due to flash emission; and
A first adjacent region located above the flash start line and adjacent to the flash start line; and a second adjacent region located below the flash end line and adjacent to the flash end line. The functions to set,
In the first adjacent region, the image data of the current screen is sequentially decreased and the image data of the past screen is sequentially increased as progressing from the first line to the last line of the first adjacent region. And a function to mix both image data,
In the second adjacent area, the image data of the past screen is sequentially decreased and the image data of the current screen is sequentially increased as progressing from the first line to the last line of the second adjacent area. And a function to mix both image data,
The image processing program according to claim 9, wherein the image processing program is realized.
前記コンピュータに、
フラッシュの発光によって高輝度となっている最初のラインであるフラッシュ開始ラインと最後のラインであるフラッシュ終了ラインとを検出する機能と、
前記フラッシュ開始ラインよりも上方に位置し、前記フラッシュ開始ラインに隣接する第1の隣接領域と、前記フラッシュ終了ラインよりも下方に位置し、前記フラッシュ終了ラインに隣接する第2の隣接領域とをそれぞれ設定する機能と、
前記第1及び第2の隣接領域では、前記第1及び第2の隣接領域内のそれぞれの画素の明るさが第の閾値より小さければ前記現在の画面の画素データのみとし、前記第の閾値より大きい値である第の閾値より大きければ前記過去の画面の画素データのみとし、前記第の閾値以上前記第の閾値以下であれば前記現在の画面の画素データと前記過去の画面の画素データとを混合する機能と、
を実現させることを特徴とする請求項9または10に記載の画像処理プログラム。
In the computer,
A function for detecting a flash start line that is a first line and a flash end line that is a last line that is bright due to flash emission; and
A first adjacent region located above the flash start line and adjacent to the flash start line; and a second adjacent region located below the flash end line and adjacent to the flash end line. The functions to set,
In the first and second adjacent areas, if the brightness of each pixel in the first and second adjacent areas is smaller than a third threshold value, only the pixel data of the current screen is set, and the third fourth only the pixel data of the past on the screen is larger and the threshold, the third threshold value or greater than the fourth of the current if the threshold value or less screen pixel data and the previous screen is larger than the threshold value The function of mixing the pixel data of
The image processing program according to claim 9, wherein the image processing program is realized.
JP2012229508A 2012-02-14 2012-10-17 Image processing apparatus, image processing method, and image processing program Active JP5928290B2 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2012229508A JP5928290B2 (en) 2012-02-14 2012-10-17 Image processing apparatus, image processing method, and image processing program
US13/749,184 US8947588B2 (en) 2012-02-14 2013-01-24 Image processing device, image processing method, image processing program
EP13000704.0A EP2629508B1 (en) 2012-02-14 2013-02-11 Image processing device, image processing method, image processing program for flash detection

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2012029318 2012-02-14
JP2012029318 2012-02-14
JP2012229508A JP5928290B2 (en) 2012-02-14 2012-10-17 Image processing apparatus, image processing method, and image processing program

Publications (2)

Publication Number Publication Date
JP2013192201A JP2013192201A (en) 2013-09-26
JP5928290B2 true JP5928290B2 (en) 2016-06-01

Family

ID=49391999

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012229508A Active JP5928290B2 (en) 2012-02-14 2012-10-17 Image processing apparatus, image processing method, and image processing program

Country Status (1)

Country Link
JP (1) JP5928290B2 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4885902B2 (en) * 2008-04-01 2012-02-29 富士フイルム株式会社 Imaging apparatus and control method thereof
JP5144481B2 (en) * 2008-12-02 2013-02-13 富士フイルム株式会社 Imaging apparatus and imaging method
US8976272B2 (en) * 2009-03-03 2015-03-10 Panasonic Intellectual Property Management Co., Ltd. Imaging apparatus which corrects effects of flash
JP5129182B2 (en) * 2009-03-12 2013-01-23 富士フイルム株式会社 Imaging apparatus and imaging control method
EP2421249A4 (en) * 2009-04-16 2013-02-20 Panasonic Corp Imaging device, external flash detection method, program, and integrated circuit

Also Published As

Publication number Publication date
JP2013192201A (en) 2013-09-26

Similar Documents

Publication Publication Date Title
JP5787648B2 (en) Image processing apparatus and image processing apparatus control method
US8872937B2 (en) Image capture apparatus and image capturing method
JP2007019973A (en) Imaging device and imaging method
US8373769B2 (en) Imaging apparatus, imaging processing method and recording medium
US8237850B2 (en) Electronic camera that adjusts the distance from an optical lens to an imaging surface
JP2010135921A (en) Imaging apparatus and imaging method
WO2020034701A1 (en) Imaging control method and apparatus, electronic device, and readable storage medium
JP2017022610A (en) Image processing apparatus and image processing method
JP6351271B2 (en) Image composition apparatus, image composition method, and program
JP2015149691A (en) Image correction device, image correction method, and imaging apparatus
JP2007124292A (en) Imaging apparatus, imaging method, and imaging program
US8964109B2 (en) Image processing device and method
JP2013192200A (en) Image processing apparatus, image processing method, and image processing program
EP2629508B1 (en) Image processing device, image processing method, image processing program for flash detection
JP2006080942A (en) Image processing apparatus, image processing program, image processing method, and imaging apparatus
JP5900278B2 (en) Image processing apparatus and method
JP5928290B2 (en) Image processing apparatus, image processing method, and image processing program
JP5757472B2 (en) Image processing apparatus, image processing method, and image processing program
JP2008211674A (en) Image signal processing method and apparatus
JP5900217B2 (en) Image processing apparatus and method
JP2012160852A (en) Image composition device, imaging device, image composition method, and image composition program
JP2012044377A (en) Image compositing device, image compositing method and program
JP5757471B2 (en) Image processing apparatus, image processing method, and image processing program
JP4827811B2 (en) Electronic camera
JP4964062B2 (en) Electronic camera

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150331

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160113

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160119

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160209

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160411

R150 Certificate of patent or registration of utility model

Ref document number: 5928290

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150