JP5900278B2 - Image processing apparatus and method - Google Patents

Image processing apparatus and method Download PDF

Info

Publication number
JP5900278B2
JP5900278B2 JP2012229512A JP2012229512A JP5900278B2 JP 5900278 B2 JP5900278 B2 JP 5900278B2 JP 2012229512 A JP2012229512 A JP 2012229512A JP 2012229512 A JP2012229512 A JP 2012229512A JP 5900278 B2 JP5900278 B2 JP 5900278B2
Authority
JP
Japan
Prior art keywords
line
screen
flash
unit
average luminance
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
JP2012229512A
Other languages
Japanese (ja)
Other versions
JP2014082657A (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 JP2012229512A priority Critical patent/JP5900278B2/en
Publication of JP2014082657A publication Critical patent/JP2014082657A/en
Application granted granted Critical
Publication of JP5900278B2 publication Critical patent/JP5900278B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Transforming Light Signals Into Electric Signals (AREA)
  • Studio Devices (AREA)

Description

本発明は、動画像の撮影時に撮影者以外の他者のフラッシュ等によって、画像の明るさが不連続となった画面を補正するとともに、擬似的にフラッシュ発光の効果を付加することができる画像処理装置及び方法に関する。   The present invention corrects a screen in which the brightness of an image becomes discontinuous by a flash of another person other than the photographer at the time of shooting a moving image, and can add a pseudo flash emission effect. The present invention relates to a processing apparatus and method.

近年、ビデオカメラ等の撮像装置においては、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

フラッシュの発光によって画像の明るさが不連続となった部分を補正すると、画像は実質的にフラッシュが発光しなかった状態となる。ところが、フラッシュが発光している状況で撮影したという臨場感を損ねないように、フラッシュが発光している状態の画像を意図的に保ちたいという要望がある。   When the portion where the brightness of the image is discontinuous due to the flash emission is corrected, the image is in a state where the flash is not substantially emitted. However, there is a desire to intentionally maintain an image in a state where the flash is emitted so as not to impair the sense of reality that the image was taken in a state where the flash is emitted.

この際、フラッシュ等の発光期間が短く強い光がCMOSセンサに入射して画面内で画像の明るさが不連続となったことを、極力、誤検出少なく検出して補正することが求められる。また、画面内で画像の明るさが不連続となったことを検出するためにメモリリソースが増大することは好ましくない。メモリリソースが増大せず、画像の明るさが不連続となったことを検出することが求められる。   At this time, 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.

本発明はこのような要望に対応するため、フラッシュの発光によって画像の明るさが不連続となった部分を補正することができ、フラッシュが発光している状態の画像を意図的に保つことができる画像処理装置及び方法を提供することを目的とする。また、併せて、画面内で画像の明るさが不連続となったことを精度よく検出することができる画像処理装置及び方法、メモリリソースを増大させることなく、画面内で画像の明るさが不連続となったことを検出することができる画像処理装置及び方法を提供することを目的とする。   In order to meet such a demand, the present invention can correct a portion where the brightness of an image is discontinuous due to flash emission, and intentionally keep an image in a state where the flash is emitted. An object of the present invention is to provide an image processing apparatus and method that can be used. In addition, the image processing apparatus and method that can accurately detect that the brightness of the image is discontinuous in the screen, and the brightness of the image in the screen is not increased without increasing memory resources. It is an object of the present invention to provide an image processing apparatus and method capable of detecting the fact that it has become continuous.

本発明は、上述した従来の技術の課題を解決するため、画像データで構成される画面内にフラッシュの発光によって高輝度となっているラインが含まれるか否かを検出するフラッシュ検出部(2,20)と、前記画像データの過去の画面を保持する保持部(4)と、前記フラッシュ検出部によって高輝度となっているラインが含まれていることが検出された場合、少なくとも高輝度となっているラインを前記保持部に保持された前記過去の画面のラインに置換することにより画像データを補正する補正処理部(82)と、前記補正処理部によって補正した画面のうち少なくとも1つの画面を効果付加対象画面とし、前記効果付加対象画面を構成する画像データに対して擬似的なフラッシュ発光の効果を付加する効果処理部(83)と、前記効果処理部によって擬似的なフラッシュ発光の効果が付加された画像データを記録する記録部(11)とを備えることを特徴とする画像処理装置を提供する。   In order to solve the above-described problems of the conventional technology, the present invention provides a flash detection unit (2) that detects whether or not a screen that is composed of image data includes a line that is bright due to flash emission. , 20), a holding unit (4) that holds a past screen of the image data, and a line having high luminance is detected by the flash detection unit, at least high luminance is detected. A correction processing unit (82) that corrects image data by replacing the existing line with the line of the past screen held in the holding unit, and at least one of the screens corrected by the correction processing unit And an effect processing unit (83) for adding a pseudo flash emission effect to the image data constituting the effect addition target screen, and the effect addition target screen. To provide an image processing apparatus characterized by comprising a recording unit for recording image data effect is added pseudo-flash and (11) by the processing unit.

また、本発明は、上述した従来の技術の課題を解決するため、画像データで構成される画面内にフラッシュの発光によって高輝度となっているラインが含まれるか否かを検出し、前記画像データの過去の画面を保持部(4)に保持し、高輝度となっているラインが含まれていることが検出された場合、少なくとも高輝度となっているラインを前記保持部に保持された前記過去の画面のラインに置換することにより画像データを補正し、補正した画面のうち少なくとも1つの画面を効果付加対象画面とし、前記効果付加対象画面を構成する画像データに対して擬似的なフラッシュ発光の効果を付加し、擬似的なフラッシュ発光の効果が付加された画像データを記録部(11)に記録することを特徴とする画像処理方法を提供する。   In addition, in order to solve the above-described problems of the related art, the present invention detects whether or not a line having high luminance due to flash emission is included in a screen composed of image data, and the image If the past screen of data is held in the holding unit (4) and it is detected that a line with high luminance is included, at least the line with high luminance is held in the holding unit. The image data is corrected by replacing with the lines of the past screen, and at least one of the corrected screens is set as an effect addition target screen, and a pseudo flash is applied to the image data constituting the effect addition target screen. There is provided an image processing method characterized in that image data to which a light emission effect is added and a pseudo flash light emission effect is added is recorded in a recording unit (11).

本発明の画像処理装置及び方法によれば、フラッシュの発光によって画像の明るさが不連続となった部分を補正することができ、フラッシュが発光している状態の画像を意図的に保つことができる。また、本発明の画像処理装置及び方法によれば、併せて、画面内で画像の明るさが不連続となったことを精度よく検出することができ、メモリリソースを増大させることなく、画面内で画像の明るさが不連続となったことを検出することができる。   According to the image processing apparatus and method of the present invention, it is possible to correct a portion where the brightness of an image becomes discontinuous due to light emission of the flash, and to intentionally keep an image in a state where the flash is emitted. it can. Further, according to the image processing apparatus and method of the present invention, it is possible to accurately detect that the brightness of the image is discontinuous within the screen, and without increasing the memory resources, Can detect that the brightness of the image is discontinuous.

第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 process in 1st Embodiment. 第1実施形態によるフラッシュ補正処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of the flash correction process by 1st Embodiment. 第1実施形態における画面単位切換モードの場合の画像データの補正を説明するための図である。It is a figure for demonstrating correction | amendment of the image data in the case of the screen unit switching mode in 1st Embodiment. 第1実施形態による動作を説明するための隣接領域を示す図である。It is a figure which shows the adjacent area | region for demonstrating the operation | movement by 1st Embodiment. 第1実施形態による動作を説明するための混合特性を示す図である。It is a figure which shows the mixing characteristic for demonstrating the operation | movement by 1st Embodiment. 第1実施形態における領域補正モードの場合の画像データの補正を説明するための図である。It is a figure for demonstrating correction | amendment of the image data in the case of the area | region correction mode in 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 process in 2nd Embodiment. 第2実施形態による効果を説明するための図である。It is a figure for demonstrating the effect by 2nd Embodiment. 第3実施形態の画像処理装置における撮影及び記録処理の全体的な流れを示すフローチャートである。It is a flowchart which shows the whole flow of imaging | photography and the recording process in the image processing apparatus of 3rd Embodiment. 第3実施形態におけるフラッシュ検出・補正処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of the flash detection and correction process in 3rd Embodiment.

以下、本発明の画像処理装置及び方法の各実施形態について、添付図面を参照して説明する。各実施形態においては、画像処理装置をビデオカメラに適用し、ビデオカメラで行われる画像処理方法を例として説明する。   Embodiments of an image processing apparatus and method according to the present invention will be described below with reference to the accompanying drawings. In each embodiment, an image processing method applied to a video camera and applied to the video camera will be described as an example.

<第1実施形態>
図1を用いて、第1実施形態の画像処理装置であるビデオカメラ101の全体構成について説明する。ビデオカメラ101は、撮像部1,フラッシュ検出部2,画像信号処理部3,バッファメモリ4,圧縮伸張処理部5,出力信号処理部6,表示部7,フラッシュ補正部80,制御部9,メモリ10,記録再生部11,操作スイッチ12を備える。記録再生部11は、半導体メモリ,ハードディスク・ドライブ等の任意の記録媒体を有する。記録媒体はビデオカメラ101に対して着脱自在であってもよい。
<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 80, a control unit 9, a memory 10 includes a recording / reproducing unit 11 and an operation switch 12. The recording / reproducing unit 11 has an arbitrary recording medium such as a semiconductor memory or a hard disk drive. The recording medium may be detachable from the video camera 101.

撮像部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. That is, the current screen is a target screen that is a target for detection as to whether or not it includes a line that is bright due to flash emission. 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は、差分値が閾値以上である状態が予め設定したライン数以上継続したと判定した場合に、フラッシュの発光によって画像の明るさが不連続となったと検出する。   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.

フラッシュ判定部26は、フラッシュが発光したことを示す検出信号と併せて、フラッシュの発光の開始時点である差分値が閾値以上となった最初のライン番号を示すデータと、差分値が閾値未満となった最初のライン番号を示すデータとを出力する。差分値が閾値未満となった最初のラインの1ライン前のラインがフラッシュの発光の最終ラインである。   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. As described above, in the first embodiment, since the electrical signals are R, G, and B signals, after adjusting the white balance and gain and performing gamma processing, the luminance signal Y and the 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へと入力されて保持された画像データが後述するフラッシュ補正部80による画像データの補正処理の際に用いられる。   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 80 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.

フラッシュ補正部80には、フラッシュ判定部26より出力された検出信号が入力される。フラッシュ補正部80は、補正制御部81と補正処理部82と効果処理部83とを有する。   The detection signal output from the flash determination unit 26 is input to the flash correction unit 80. The flash correction unit 80 includes a correction control unit 81, a correction processing unit 82, and an effect processing unit 83.

フラッシュ補正部80は、制御部9による制御に従って、フラッシュの発光によって明るさが不連続となった画像データを補正する。フラッシュ補正部80は、フラッシュの発光によって部分的に高輝度となっている画像データが記録再生部11に記録されている場合に、画像データの再生時に画像データを補正する。領域補正モードに設定されている場合と画面単位切換モードに設定されている場合の補正処理部82の動作については後述する。   The flash correction unit 80 corrects image data whose brightness has become discontinuous due to flash emission under the control of the control unit 9. The flash correction unit 80 corrects the image data when reproducing the image data when image data that is partially bright due to flash emission is recorded in the recording / reproduction unit 11. The operation of the correction processing unit 82 when the region correction mode is set and when the screen unit switching mode is set will be described later.

効果処理部83は、補正処理部82によって補正された画像データに対して擬似的なフラッシュ効果を付加して、バッファメモリ4へと供給する。   The effect processing unit 83 adds a pseudo flash effect to the image data corrected by the correction processing unit 82 and supplies the image data to the buffer memory 4.

制御部9には、後述する領域補正モードと画面単位切換モードとのいずれかが設定されている。フラッシュ検出部2及びフラッシュ補正部80は、制御部9に設定されているモードの情報を参照する。補正制御部81は、補正処理部82が制御部9に設定されているモードに応じた補正処理動作を実行するよう補正処理部82を制御する。なお、画面単位切換モードは必須ではなく、必要に応じて領域補正モードと画面単位切換モードとを選択するようにすればよい。   The control unit 9 is set with either an area correction mode or a screen unit switching mode to be described later. The flash detection unit 2 and the flash correction unit 80 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 region correction mode and the screen unit switching mode may be selected as necessary.

制御部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に記録するよう制御する。   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.

また、制御部9は操作スイッチ12によって撮像した動画像を記録する指示がなされたら、記録再生部11に符号化データを再生させて読み出し、圧縮伸張処理部5へと供給するよう制御する。制御部9は、操作スイッチ12による操作に従ってオンスクリーン信号を発生して、出力信号処理部6へと供給する。   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と同等の構成を実現してもよい。また、フラッシュ補正部80もソフトウェアによって構成してもよい。即ち、第1実施形態の画像処理プログラムの一部であるフラッシュ補正プログラムを実行させることによって、フラッシュ補正部80と同等の構成を実現してもよい。   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 80 may also be configured by software. That is, a configuration equivalent to the flash correction unit 80 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. The timing sequentially shifts in the time direction from the first line Ln to the last line Ln on the screen. 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実施形態による画像データの補正を行わないとすると、記録再生部11に記録されて再生され、表示部7に表示される画像Im1,Im2,Im3,Im4…は図2の(d)に示すようになる。画像Im1,Im4は発光FLによる影響を受けておらず、画面の明るさが連続して正常な画像である。画像Im2は、一点鎖線以降の下端部で白帯状に明るくなっており、画像の明るさが不連続となった正常でない画像である。ハッチングを付した部分が高輝度の部分を示す。画像Im3は、上端から一点鎖線までの上端部で同様に白帯状に明るくなっており、画像の明るさが不連続となった正常でない画像である。   If the image data correction according to the first embodiment is not performed, the images Im1, Im2, Im3, Im4,... Recorded and reproduced in the recording / reproducing unit 11 and displayed on the display unit 7 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〜図5を用いて、第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は、ステップS30にて、フラッシュ検出部2によるフラッシュ検出処理を実行させる。また、制御部9は、ステップS30と並行して、ステップS4にて、画像信号処理部3による画像信号処理を実行させる。ステップS30のフラッシュ検出処理の詳細については後述する。制御部9は、ステップS5にて、出力信号処理部6を制御して表示部7に撮影した画像を表示させる。   In step S30, the control unit 9 causes the flash detection unit 2 to execute flash detection processing. Further, in parallel with step S30, the control unit 9 causes the image signal processing unit 3 to execute image signal processing in step S4. Details of the flash detection processing in step S30 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は、処理をステップS11に移行させる。   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 S11.

制御部9は、ステップS8にて、記録終了の指示があったか否かを判定する。記録終了の指示があったと判定されれば(YES)、制御部9は、ステップS9にて、記録再生部11への記録を停止させる。記録終了の指示があったと判定されなければ(NO)、制御部9は処理をステップS7に戻してステップS7を繰り返す。   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.

制御部9は、ステップS9に続き、ステップS11にて、操作スイッチ12によって、記録再生部11に記録された所定の画像データの再生を開始する指示があったか否かを判定する。再生開始の指示があったと判定されれば(YES)、制御部9は、ステップS12にて、記録再生部11に記録された画像データ(符号化データ)を再生させる。記録再生部11から読み出された符号化データは、圧縮伸張処理部5によって伸張処理され、バッファメモリ4に入力されて保持される。再生開始の指示があったと判定されなければ(NO)、制御部9は、処理をステップS10に移行させる。   Following step S9, the control unit 9 determines in step S11 whether or not there has been an instruction to start reproduction of predetermined image data recorded in the recording / reproducing unit 11 by the operation switch 12. If it is determined that there is an instruction to start reproduction (YES), the control unit 9 reproduces the image data (encoded data) recorded in the recording / reproducing unit 11 in step S12. The encoded data read from the recording / reproducing unit 11 is decompressed by the compression / decompression processing unit 5 and input to the buffer memory 4 to be held. If it is not determined that there is an instruction to start reproduction (NO), the control unit 9 shifts the process to step S10.

制御部9は、ステップS13にて、フラッシュ検出領域があるか否かを判定する。フラッシュ検出領域とは、再生する画像データ内でフラッシュの発光によって高輝度となっていることが検出された領域である。画像データにおけるどの部分がフラッシュ検出領域であるかは、後述するように、符号化データに付加したメタデータ(付加情報)を参照することによって判別することができる。   In step S13, the controller 9 determines whether there is a flash detection area. The flash detection area is an area in which high brightness is detected by flash emission in the image data to be reproduced. As will be described later, which part of the image data is the flash detection area can be determined by referring to metadata (additional information) added to the encoded data.

フラッシュ検出領域があると判定されれば(YES)、制御部9は、ステップS140にて、フラッシュ補正部80によるフラッシュ補正処理を実行させる。ステップS140におけるフラッシュ補正処理は、フラッシュの発光によって画像の明るさが不連続となった部分を補正するとともに、擬似的にフラッシュ発光の効果を付加する補正処理である。   If it is determined that there is a flash detection area (YES), the control unit 9 causes the flash correction unit 80 to execute flash correction processing in step S140. The flash correction process in step S140 is a correction process for correcting a portion where the brightness of the image is discontinuous due to flash emission and adding a pseudo flash emission effect.

制御部9は、ステップS15にて、ステップS140にて補正された画像データを表示部7に表示させる。   In step S15, the control unit 9 causes the display unit 7 to display the image data corrected in step S140.

この場合、バッファメモリ4に保持された伸張処理後の画像データがフラッシュ補正部80へと入力され、ステップS140によるフラッシュ補正処理が実行される。補正された画像データはバッファメモリ4に入力されて保持され、出力処理部6を介して表示部7へと供給される。   In this case, the decompressed image data held in the buffer memory 4 is input to the flash correction unit 80, and the flash correction process in step S140 is executed. The corrected image data is input and held in the buffer memory 4 and supplied to the display unit 7 through the output processing unit 6.

ステップS13にてフラッシュ検出領域があると判定されなければ(NO)、制御部9は、処理をステップS15に移行させる。制御部9は、ステップS15にて、ステップS12にて再生された画像データをそのまま表示部7に表示させる。この場合、バッファメモリ4に保持された伸張処理後の画像データは、バッファメモリ4から出力処理部6へとそのまま出力され、表示部7へと供給される。   If it is not determined in step S13 that there is a flash detection area (NO), the control unit 9 shifts the process to step S15. In step S15, the control unit 9 causes the display unit 7 to display the image data reproduced in step S12 as it is. In this case, the decompressed image data held in the buffer memory 4 is directly output from the buffer memory 4 to the output processing unit 6 and supplied to the display unit 7.

制御部9は、ステップS16にて、再生停止の指示があったか否かを判定する。再生停止の指示があったと判定されれば(YES)、制御部9は、ステップS17にて、画像データの再生を停止させて、処理をステップS10に移行させる。再生停止の指示があったと判定されなければ(NO)、制御部9は処理をステップS12に戻してステップS12以降を繰り返す。   In step S16, the controller 9 determines whether or not an instruction to stop reproduction has been issued. If it is determined that there is an instruction to stop reproduction (YES), the control unit 9 stops reproduction of the image data in step S17, and shifts the processing to step S10. If it is not determined that there has been an instruction to stop playback (NO), the control unit 9 returns the process to step S12 and repeats step S12 and subsequent steps.

制御部9は、ステップS10にて、操作スイッチ12による撮影終了の指示があったか否かを判定する。撮影終了の指示があったと判定されれば(YES)、制御部9は処理を終了させる。撮影終了の指示があったと判定されなければ(NO)、制御部9は、処理をステップS2に戻してステップS2以降を繰り返す。操作スイッチ12によるビデオカメラ101の電源切断の指示を撮影終了の指示としてもよい。   In step S <b> 10, the control unit 9 determines whether or not an instruction to end shooting is given by 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に示すステップS30のフラッシュ検出処理の詳細について説明する。第1実施形態におけるステップS30をステップS30とする。以下の各ステップは、制御部9による制御に基づいてフラッシュ検出部2によって実行される。 Details of the flash detection process in step S30 shown in FIG. 3 will be described with reference to FIG. The step S30 in the first embodiment and step S30 1. The following steps are executed by the flash detection unit 2 based on control by the control unit 9.

図4において、フラッシュ検出部2は、ステップS3101にて、有効ラインにおける有効画素の画素値を加算する処理を有効ラインごとに順次実行する。フラッシュ検出部2は、ステップS3102にて、ステップS3101にて得た画素値の加算値を有効画素数で除算してライン平均輝度を算出し、ライン平均輝度を保持する。   In FIG. 4, in step S3101, the flash detection unit 2 sequentially executes a process of adding pixel values of effective pixels in the effective line for each effective line. In step S3102, the flash detection unit 2 calculates the line average luminance by dividing the addition value of the pixel values obtained in step S3101 by the number of effective pixels, and holds the line average luminance.

フラッシュ検出部2は、ステップS3103にて、ライン平均輝度を順次加算する処理を実行する。フラッシュ検出部2は、ステップS3104にて、ステップS3102で算出したライン平均輝度と1画面前の全画面平均輝度との差分演算処理を実行する。ステップS3104における差分演算処理は、ステップS3102でライン平均輝度を算出するたびに実行される。   In step S3103, the flash detection unit 2 executes a process of sequentially adding the line average luminance. In step S3104, the flash detection unit 2 executes a difference calculation process between the line average luminance calculated in step S3102 and the average luminance of the entire screen one screen before. The difference calculation process in step S3104 is executed every time the line average luminance is calculated in step S3102.

フラッシュ検出部2は、ステップS3105にて、フラッシュの発光を検出していない通常状態であるか否かを判定する。通常状態であると判定されれば(YES)、フラッシュ検出部2は、ステップS3106にて、差分値が閾値以上のラインを検出したか否かを判定する。差分値が閾値以上のラインを検出したと判定されれば(YES)、フラッシュ検出部2は、処理をステップS3107に移行させる。この際、フラッシュ検出部2は、検出したラインがフレームの最初のラインから何ライン目かを示す検出ライン情報を記憶しておく。   In step S3105, the flash detection unit 2 determines whether or not the flash is in a normal state in which no flash emission is detected. If it is determined that the current state is the normal state (YES), in step S3106, the flash detection unit 2 determines whether a line having a difference value equal to or larger than the threshold value is detected. 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 moves the process to step S3107. At this time, the flash detection unit 2 stores detection line information indicating how many lines are detected from the first line of the frame.

一方、差分値が閾値以上のラインを検出したと判定されなければ(NO)、フラッシュ検出部2は、既に検出ライン情報を記憶している場合は、それを消去するとともに、処理をステップS3111に移行させる。   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 it has already been stored, and the process proceeds to step S3111. Transition.

フラッシュ検出部2は、ステップS3107にて、差分値が閾値以上である状態が所定ライン数以上継続したか否かを判定する。所定ライン数以上継続したと判定されれば(YES)、フラッシュ検出部2は、処理をステップS3108に移行させ、所定ライン数以上継続したと判定されなければ(NO)、フラッシュ検出部2は、処理をステップS3111に移行させる。   In step S3107, 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 detection unit 2 shifts the process to step S3108. 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 S3111.

ステップS3105にて通常状態であると判定され、ステップS3106にて差分値が閾値以上のラインが検出され、ステップS3107にて差分値が閾値以上である状態が所定ライン数以上継続したと判定された場合は、フラッシュの発光の影響を受けていない状態からフラッシュの発光の影響を受けて高輝度の状態へと変化したことを検出したということである。   In step S3105, the normal state is determined. In step S3106, a line having a difference value equal to or greater than the threshold value is detected. In step S3107, it is determined that the state in which the difference value is equal to or greater than the threshold value continues for a predetermined number of lines. In this case, it is detected that the state has changed from a state not affected by the light emission of the flash to a state of high brightness due to the light emission of the flash.

そこで、フラッシュ検出部2は、ステップS3108にて、フラッシュの発光を検出していない状態からフラッシュの発光を検出した状態へとフラッシュ検出状態を変更する。第1実施形態においては、フラッシュ検出部2は、フラッシュ発光の開始ラインを示す検出ライン情報を制御部9に供給し、記憶した検出ライン情報を消去する。   Therefore, in step S3108, the flash detection unit 2 changes the flash detection state from the state where the flash emission is not detected to the state where the flash emission is detected. In the first embodiment, the flash detection unit 2 supplies detection line information indicating the flash emission start line to the control unit 9 and erases the stored detection line information.

一方、ステップS3105にて通常状態であると判定されなければ(NO)、フラッシュ検出部2は、ステップS3109にて、差分値が閾値未満のラインを検出したか否かを判定する。差分値が閾値未満のラインを検出したと判定されれば(YES)、フラッシュ検出部2は、処理をステップS3110に移行させる。この際、フラッシュ検出部2は、検出したラインがフレームの最初のラインから何ライン目かを示す検出ライン情報を記憶しておく。   On the other hand, if it is not determined in step S3105 that the current state is the normal state (NO), the flash detection unit 2 determines in step S3109 whether a line having a difference value less than the threshold value has been 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 moves the process to step S3110. At this time, the flash detection unit 2 stores detection line information indicating how many lines are detected from the first line of the frame.

フラッシュ検出部2は、ステップS3110にて、差分値が閾値未満である状態が所定ライン数以上継続したか否かを判定する。所定ライン数以上継続したと判定されれば(YES)、フラッシュ検出部2は、処理をステップS3108に移行させ、所定ライン数以上継続したと判定されなければ(NO)、フラッシュ検出部2は、処理をステップS3111に移行させる。   In step S3110, 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 S3108. 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 S3111.

ステップS3105にて通常状態ではないと判定され、ステップS3109にて差分値が閾値未満のラインが検出され、ステップS3110にて差分値が閾値未満である状態が所定ライン数以上継続したと判定された場合は、フラッシュの発光の影響を受けて高輝度の状態からフラッシュの発光の影響を受けていない状態へと変化したことを検出したということである。   In step S3105, it is determined that the current state is not the normal state. In step S3109, a line having a difference value less than the threshold value is detected. In step S3110, it is determined that the state in which the difference value is less than the threshold value continues for a predetermined number of lines. In this case, it is detected that the state has changed from a high brightness state to a state not affected by the light emission of the flash under the influence of the light emission of the flash.

そこで、フラッシュ検出部2は、ステップS3108にて、フラッシュの発光を検出している状態からフラッシュの発光を検出していない状態へとフラッシュ検出状態を変更する。第1実施形態においては、フラッシュ検出部2は、フラッシュ発光の終了ラインを示す検出ライン情報を制御部9に供給し、記憶した検出ライン情報を消去する。   Therefore, in step S3108, the flash detection unit 2 changes the flash detection state from the state in which the flash emission is detected to the state in which the flash emission is not detected. In the first embodiment, the flash detection unit 2 supplies detection line information indicating the end line of flash emission to the control unit 9 and erases the stored detection line information.

フラッシュ検出部2は、ステップS3111にて、全有効ラインに対する判定が終了したか否かを判定する。全有効ラインに対する判定が終了したと判定されなければ(NO)、フラッシュ検出部2は、処理をステップS3101に戻し、ステップS3101以降の処理を繰り返す。全有効ラインに対する判定が終了したと判定されれば(YES)、フラッシュ検出部2は、ステップS3112にて、ライン平均輝度の加算値を有効ライン数で除算して全画面平均輝度を算出し、全画面平均輝度を保持する。   In step S3111, the flash detection unit 2 determines whether the determination for all active lines is completed. If it is not determined that the determination for all active lines has been completed (NO), the flash detection unit 2 returns the process to step S3101 and repeats the processes after step S3101. If it is determined that the determination for all the effective lines has been completed (YES), 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 in step S3112. Holds the full screen average brightness.

制御部9は、図3のステップS7にて、圧縮伸張処理部5より出力された符号化データを記録再生部11に記録させる際に、フラッシュ検出部2で検出したフラッシュ発光の開始ライン及び終了ラインを示す検出ライン情報を符号化データに付加するメタデータとして記録させる。   When the control unit 9 records the encoded data output from the compression / decompression processing unit 5 in the recording / reproducing unit 11 in step S7 of FIG. 3, the start line and end of the flash emission detected by the flash detection unit 2 are recorded. Detection line information indicating a line is recorded as metadata to be added to the encoded data.

図5を用いて、図3に示すステップS140のフラッシュ補正処理の詳細について説明する。以下の各ステップは、制御部9による制御に基づいてフラッシュ補正部80によって実行される。制御部9は、符号化データに付加されているメタデータに基づいてフラッシュ補正部80によるフラッシュ補正処理を実行させる。   Details of the flash correction processing in step S140 shown in FIG. 3 will be described with reference to FIG. The following steps are executed by the flash correction unit 80 based on control by the control unit 9. The control unit 9 causes the flash correction unit 80 to execute flash correction processing based on the metadata added to the encoded data.

図5において、フラッシュ補正部80は、ステップS1401にて、画面単位切換モードであるか否かを判定する。画面単位切換モードであると判定されれば(YES)、フラッシュ補正部80は、ステップS1402にて、2画面にわたるフラッシュであるか否かを判定する。   In FIG. 5, the flash correction unit 80 determines whether or not the screen unit switching mode is set in step S1401. If it is determined that the screen unit switching mode is set (YES), the flash correction unit 80 determines whether or not the flash is for two screens in step S1402.

2画面にわたるフラッシュであると判定されれば(YES)、フラッシュ補正部80は、ステップS1403にて、2画面目であるか否かを判定する。2画面目であると判定されれば(YES)、フラッシュ補正部80は、ステップS1404にて、1画面後の画面に置換する。ステップS1402にて2画面にわたるフラッシュであると判定されなければ(NO)、また、ステップS1403にて2画面目であると判定されなければ(NO)、フラッシュ補正部80は、ステップS1405にて、1画面前の画面に置換する。   If it is determined that the flash covers two screens (YES), the flash correction unit 80 determines whether or not the screen is the second screen in step S1403. If it is determined that the screen is the second screen (YES), the flash correction unit 80 replaces the screen after the first screen in step S1404. If it is not determined in step S1402 that the flash extends over two screens (NO), or if it is not determined in step S1403 that the second screen is displayed (NO), the flash correction unit 80 determines in step S1405. Replace with the previous screen.

図6において、(a)は補正前の画像Im1,Im2,Im3,Im4…を示している。図6において、ハッチングを付した部分がフラッシュの発光によって高輝度となっている部分である。図6の(b)に示すように、高輝度の部分を有する1画面目の画像Im2は、ステップS1405にて、1画面前の画像Im1に置換され、高輝度の部分を有する2画面目の画像Im3は、ステップS1404にて、1画面後の画像Im4に置換される。   6A shows images Im1, Im2, Im3, Im4,... Before correction. In FIG. 6, the hatched portion is a portion having high brightness due to flash emission. As shown in FIG. 6B, the image Im2 of the first screen having the high luminance portion is replaced with the image Im1 of the previous screen in step S1405, and the second screen having the high luminance portion. In step S1404, the image Im3 is replaced with the image Im4 after one screen.

次に、フラッシュ補正部80(効果処理部83)は、ステップS1410にて、補正した画面の全体に所定値以上の輝度信号を加算することによって擬似的なフラッシュ発光の効果を付加する。輝度信号は固定値でよい。   Next, in step S1410, the flash correction unit 80 (effect processing unit 83) adds a pseudo flash emission effect by adding a luminance signal of a predetermined value or more to the entire corrected screen. The luminance signal may be a fixed value.

画像データに輝度信号の固定値を加算する代わりに、輝度信号に対し、または、輝度信号及び色差信号の双方に対し、所定のゲインを乗算することによって、擬似的なフラッシュ発光の効果を付加してもよい。輝度信号及び色差信号の双方に対しゲインを乗算する場合には、輝度信号に乗算するゲインと色差信号に乗算するゲインとを個別で設定することが好ましい。   Instead of adding a fixed value of the luminance signal to the image data, a pseudo flash emission effect is added by multiplying the luminance signal or both the luminance signal and the color difference signal by a predetermined gain. May be. When multiplying both the luminance signal and the color difference signal by a gain, it is preferable to individually set a gain for multiplying the luminance signal and a gain for multiplying the color difference signal.

図6の(c)は、画像Im2を1画面前の画像Im1に置換した画面の全体と、画像Im3を1画面後の画像Im4に置換した画面の全体に、擬似的なフラッシュ発光の効果を付加した状態を示している。画像Im1,Im4はそれぞれ、画面の全体にハッチングを付して示すように、画面の全体でフラッシュが発光している状態と等価な画像Im1”,Im4”とされている。   FIG. 6C shows the effect of the pseudo flash emission on the entire screen in which the image Im2 is replaced with the image Im1 of the previous screen, and on the entire screen in which the image Im3 is replaced with the image Im4 of the next screen. The added state is shown. The images Im1 and Im4 are images Im1 ″ and Im4 ″ that are equivalent to the state in which the flash is emitted on the entire screen, as shown by hatching the entire screen.

なお、上記説明ではフラッシュ発光によって高輝度の部分を有すると判定された2つの画像(Im2,Im3)に対して、それぞれIm1,Im4に置換後に擬似的なフラッシュ発光の効果を付加したが、画像Im2,Im3のうちいずれか1つの画像(画面)のみを効果付加対象画面として擬似的なフラッシュ発光の効果を付加し、残りの画像(画面)は置換のみ行うようにしてもよい。   In the above description, the pseudo flash emission effect is added to the two images (Im2, Im3) determined to have a high-luminance portion by flash emission after replacing them with Im1 and Im4, respectively. It is also possible to add a pseudo flash emission effect using only one of the images Im2 and Im3 (screen) as an effect addition target screen and perform only replacement on the remaining image (screen).

一方、ステップS1401にて画面単位切換モードであると判定されなければ(NO)、フラッシュ補正部80は、ステップS1406〜S1408の領域補正モードに設定されている場合の処理を実行する。フラッシュ補正部80は、ステップS1406にて、1画面を複数の領域に分割する。   On the other hand, if it is not determined in step S1401 that the screen unit switching mode is set (NO), the flash correction unit 80 executes processing in the case where the region correction mode is set in steps S1406 to S1408. In step S1406, the flash correction unit 80 divides one screen into a plurality of areas.

具体的には、フラッシュ補正部80は、図7の(a)に示すように、ステップS30のフラッシュ検出処理において検出した検出ライン情報が示すフラッシュ開始ラインLnfsよりも上方に位置し、フラッシュ開始ラインLnfsに隣接する複数ラインの隣接領域Aadjsと、図7の(b)に示すように、検出ライン情報が示すフラッシュ終了ラインLnfeよりも下方に位置し、フラッシュ終了ラインLnfeに隣接する隣接領域Aadjeを設定する。隣接領域Aadjs,Aadjeは例えば5〜10ライン程度でよい。   Specifically, as shown in FIG. 7A, the flash correction unit 80 is positioned above the flash start line Lnfs indicated by the detection line information detected in the flash detection process of step S30, and the flash start line. A plurality of adjacent areas Aadjs adjacent to Lnfs and an adjacent area Aadje positioned below the flash end line Lnfe indicated by the detection line information and adjacent to the flash end line Lnfe as shown in FIG. Set. The adjacent areas Aadjs and Aadje may be about 5 to 10 lines, for example.

このように、フラッシュ補正部80は、フラッシュの影響を受けていない正常な部分と、フラッシュの発光によって高輝度となっている部分と、高輝度となっている部分の上方側または下方側に隣接する隣接領域とに領域に分割する。   As described above, the flash correction unit 80 is adjacent to a normal part that is not affected by the flash, a part that has high brightness due to flash emission, and an upper side or a lower side of the part that has high brightness. The area is divided into adjacent areas.

フラッシュ補正部80は、ステップS1407にて、合成比率を生成する。具体的には、図7の(a)において、隣接領域Aadjsの最初のラインをLS、隣接領域Aadjsの最後のラインをLEとし、隣接領域Aadjsの画素位置をLf(i,j)とすると、現在の画面の画像データの合成重み付け係数Wf(i,j)と、1画面前の画面の画像データの合成重み付け係数Wb(i,j)は式(1)となる。   In step S1407, the flash correction unit 80 generates a composition ratio. Specifically, in FIG. 7A, when 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 composition weighting coefficient Wf (i, j) of the image data of the current screen and the composition weighting coefficient Wb (i, j) of the image data of the screen one screen before are expressed by Expression (1).

Figure 0005900278
Figure 0005900278

式(1)では、画素位置Lf(i,j)としているが、1画面前の画面の画像データと現在の画面の画像データとはライン単位で混合するので、画像の水平方向の位置を示すiの情報はなくてもよい。   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.

図7の(b)において、隣接領域Aadjeの最初のラインをLS、隣接領域Aadjeの最後のラインをLEとし、隣接領域Aadjeの画素位置をLf(i,j)とすると、現在の画面の画像データの合成重み付け係数Wf(i,j)と、1画面前の画面の画像データの合成重み付け係数Wb(i,j)は式(2)となる。   In FIG. 7B, 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 current screen image 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).

Figure 0005900278
Figure 0005900278

同様に、式(2)では、画素位置Lf(i,j)としているが、1画面前の画面の画像データと現在の画面の画像データとはライン単位で混合するので、画像の水平方向の位置を示すiの情報はなくてもよい。   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.

式(1)による現在の画面のラインと1画面前の画面のラインとを混合特性は図8の(a)となる。図8の(a)において、実線は現在の画面のラインの混合率を示し、破線は1画面前の画面のラインの混合率を示している。図8の(a)に示すように、図7の(a)に示す画像Im2の場合には、画面の上端側から隣接領域Aadjsの手前までは現在の画面のラインのみである。   FIG. 8A shows the mixing characteristics of the current screen line and the previous screen line according to the equation (1). In FIG. 8A, 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. 8A, in the case of the image Im2 shown in FIG. 7A, the line from the upper end of the screen to the front of the adjacent area Aadjs is only the current screen.

隣接領域Aadjsにおいては、式(1)に基づいて、現在の画面のラインと1画面前の画面のラインとを混合して新たなラインを生成する。隣接領域Aadjsの最初のラインLSから最後のラインLEまで現在の画面のラインの混合率が順次減少していく一方、1画面前の画面のラインの混合率が順次増加していく。最後のラインLE以降、1画面前の画面のラインのみとなる。なお、フラッシュ開始ラインLnfsと最後のラインLEとを同一のラインとしてもよい。   In the adjacent area Aadjs, a new line is generated by mixing the line on the current screen and the line on the previous screen based on Expression (1). From the first line LS to the last line LE of the adjacent area Aadjs, the line mixing ratio of the current screen is sequentially decreased, while the line mixing ratio of the screen of the previous screen is sequentially increased. After the last line LE, only the screen line one screen before is displayed. Note that the flash start line Lnfs and the last line LE may be the same line.

式(2)による現在の画面のラインと1画面前の画面のラインとを混合特性は図8の(b)となる。図8の(b)において、実線は現在の画面のラインの混合率を示し、破線は1画面前の画面のラインの混合率を示している。図8の(b)に示すように、図7の(b)に示す画像Im3の場合には、画面の上端側から隣接領域Aadjeの手前までは1画面前の画面のラインのみである。   FIG. 8B shows the mixing characteristics of the current screen line and the previous screen line according to the equation (2). In FIG. 8B, 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. 8 (b), in the case of the image Im3 shown in FIG. 7 (b), 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.

隣接領域Aadjeにおいては、式(2)に基づいて、1画面前の画面のラインと現在の画面のラインとを混合して新たなラインを生成する。隣接領域Aadjeの最初のラインLSから最後のラインLEまで1画面前の画面のラインの混合率が順次減少していく一方、現在の画面のラインの混合率が順次増加していく。最後のラインLE以降、現在の画面のラインのみとなる。なお、フラッシュ終了ラインLnfeと最初のラインLSとを同一のラインとしてもよい。   In the adjacent area Aadje, based on the formula (2), a line on the previous screen and a line on the current screen are mixed to generate a new line. From the first line LS to the last line LE of the adjacent area Aadje, the line mixing ratio of the screen one previous screen 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.

第1実施形態によれば、図2に示す画像Im2のように画面の途中から高輝度となっている場合には、フラッシュ開始ラインLnfsに対して上方に位置するフラッシュの影響を受けていない隣接領域Aadjsにおいて、最初のラインLSから最後のラインLEに進行するに従って1画面前の画面のラインに徐々に切り替わっていく。従って、現在の画面の画像データと1画面前の画面の画像データとを混合する不自然さが低減される。   According to the first 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.

また、第1実施形態によれば、図2に示す画像Im3のように画面の途中まで高輝度で途中から正常な画像となっている場合には、フラッシュ終了ラインLnfeに対して下方に位置するフラッシュの影響を受けていない隣接領域Aadjeにおいて、最初のラインLSから最後のラインLEに進行するに従って現在の画面のラインに徐々に切り替わっていく。従って、現在の画面の画像データと1画面前の画面の画像データとを混合する不自然さが低減される。   Further, according to the first embodiment, when the image is a high-brightness and normal image 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で検出したそれぞれの有効画素の明るさをフラッシュ補正部80に入力すればよい。   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 unit 2 may be input to the flash correction unit 80.

Figure 0005900278
Figure 0005900278

式(3)によれば、隣接領域Aadjs,Aadjeにおいて、それぞれの画素の明るさMf(i,j)が小さい方の値の閾値ThLよりも小さければ、現在の画面の画像データの合成重み付け係数Wf(i,j)が1となり、1画面前の画面の画像データの合成重み付け係数Wb(i,j)が0となる。即ち、画素の明るさMf(i,j)が閾値ThLよりも小さいということはフラッシュの発光による影響を受けていない可能性が高く、現在の画面の画素データのみとする。   According to Expression (3), if the brightness Mf (i, j) of each pixel is smaller than the threshold value ThL of the smaller value in the adjacent areas Aadjs and Aadje, the composite weighting coefficient of the image data of the current screen Wf (i, j) becomes 1, and the composite weighting coefficient Wb (i, j) of the image data of the previous screen 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.

このように、ステップS1407では、式(1),(2)を用いて現在の画面のラインと1画面前の画面のラインとの合成比率(混合率)を生成するか、式(3)を用いて画素単位で現在の画面の画像データと1画面前の画面の画像データとの合成比率(混合率)を生成する。   In this way, in step S1407, using Formulas (1) and (2), the composition ratio (mixing rate) of the current screen line and the previous screen line is generated, or Formula (3) is By using this, a composition ratio (mixing ratio) between the image data of the current screen and the image data of the previous screen is generated in units of pixels.

フラッシュ補正部80は、ステップS1408にて、ステップS1407で生成した合成比率によって現在の画面のライン(画素)と1画面前の画面のライン(画素)とを合成して領域置換処理を実行する。   In step S1408, the flash correction unit 80 combines the current screen line (pixel) and the previous screen line (pixel) by the combination ratio generated in step S1407, and executes region replacement processing.

制御部9に領域補正モードが設定されている場合には、図9の(a)に示すように、画像Im2におけるハッチングを付した部分の高輝度となっている複数のラインが、画像Im1における対応する複数のラインに置換される。また、画像Im3におけるハッチングを付した部分の高輝度となっている複数のラインが、画像Im2における対応する複数のラインに置換される。図9の(a)では、隣接領域Aadjs,Aadjeを省略している。   When the area correction mode is set in the control unit 9, as shown in (a) of FIG. 9, a plurality of lines having high luminance in the hatched portion in the image Im2 are displayed in the image Im1. Replaced with corresponding lines. In addition, a plurality of lines with high luminance in the hatched portions in the image Im3 are replaced with corresponding lines in the image Im2. In FIG. 9A, the adjacent areas Aadjs and Aadje are omitted.

結果として、フラッシュ補正部80は、図9の(b)に示すように、画像Im2を画像Im2’へと補正し、画像Im3を画像Im3’へと補正する。   As a result, the flash correction unit 80 corrects the image Im2 to the image Im2 'and corrects the image Im3 to the image Im3', as shown in FIG. 9B.

領域補正モードに設定されている場合も画面単位切換モードに設定されている場合と同様に、フラッシュ補正部80(効果処理部83)は、ステップS1410にて、補正した画面の全体に所定値以上の輝度信号を加算することによって擬似的なフラッシュ発光の効果を付加する。   Even when the area correction mode is set, as in the case where the screen unit switching mode is set, the flash correction unit 80 (effect processing unit 83) sets the entire corrected screen to a predetermined value or more in step S1410. A pseudo flash emission effect is added by adding the luminance signals.

図9の(c)は、画像Im2’の画面の全体と、画像Im3’の画面の全体に、擬似的なフラッシュ発光の効果を付加した状態を示している。画像Im2’,Im3’それぞれ、画面の全体にハッチングを付して示すように、画面の全体でフラッシュが発光している状態と等価な画像Im2”,Im3”とされている。   FIG. 9C shows a state in which a pseudo flash emission effect is added to the entire screen of the image Im2 'and the entire screen of the image Im3'. The images Im2 ′ and Im3 ′ are images Im2 ″ and Im3 ″ equivalent to a state in which the flash is emitted on the entire screen, as shown by hatching the entire screen.

なお、上記説明ではフラッシュ発光によって高輝度の部分を有すると判定され、判定領域が補正された2つの画像(Im2’,Im3’)に対して、擬似的なフラッシュ発光の効果を付加したが、画像Im2’,Im3’のうちいずれか1つの画像(画面)のみを効果付加対象画面として擬似的なフラッシュ発光の効果を付加し、残りの画像は補正のみ行うようにしてもよい。   In the above description, a pseudo flash emission effect is added to the two images (Im2 ′ and Im3 ′) that are determined to have a high-luminance part by flash emission and the determination area is corrected. Only one of the images Im2 ′ and Im3 ′ (screen) may be used as an effect addition target screen, and a pseudo flash emission effect may be added, and the remaining images may be subjected only to correction.

図9では、画像Im3を、画像Im2を用いて補正して画像Im3’としたが、画像Im1を用いて補正してもよい。この場合には、バッファメモリ4は2画面前の画像データを保持しておくことが必要になる。   In FIG. 9, 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.

図5に示すステップS140においては、ステップS1401を画面単位切換モードであるか否かの判定としているが、領域補正モードであるか否かの判定としてもよい。   In step S140 shown in FIG. 5, step S1401 is determined as to whether or not the screen unit switching mode is set, but may be determined as to whether or not the mode is the region correction mode.

以上のようにして、第1実施形態においては、記録再生部11に記録された画像データの再生時に、フラッシュの発光によって高輝度となった部分が補正され、擬似的なフラッシュ発光の効果が付加されて、表示部7やビデオカメラに接続された外部機器としての表示装置に表示される。   As described above, in the first embodiment, when the image data recorded in the recording / reproducing unit 11 is reproduced, the high-brightness portion is corrected by the flash emission, and a pseudo flash emission effect is added. Then, the image is displayed on a display device as an external device connected to the display unit 7 or the video camera.

第1実施形態によれば、フラッシュの発光によって画像の明るさが不連続となった部分が補正された上で、画面の全体に擬似的なフラッシュ発光の効果が付加されるので、明るさが不連続となっていることによる不自然さが解消され、フラッシュが発光している状況で撮影した臨場感を保つことができる。   According to the first embodiment, the portion where the brightness of the image is discontinuous due to the flash emission is corrected, and a pseudo flash emission effect is added to the entire screen. The unnaturalness due to the discontinuity is eliminated, and it is possible to maintain a sense of presence when the flash is emitted.

第1実施形態によれば、画面単位切換モードにおいて同一の画像データ(画面)が連続することによる動きの不自然さを低減させることができる。また、第1実施形態によれば、領域補正モードにおいて画像データを部分的に補正したことによる不自然さを低減させることができる。   According to the first embodiment, it is possible to reduce the unnaturalness of movement caused by the same image data (screen) being continued in the screen unit switching mode. In addition, according to the first embodiment, unnaturalness due to partial correction of image data in the area correction mode can be reduced.

なお、第1実施形態によれば、画像データは補正されていない状態で記録再生部11に記録されており、画像データの再生時にフラッシュの発光を誤検出したとしても、記録されている画像データには影響を与えない。   According to the first embodiment, the image data is recorded in the recording / reproducing unit 11 in an uncorrected state, and even if the flash emission is erroneously detected during the reproduction of the image data, the recorded image data is recorded. Has no effect.

<第2実施形態>
図10に示す第2実施形態において、図1と同一部分には同一符号を付し、その説明を適宜省略することとする。第2実施形態の画像処理装置であるビデオカメラ102は、フラッシュ検出部2の代わりにフラッシュ検出部20を備える。フラッシュ検出部20は、ブロック平均輝度算出部201,ブロック平均輝度保持部202,ライン平均輝度算出部203,ライン平均輝度保持部204,全画面平均輝度算出部205,全画面平均輝度保持部206,差分算出部207,フラッシュ判定部208を有する。
Second Embodiment
In the second embodiment shown in FIG. 10, 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に示すステップS30のフラッシュ検出処理を図11に示すステップS30とする。図11を用いて、ステップS30のフラッシュ検出処理の詳細について説明する。以下の各ステップは、制御部9による制御に基づいてフラッシュ検出部20によって実行される。 In the second embodiment, a step S30 2 shown in FIG. 11 the flash detection processing of step S30 shown in FIG. With reference to FIG. 11, details of the flash detection processing in step S30 2. The following steps are executed by the flash detection unit 20 based on control by the control unit 9.

図11において、フラッシュ検出部20は、ステップS3201にて、有効ラインにおける各ブロックの有効画素の画素値を加算する処理を有効ラインごとに順次実行する。フラッシュ検出部20は、ステップS3202にて、ステップS3201にて得た各ブロックの画素値の加算値をブロック内の有効画素数で除算してブロック平均輝度を算出し、ブロック平均輝度を保持する。   In FIG. 11, in step S3201, the flash detection unit 20 sequentially executes the process of adding the pixel values of the effective pixels of each block in the effective line for each effective line. In step S3202, 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 S3201 by the number of effective pixels in the block, and holds the block average luminance.

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

フラッシュ検出部20は、ステップS3206にて、ライン平均輝度を順次加算する処理を実行する。フラッシュ検出部20は、ステップS3207にて、ステップS3205で算出したライン平均輝度と1画面前の全画面平均輝度との差分演算の処理を実行する。ステップS3207における差分演算処理は、ステップS3205でライン平均輝度を算出するたびに実行される。   In step S3206, the flash detection unit 20 executes a process of sequentially adding line average luminance. In step S3207, the flash detection unit 20 executes a difference calculation process between the line average luminance calculated in step S3205 and the average average luminance of the previous screen. The difference calculation process in step S3207 is executed every time the line average luminance is calculated in step S3205.

フラッシュ検出部20は、ステップS3208にて、フラッシュの発光を検出していない通常状態であるか否かを判定する。通常状態であると判定されれば(YES)、フラッシュ検出部20は、ステップS3209にて、ライン平均輝度と全画面平均輝度との差分値が閾値(閾値1)以上のラインを検出したか否かを判定する。   In step S3208, the flash detection unit 20 determines whether or not it is a normal state in which flash emission is not detected. If it is determined that the current state is the normal state (YES), whether or not the flash detection unit 20 has detected a line in which the difference value between the line average luminance and the entire screen average luminance is equal to or greater than the threshold (threshold 1) in step S3209. Determine whether.

ライン平均輝度と全画面平均輝度との差分値が閾値以上のラインを検出したと判定されれば(YES)、フラッシュ検出部20は、処理をステップS3210に移行させ、ライン平均輝度と全画面平均輝度との差分値が閾値以上のラインを検出したと判定されなければ(NO)、フラッシュ検出部20は、処理をステップS3215に移行させる。ライン平均輝度と全画面平均輝度との差分値が閾値以上のラインを検出しなければ、フラッシュは発光していないということである。   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 S3210, 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 has been detected as being greater than or equal to the threshold (NO), the flash detection unit 20 moves the process to step S3215. 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は、ライン平均輝度と全画面平均輝度との差分値が閾値以上のラインを検出した場合、さらに、ステップS3210にて、そのライン内のそれぞれのブロック平均輝度と全画面平均輝度との差分値が閾値(閾値2)以上であるか否かを判定する。フラッシュ検出部20は、それぞれのブロック平均輝度と全画面平均輝度との差分値が閾値以上であると判定されれば(YES)、フラッシュ検出部20は、処理をステップS3211に移行させる。なお、この際、フラッシュ検出部2は、検出したラインがフレームの最初のラインから何ライン目かを示す検出ライン情報を記憶しておく。   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 larger than the threshold value, the flash detection unit 20 further determines, in step S3210, each block average luminance and full screen average luminance in the line. 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 S3211. 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.

一方、それぞれのブロック平均輝度と全画面平均輝度との差分値が閾値以上であると判定されなければ(NO)、フラッシュ検出部20は、既に検出ライン情報を記憶している場合は、それを消去するとともに、処理をステップS3215に移行させる。   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 erasing, the process proceeds to step S3215.

フラッシュ検出部20は、ステップS3211にて、ライン平均輝度と全画面平均輝度との差分値が閾値以上であり、それぞれのブロック平均輝度と全画面平均輝度との差分値が閾値以上であるという2つの条件を満たすラインが所定ライン数以上継続したか否かを判定する。所定ライン数以上継続したと判定されれば(YES)、フラッシュ検出部20は処理をステップS3214に移行させ、所定ライン数以上継続したと判定されなければ(NO)、フラッシュ検出部20は処理をステップS3215に移行させる。   In step S3211, the flash detection unit 20 determines that the difference value between the line average luminance and the full screen average luminance is equal to or greater than the threshold, and the difference value between each block average luminance and the full screen average luminance is equal to or greater than 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. If it is determined that the predetermined number of lines or more have been continued (YES), the flash detection unit 20 shifts the process to step S3214. 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 S3215.

フラッシュ検出部20は、ステップS3214にて、フラッシュの発光を検出していない状態からフラッシュの発光を検出した状態へとフラッシュ検出状態を変更する。また、フラッシュ検出部20は、記憶している検出ライン情報をフラッシュ補正部80に供給し、検出ライン情報を消去する。   In step S3214, the flash detection unit 20 changes the flash detection state from a state in which flash emission is not detected to a state in which flash emission is detected. Further, the flash detection unit 20 supplies the stored detection line information to the flash correction unit 80 and erases the detection line information.

一方、ステップS3208にて通常状態であると判定されなければ(NO)、フラッシュ検出部20は、ステップS3212にて、ライン平均輝度と全画面平均輝度との差分値が閾値未満であるか、または、それぞれのブロック平均輝度と全画面平均輝度との差分値が閾値未満であるラインを検出したか否かを判定する。少なくとも一方を満たさないラインが現れたと判定されれば(YES)、フラッシュ検出部20は処理をステップS3213に移行させる。この際、フラッシュ検出部20は、検出したラインがフレームの最初のラインから何ライン目かを示す検出ライン情報を記憶しておく。   On the other hand, if it is not determined in step S3208 that the current state is normal (NO), the flash detection unit 20 determines in step S3212 that the difference value between the line average luminance and the full screen average luminance is less than the threshold value, or Then, it is determined whether or not a line in which the difference value between each block average luminance and the entire screen average luminance is less than the threshold is detected. If it is determined that a line that does not satisfy at least one appears (YES), the flash detection unit 20 moves the process to step S3213. At this time, the flash detection unit 20 stores detection line information indicating the number of detected lines from the first line of the frame.

少なくとも一方を満たさないラインが現れたと判定されなければ(NO)、フラッシュ検出部20は、処理をステップS3215に移行させる。   If it is not determined that a line that does not satisfy at least one appears (NO), the flash detection unit 20 moves the process to step S3215.

フラッシュ検出部20は、ステップS3213にて、上記の2つの条件の少なくとも一方を満たさない状態が所定ライン数以上継続したか否かを判定する。所定ライン数以上継続したと判定されれば(YES)、フラッシュ検出部20は処理をステップS3214に移行させ、所定ライン数以上継続したと判定されなければ(NO)、フラッシュ検出部20は処理をステップS3215に移行させる。   In step S3213, 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 shifts the process to step S3214. 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 S3215.

フラッシュ検出部20は、ステップS3214にて、フラッシュの発光を検出した状態からフラッシュの発光を検出していない状態へとフラッシュ検出状態を変更する。また、フラッシュ検出部20は、記憶している検出ライン情報をフラッシュ補正部80に供給し、検出ライン情報を消去する。   In step S3214, the flash detection unit 20 changes the flash detection state from the state where the flash emission is detected to the state where the flash emission is not detected. Further, the flash detection unit 20 supplies the stored detection line information to the flash correction unit 80 and erases the detection line information.

フラッシュ検出部20は、ステップS3215にて、全有効ラインに対する判定が終了したか否かを判定する。全有効ラインに対する判定が終了したと判定されれば(YES)、フラッシュ検出部20は、処理をステップS3216に移行させ、全有効ラインが終了したと判定されなければ(NO)、フラッシュ検出部20は、処理をステップS3201に戻してステップS3201以降を繰り返す。フラッシュ検出部20は、ステップS3216にて、ライン平均輝度の加算値を有効ライン数で除算して全画面平均輝度を算出し、全画面平均輝度を保持する。   In step S3215, the flash detection unit 20 determines whether the determination for all active lines is completed. If it is determined that the determination for all the effective lines is completed (YES), the flash detection unit 20 shifts the process to step S3216. If it is not determined that all the effective lines are completed (NO), the flash detection unit 20 Returns the process to step S3201, and repeats step S3201 and subsequent steps. In step S3216, the flash detection unit 20 calculates the total screen average brightness by dividing the added value of the line average brightness by the number of effective lines, and holds the total screen average brightness.

第2実施形態によれば、第1実施形態よりもフラッシュが発光したか否かの検出精度を向上させることができる。図12を用いて、検出精度を向上させることができる理由について説明する。   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.

図12は、画面内に部分的に矩形状の高輝度領域Arhが含まれる画像Imiの例を示している。ハッチングを付した高輝度領域Arhは例えば白レベルであるとする。高輝度領域Arhは矩形状でなくてもよい。有効ラインLneにおいては、ライン平均輝度は比較的高い値となる。有効ラインLne以外のラインでも高輝度領域Arhが存在している垂直方向の範囲では同様である。従って、第1実施形態においては、高輝度領域Arhが存在している垂直方向の範囲でフラッシュが発光したと誤判定する可能性がある。   FIG. 12 shows an example of an image Imi in which a high-luminance area Arh that is partially rectangular in the screen is included. 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.

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

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

第2実施形態によれば、フラッシュ補正部80を有することによる第1実施形態と同じ効果を奏するとともに、フラッシュ検出部2の代わりにフラッシュ検出部20を設けたことによるフラッシュが発光したか否かの検出精度を向上させることができるという効果を奏する。   According to the second embodiment, the same effect as that of the first embodiment by having the flash correction unit 80 is obtained, and whether or not the flash by providing the flash detection unit 20 instead of the flash detection unit 2 emits light. It is possible to improve the detection accuracy.

<第3実施形態>
第3実施形態の画像処理装置の構成は、図1に示す第1実施形態のビデオカメラ101または図10に示す第2実施形態のビデオカメラ102と同様である。図13,図14を用いて、第3実施形態における動作について説明する。図13において、図3と同一のステップには同一の符号を付し、その説明を適宜省略する。図14は、画像処理装置の構成を、フラッシュ検出部2を有する図1のビデオカメラ101と同様の構成とした場合の処理を示している。
<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. The operation in the third embodiment will be described with reference to FIGS. In FIG. 13, the same steps as those in FIG. FIG. 14 shows processing when the configuration of the image processing apparatus is the same as that of the video camera 101 of FIG.

図13において、制御部9は、ステップS1にて、操作スイッチ12による撮影開始の指示があったか否かを判定する。撮影開始の指示があったと判定されれば(YES)、制御部9は、ステップS2にて、絞り及びシャッタースピード等の条件に合わせて撮像部1を制御して撮影を開始させる。撮影開始の指示があったと判定されなければ(NO)、制御部9は処理をステップS1に戻してステップS1を繰り返す。   In FIG. 13, 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. 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は、ステップS300にて、フラッシュ検出部2によるフラッシュ検出処理及びフラッシュ補正部80によるフラッシュ補正処理を実行させる。また、制御部9は、ステップS3と並行して、ステップS4にて、画像信号処理部3による画像信号処理を実行させる。制御部9は、ステップS5にて、出力信号処理部6を制御して表示部7に撮影した画像を表示させる。表示部7に表示させる画像は、撮影した画像そのままでもよいし、フラッシュ補正部80によってフラッシュ補正処理を施した画像でもよい。   In step S <b> 300, 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 80 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. In step S5, the control unit 9 controls the output signal processing unit 6 to display the captured image on the display unit 7. The image displayed on the display unit 7 may be a captured image as it is, or an image that has been subjected to flash correction processing by the flash correction unit 80.

制御部9は、ステップS6にて、操作スイッチ12による記録開始の指示があったか否かを判定する。記録開始の指示があったと判定されれば(YES)、制御部9は、ステップS7にて、フラッシュ補正部80によってフラッシュ補正処理が施され、圧縮伸張処理部5によって圧縮処理された符号化データを記録再生部11に記録させる。なお、フラッシュ補正部80によってフラッシュ補正処理が施された画像データはバッファメモリ4に一旦保持されて、圧縮伸張処理部5によって圧縮処理される。記録開始の指示があったと判定されなければ(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 performs the flash correction processing by the flash correction unit 80 and the compression data compressed by the compression / decompression processing unit 5 in step S7. Is recorded in the recording / reproducing unit 11. The image data subjected to the flash correction process by the flash correction unit 80 is temporarily held in the buffer memory 4 and is compressed by the compression / decompression processing unit 5. 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以降を繰り返す。   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.

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

図14において、フラッシュ検出部2は、ステップS301にて、有効ラインにおける有効画素の画素値を加算する処理を有効ラインごとに順次実行する。有効ラインとは垂直ブランキング期間を除く期間のラインであり、有効画素とは水平ブランキング期間を除く期間の画素である。フラッシュ検出部2は、ステップS302にて、ステップS301にて得た画素値の加算値を有効画素数で除算してライン平均輝度を算出し、ライン平均輝度を保持する。   In FIG. 14, in step S301, the flash detection unit 2 sequentially executes the process of adding the pixel values of the 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にて、差分値が閾値以上のラインを検出したか否かを判定する。   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.

この際の閾値は、好ましくは被写体の状況によって変化させるべきであるが、実験によって最適な値を求めて設定すればよい。他者のフラッシュの発光によって明るさが大きく変化した状態を検出するため、閾値は、入力されたG信号のダイナミックレンジよりも十分に大きい値とすることが好ましい。閾値を小さくするほど、フラッシュ発光の検出感度を高めることができる。なお、ステップS300でフラッシュ検出・補正処理を開始する際、最初の1画面はそれ以前の画面の全画面平均輝度が保存されていないため、差分値を算出しないようにするとよい。   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. The detection sensitivity of flash emission can be increased as the threshold value is decreased. Note that when the flash detection / correction process is started in step S300, it is preferable not to calculate the difference value because the average brightness of the entire screen of the previous one screen is not saved.

差分値が閾値以上のラインを検出したと判定されれば(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”へと切り換え、この切り換えた検出信号と、記憶している検出ライン情報とをフラッシュ補正部80に供給するとともに、検出ライン情報を消去する。フラッシュ検出部2及びフラッシュ補正部80は、ステップS308にて、設定されているモードが領域補正モードであるか否かを判定する。領域補正モードであると判定されれば(YES)、フラッシュ補正部80は、処理をステップ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 80 and the detection line information is erased. In step S308, the flash detection unit 2 and the flash correction unit 80 determine whether or not the set mode is the region correction mode. If it is determined that the region correction mode is set (YES), the flash correction unit 80 shifts the processing to step S309. If it is not determined that the area correction mode is set (NO), the flash detection unit 2 shifts the process to step S316.

フラッシュ補正部80は、ステップS309にて、供給された検出ライン情報が示す、1画面前のラインへの置換を開始する。フラッシュ検出部2は、ステップS310にて、差分値が閾値未満のラインを検出したか否かを判定する。差分値が閾値未満のラインを検出したと判定されれば(YES)、フラッシュ検出部2は、処理をステップS311に移行させる。なお、この際、フラッシュ検出部2は、検出したラインがフレームの最初のラインから何ライン目かを示す検出ライン情報を記憶しておく。記憶する検出ライン情報はラインが連続して検出される場合は最初の1ライン目のみでよい。一方、差分値が閾値未満のラインを検出したと判定されなければ(NO)、フラッシュ検出部2は、記憶していた検出ライン情報を消去するとともに、処理をステップS314に移行させる。   In step S309, the flash correction unit 80 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”へと切り換え、この切り換えた検出信号と、記憶している検出ライン情報とをフラッシュ補正部80に供給するとともに検出ライン情報を消去する。フラッシュ補正部80は、ステップS313にて、供給された検出ライン情報が示す、1画面前のラインへの置換を終了し、フラッシュ検出部2は、処理をステップS314に移行させる。フラッシュ検出部2は、ステップS314にて、全有効ラインに対する判定が終了したか否かを判定する。全有効ラインに対する判定が終了したと判定されれば(YES)、フラッシュ検出部2は、処理をステップS315に移行させ、全有効ラインが終了したと判定されなければ(NO)、フラッシュ検出部2は、処理をステップS305に戻してステップS305以降を繰り返す。   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 80. Delete detection line information. In step S313, the flash correction unit 80 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 S305 and repeats step S305 and subsequent steps.

フラッシュ検出部2は、ステップS315にて、ライン平均輝度の加算値を有効ライン数で除算して全画面平均輝度を算出し、全画面平均輝度を保持して、ステップS320に移行させる。フラッシュ補正部80は、ステップS320にて、補正した画面の全体に所定値以上の輝度信号を加算することによって擬似的なフラッシュ発光の効果を付加して、図13のステップ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 S320. In step S320, the flash correction unit 80 adds a pseudo flash emission effect by adding a luminance signal of a predetermined value or more to the entire corrected screen, and proceeds to step S5 in FIG.

一方、ステップS308にて領域補正モードであると判定されなかった(即ち、画面単位切換モードであると判定された)場合、フラッシュ検出部2は、ステップS316にて、全有効ラインに対する判定が終了したか否かを判定する。全有効ラインに対する判定が終了したと判定されなければ(NO)、フラッシュ検出部2は、ステップS316の処理を繰り返す。全有効ラインに対する判定が終了したと判定されれば(YES)、フラッシュ検出部2は、ステップS317にて、ライン平均輝度の加算値を有効ライン数で除算して全画面平均輝度を算出し、全画面平均輝度を保持する。   On the other hand, if it is not determined in step S308 that the area correction mode is set (that is, it is determined that the screen unit switching mode is set), the flash detection unit 2 ends the determination for all 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.

フラッシュ補正部80は、ステップS318にて、次の画面に移行したか否かを判定する。次の画面に移行したか否かの情報は、フラッシュ検出部2または制御部9からフラッシュ補正部80へと供給すればよい。次の画面に移行したと判定されなければ(NO)、フラッシュ補正部80は、ステップS318の処理を繰り返す。次の画面に移行したと判定されれば(YES)、フラッシュ補正部80は、ステップS319にて、フラッシュの発光が検出された現在の画面を過去の正常画面に置換して、ステップS320に移行させる。   In step S318, the flash correction unit 80 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 80. If it is not determined that the screen has shifted to the next screen (NO), the flash correction unit 80 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 80 replaces the current screen in which flash emission has been detected with a normal screen in the past, and then proceeds to step S320. Let

画面単位切換モードである場合も同様に、フラッシュ補正部80は、ステップS320にて、補正した画面の全体に所定値以上の輝度信号を加算することによって擬似的なフラッシュ発光の効果を付加して、図13のステップS5へと移行させる。   Similarly, in the screen unit switching mode, the flash correction unit 80 adds a pseudo flash emission effect by adding a luminance signal of a predetermined value or more to the entire corrected screen in step S320. Then, the process proceeds to step S5 in FIG.

図14では、ステップS315及びステップS319の後段にステップS320の処理を設けているが、ステップS320を設ける位置は図14に示す位置に限定されない。   In FIG. 14, the process of step S320 is provided after the steps S315 and S319, but the position where the step S320 is provided is not limited to the position shown in FIG.

第3実施形態においては、フラッシュ補正部80が、図6,図9と同様に、少なくともフラッシュの発光によって高輝度となっている領域のラインを補正するとともに、擬似的にフラッシュ発光の効果を付加する補正処理を施した画像データを記録再生部11に記録することができる。よって、第3実施形態においては、第1実施形態のように、フラッシュ検出部2で検出したフラッシュ発光の開始ライン及び終了ラインを示す検出ライン情報をメタデータとして記録再生部11に記録させる必要はない。   In the third embodiment, the flash correction unit 80 corrects at least a line in a region that is bright due to flash emission, and adds a pseudo flash emission effect, as in FIGS. The image data subjected to the correction processing can be recorded in the recording / reproducing unit 11. Therefore, in the third embodiment, as in the first embodiment, it is necessary to cause the recording / reproducing unit 11 to record the detection line information indicating the start line and the end line of the flash emission detected by the flash detection unit 2 as metadata. Absent.

前述のように、ステップS5では、表示部7に画像データを補正しない状態で表示させてもよいし、フラッシュ補正部80によって補正した画像データを表示部7に表示させてもよい。フラッシュの発光によって部分的に高輝度となったとしても画像データを補正しない状態で表示部7に表示させれば、表示部7に表示させる画像データを遅延させることがない。フラッシュ補正部80によって補正した画像データを表示部7に表示させれば、後に記録再生部11に記録した画像データを再生しなくても、補正された画像データを確認することができる。   As described above, in step S5, the image data may be displayed on the display unit 7 without being corrected, or the image data corrected by the flash correction unit 80 may be displayed on the display unit 7. Even if the brightness of the flash is partially increased, if the image data is displayed on the display unit 7 without correction, the image data to be displayed on the display unit 7 is not delayed. If the image data corrected by the flash correction unit 80 is displayed on the display unit 7, the corrected image data can be confirmed without reproducing the image data recorded in the recording / reproducing unit 11 later.

図14は、画像処理装置の構成を、フラッシュ検出部2を有する図1のビデオカメラ101と同様の構成とした場合の処理を示しているが、画像処理装置の構成を、フラッシュ検出部20を有する図10のビデオカメラ102と同様の構成とした場合の処理としてもよい。即ち、第2実施形態においても、フラッシュ補正部80によって補正した画像データを記録再生部11に記録するように構成することができる。   FIG. 14 shows processing when the configuration of the image processing apparatus is the same as that of the video camera 101 of FIG. 1 having the flash detection unit 2, but the configuration of the image processing apparatus is changed to that of the flash detection unit 20. The processing in the case of the same configuration as the video camera 102 of FIG. That is, also in the second embodiment, the image data corrected by the flash correction unit 80 can be recorded in the recording / reproducing unit 11.

本発明は以上説明した各実施形態に限定されるものではなく、本発明の要旨を逸脱しない範囲において種々変更可能である。各実施形態ではビデオカメラを例としたが、画像データを扱う任意の電子機器において本発明の画像処理装置及び方法を用いることができる。例えば、画像表示装置やコンピュータ等の情報処理装置において各実施形態の画像処理装置を搭載し、画面の一部が高輝度となっている画像データを画像表示装置や情報処理装置の内部で補正するようにしてもよい。   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, but the image processing apparatus and method 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 completed the process in the image signal processing part 3 was shown, you may correct | amend the video data before processing by the image signal processing 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.

本発明の画像処理装置及び方法と同等の構成をコンピュータプログラム(画像処理プログラム)によって実現することも可能である。画像処理プログラムを記録媒体に記録して提供してもよく、インターネット等の通信回線にて画像処理プログラムを配信してもよい。記録媒体に記録された画像処理プログラムや通信回線にて配信された画像処理プログラムを画像処理装置に記憶させて、上述した画像処理方法を実行させるようにしてもよい。   A configuration equivalent to the image processing apparatus and method of the present invention can be realized by a computer program (image processing program). The image processing program 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 表示部
9 制御部
10 メモリ
11 記録再生部
12 操作スイッチ
21,203 ライン平均輝度算出部
23,205 全画面平均輝度算出部
25,207 差分算出部
26,208 フラッシュ判定部
80 フラッシュ補正部
81 補正制御部
82 補正処理部
83 効果処理部
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)
DESCRIPTION OF SYMBOLS 5 Compression / decompression process part 6 Output signal process part 7 Display part 9 Control part 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 unit 80 Flash correction unit 81 Correction control unit 82 Correction processing unit 83 Effect processing unit 101, 102 Video camera 201 Block average luminance calculation unit

Claims (7)

画像データで構成される画面内にフラッシュの発光によって高輝度となっているラインが含まれるか否かを検出するフラッシュ検出部と、
前記画像データの過去の画面を保持する保持部と、
前記フラッシュ検出部によって高輝度となっているラインが含まれていることが検出された場合、少なくとも高輝度となっているラインを前記保持部に保持された前記過去の画面のラインに置換することにより画像データを補正する補正処理部と、
前記補正処理部によって補正した画面のうち少なくとも1つの画面を効果付加対象画面とし、前記効果付加対象画面を構成する画像データに対して擬似的なフラッシュ発光の効果を付加する効果処理部と、
前記効果処理部によって擬似的なフラッシュ発光の効果が付加された画像データを記録する記録部と、
を備えることを特徴とする画像処理装置。
A flash detection unit that detects whether or not a line that is bright due to flash emission is included in a screen composed of image data;
A holding unit for holding a past screen of the image data;
When the flash detection unit detects that a line with high luminance is included, at least the line with high luminance is replaced with the line of the past screen held in the holding unit. A correction processing unit for correcting image data by
An effect processing unit that sets at least one of the screens corrected by the correction processing unit as an effect addition target screen and adds a pseudo flash emission effect to image data constituting the effect addition target screen;
A recording unit for recording image data to which a pseudo flash emission effect is added by the effect processing unit;
An image processing apparatus comprising:
前記効果処理部は、前記効果付加対象画面を構成する画像データに対して輝度信号の固定値を加算することによって擬似的なフラッシュ発光の効果を付加することを特徴とする請求項1記載の画像処理装置。   2. The image according to claim 1, wherein the effect processing unit adds a pseudo flash emission effect by adding a fixed value of a luminance signal to the image data constituting the effect addition target screen. Processing equipment. 前記効果処理部は、前記効果付加対象画面を構成する画像データの輝度信号と色差信号に対して個別に設定したゲインを乗算することによって擬似的なフラッシュ発光の効果を付加することを特徴とする請求項1記載の画像処理装置。   The effect processing unit adds a pseudo flash emission effect by multiplying a luminance signal and a color difference signal of image data constituting the effect addition target screen by individually set gains. The image processing apparatus according to claim 1. 前記フラッシュ検出部は、
検出対象画面におけるそれぞれのラインのライン平均輝度を算出するライン平均輝度算出部と、
前記ライン平均輝度算出部で算出された1画面におけるそれぞれのラインのライン平均輝度に基づいて、前記検出対象画面の少なくとも1画面前の画面である過去の画面の全画面平均輝度を算出する全画面平均輝度算出部と、
前記検出対象画面におけるそれぞれのラインの前記ライン平均輝度と前記全画面平均輝度とを比較することによって、前記検出対象画面内のラインがフラッシュの発光によって高輝度となっているか否かを判定するフラッシュ判定部と、
を有することを特徴とする請求項1〜3のいずれか1項に記載の画像処理装置。
The flash detection unit
A line average luminance calculation unit for calculating the line average luminance of each line in the detection target screen;
A full screen for calculating a total screen average brightness of a past screen, which is a screen at least one screen before the detection target screen, based on the line average brightness of each line in one screen calculated by the line average brightness calculation unit. An average luminance calculator;
A flash that determines whether or not a line in the detection target screen has high luminance due to flash emission by comparing the line average luminance of each line in the detection target screen with the average luminance of the entire screen. A determination unit;
The image processing apparatus according to claim 1, further comprising:
前記フラッシュ検出部は、
検出対象画面におけるラインを複数のブロックに分割したそれぞれのブロックのブロック平均輝度を算出するブロック平均輝度算出部と、
前記ブロック平均輝度算出部で算出された1ラインにおけるブロック平均輝度に基づいて、前記検出対象画面におけるそれぞれのラインのライン平均輝度を算出するライン平均輝度算出部と、
前記ライン平均輝度算出部で算出された1画面におけるそれぞれのラインのライン平均輝度に基づいて、前記過去の画面の全画面平均輝度を算出する全画面平均輝度算出部と、
前記ブロック平均輝度と前記全画面平均輝度との差分と、前記ライン平均輝度と前記全画面平均輝度との差分とをそれぞれ算出する差分算出部と、
前記ライン平均輝度と前記全画面平均輝度との差分が第1の閾値以上であり、前記ブロック平均輝度と前記全画面平均輝度との差分が第2の閾値以上である条件が所定ライン以上継続した場合にフラッシュの発光によって高輝度となっていると判定するフラッシュ判定部と、
を有することを特徴とする請求項1〜3のいずれか1項に記載の画像処理装置。
The flash detection unit
A block average luminance calculating unit for calculating a block average luminance of each block obtained by dividing a line on the detection target screen into a plurality of blocks;
A line average luminance calculating unit that calculates line average luminance of each line in the detection target screen based on the block average luminance in one line calculated by the block average luminance calculating unit;
A full-screen average luminance calculating unit that calculates the full-screen average luminance of the past screen based on the line average luminance of each line in one screen calculated by the line-average luminance calculating unit;
A difference calculating unit for calculating a difference between the block average luminance and the full screen average luminance, and a difference between the line average luminance and the full screen average luminance, respectively;
The condition that the difference between the line average luminance and the full screen average luminance is equal to or greater than a first threshold and the difference between the block average luminance and the full screen average luminance is equal to or greater than a second threshold continues for a predetermined line or more. A flash determination unit that determines that the brightness is high due to flash emission,
The image processing apparatus according to claim 1, further comprising:
前記フラッシュ検出部は、フラッシュの発光によって高輝度となっている最初のラインであるフラッシュ開始ラインと最後のラインであるフラッシュ終了ラインとを検出し、
前記補正処理部は、前記フラッシュ開始ラインよりも上方に位置し、前記フラッシュ開始ラインに隣接する第1の隣接領域と、前記フラッシュ終了ラインよりも下方に位置し、前記フラッシュ終了ラインに隣接する第2の隣接領域とをそれぞれ設定し、前記第1の隣接領域では、前記第1の隣接領域の最初のラインから最後のラインに進行するに従って前記検出対象画面の画像データを順次減少させ、前記過去の画面の画像データを順次増加させるように両者の画像データを混合し、前記第2の隣接領域では、前記第2の隣接領域の最初のラインから最後のラインに進行するに従って前記過去の画面の画像データを順次減少させ、前記検出対象画面の画像データを順次増加させるように両者の画像データを混合する
ことを特徴とする請求項4または5に記載の画像処理装置。
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 correction processing unit is located above the flash start line, is adjacent to the flash start line, is located below the flash end line, and is adjacent to the flash end line. 2 adjacent regions are set, and in the first adjacent region, the image data of the detection target screen is sequentially reduced as the first line advances from the first line to the last line of the first adjacent region. 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. 5. The image data is mixed in such a manner that the image data is sequentially decreased and the image data on the detection target screen is sequentially increased. Or the image processing apparatus of 5.
画像データで構成される画面内にフラッシュの発光によって高輝度となっているラインが含まれるか否かを検出し、
前記画像データの過去の画面を保持部に保持し、
高輝度となっているラインが含まれていることが検出された場合、少なくとも高輝度となっているラインを前記保持部に保持された前記過去の画面のラインに置換することにより画像データを補正し、
補正した画面のうち少なくとも1つの画面を効果付加対象画面とし、前記効果付加対象画面を構成する画像データに対して擬似的なフラッシュ発光の効果を付加し、
擬似的なフラッシュ発光の効果が付加された画像データを記録部に記録する
ことを特徴とする画像処理方法。
Detect whether the screen composed of image data contains lines that are bright due to flash emission,
Holding a past screen of the image data in a holding unit;
When it is detected that a line with high luminance is included, the image data is corrected by replacing at least the line with high luminance with the line of the past screen held in the holding unit. And
At least one of the corrected screens is set as an effect addition target screen, and a pseudo flash emission effect is added to the image data constituting the effect addition target screen,
An image processing method, wherein image data to which a pseudo flash emission effect is added is recorded in a recording unit.
JP2012229512A 2012-10-17 2012-10-17 Image processing apparatus and method Active JP5900278B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012229512A JP5900278B2 (en) 2012-10-17 2012-10-17 Image processing apparatus and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012229512A JP5900278B2 (en) 2012-10-17 2012-10-17 Image processing apparatus and method

Publications (2)

Publication Number Publication Date
JP2014082657A JP2014082657A (en) 2014-05-08
JP5900278B2 true JP5900278B2 (en) 2016-04-06

Family

ID=50786460

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012229512A Active JP5900278B2 (en) 2012-10-17 2012-10-17 Image processing apparatus and method

Country Status (1)

Country Link
JP (1) JP5900278B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6579818B2 (en) * 2015-06-19 2019-09-25 キヤノン株式会社 Imaging device, control method thereof, and control program
CN113612991A (en) * 2021-09-15 2021-11-05 深圳市丘钛微电子科技有限公司 Brightness uniformity detection method and device of light supplement type camera

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5144481B2 (en) * 2008-12-02 2013-02-13 富士フイルム株式会社 Imaging apparatus and imaging method
JP2012120019A (en) * 2010-12-02 2012-06-21 Nikon Corp Camera

Also Published As

Publication number Publication date
JP2014082657A (en) 2014-05-08

Similar Documents

Publication Publication Date Title
US11228720B2 (en) Method for imaging controlling, electronic device, and non-transitory computer-readable storage medium
JP5968068B2 (en) Imaging apparatus for controlling exposure, control method for imaging apparatus, program, and recording medium
JP6521776B2 (en) Image processing apparatus, image processing method
US8373769B2 (en) Imaging apparatus, imaging processing method and recording medium
CN108833804A (en) Imaging method, device and electronic equipment
CN110166707A (en) Image processing method, device, electronic equipment and storage medium
US11601600B2 (en) Control method and electronic device
JP2009017229A (en) Imaging device and imaging control method
CN110166706A (en) Image processing method, device, electronic equipment and storage medium
JP5156991B2 (en) Imaging apparatus, imaging method, and imaging program
JP5928319B2 (en) Image processing apparatus and method
JP5225137B2 (en) Imaging apparatus, image processing method, and program
JP5984975B2 (en) Imaging apparatus, imaging method, and program
JP2013192200A (en) Image processing apparatus, image processing method, and image processing program
CN109005363B (en) Imaging control method, imaging control device, electronic device and storage medium
JP5900278B2 (en) Image processing apparatus and method
US20130208144A1 (en) Image processing device, image processing method, image processing program
JP5900217B2 (en) Image processing apparatus and method
JP5822606B2 (en) Image processing apparatus and image processing apparatus control method
JP5392336B2 (en) Imaging apparatus, imaging method, and imaging program
JP7397640B2 (en) Image processing device and image processing method
JP5757472B2 (en) Image processing apparatus, image processing method, and image processing program
JP6075829B2 (en) IMAGING DEVICE, CAMERA SYSTEM, IMAGING DEVICE CONTROL METHOD, PROGRAM, AND STORAGE MEDIUM
JP4964062B2 (en) Electronic camera
JP5757471B2 (en) Image processing apparatus, image processing method, and image processing program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150331

TRDD Decision of grant or rejection written
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160129

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20160209

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160222

R150 Certificate of patent or registration of utility model

Ref document number: 5900278

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150