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

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

Info

Publication number
JP5853369B2
JP5853369B2 JP2011011907A JP2011011907A JP5853369B2 JP 5853369 B2 JP5853369 B2 JP 5853369B2 JP 2011011907 A JP2011011907 A JP 2011011907A JP 2011011907 A JP2011011907 A JP 2011011907A JP 5853369 B2 JP5853369 B2 JP 5853369B2
Authority
JP
Japan
Prior art keywords
gradient
image
edges
evaluation value
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2011011907A
Other languages
Japanese (ja)
Other versions
JP2012155000A (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.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co Ltd
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 Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP2011011907A priority Critical patent/JP5853369B2/en
Publication of JP2012155000A publication Critical patent/JP2012155000A/en
Application granted granted Critical
Publication of JP5853369B2 publication Critical patent/JP5853369B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Focusing (AREA)
  • Automatic Focus Adjustment (AREA)
  • Studio Devices (AREA)

Description

本発明は、画像処理装置、画像処理方法及びプログラムに関し、特に、手前にフェンス等が存在しても、着目する被写体に合焦させる技術に関する。   The present invention relates to an image processing apparatus, an image processing method, and a program, and more particularly, to a technique for focusing on a subject of interest even when a fence or the like is present in front.

従来より、AF(Automatic Focus:オートフォーカス)処理を実行可能な撮像装置が存在する。代表的なAF評価処理の手法としては、画像信号に含まれる周波数成分(直流成分を除く)が合焦レンズ位置(合焦位置)で最大になることを利用して、画像信号に含まれる周波数成分の量を評価値として合焦状態を検出する、というものが存在する。そして、この手法により検出される評価値は、撮像画像の一領域から検出される。この検出される評価値を、以下、「AF評価値」と呼び、AF評価値が検出される当該一領域を、以下、「AF評価エリア」と呼ぶ。   2. Description of the Related Art Conventionally, there is an imaging apparatus that can execute AF (Automatic Focus) processing. As a typical AF evaluation processing method, the frequency component (excluding the DC component) included in the image signal is maximized at the focus lens position (focus position), and the frequency included in the image signal is used. There is one that detects the in-focus state using the amount of the component as an evaluation value. The evaluation value detected by this method is detected from one area of the captured image. The detected evaluation value is hereinafter referred to as “AF evaluation value”, and the one area where the AF evaluation value is detected is hereinafter referred to as “AF evaluation area”.

このようなAF評価エリアの従来の設定手法としては、複数のAF評価エリアの各々に関して合焦レンズ位置を演算し、演算された複数の合焦レンズ位置のうち、最至近の合焦レンズ位置に対応するAF評価エリアを選択する、という手法が特許文献1に記載されている。   As a conventional setting method for such an AF evaluation area, a focus lens position is calculated for each of a plurality of AF evaluation areas, and the closest focus lens position is calculated among the calculated focus lens positions. A method of selecting a corresponding AF evaluation area is described in Patent Document 1.

特開2004−361484号公報JP 2004-361484 A

しかしながら、特許文献1に記載の手法では、特異なケースとして動物等の被写体の手前にフェンス等が存在するといった場合は、フェンス等の位置が合焦レンズ位置として算出される場合がある。つまり、フェンス等は被写体よりも手前にあり、撮像装置の最至近に存在することが多いため、フェンス等の位置が合焦レンズ位置として算出されAF評価エリアが選択されて、フェンス等に合焦してしまう。即ち、被写体の手前にフェンス等が存在すると、これを着目すべき被写体と見做し、真に着目すべき被写体に合焦できない場合がある。   However, in the method described in Patent Document 1, when a fence or the like is present in front of a subject such as an animal as a special case, the position of the fence or the like may be calculated as the focus lens position. In other words, since the fence or the like is in front of the subject and is often located closest to the imaging device, the position of the fence or the like is calculated as the focusing lens position, the AF evaluation area is selected, and the fence or the like is focused. Resulting in. In other words, if there is a fence or the like in front of the subject, this may be regarded as a subject to be focused on and may not be focused on the subject to be truly focused.

本発明は、このような状況に鑑みてなされたものであり、複数の対象が遠近方向に存在する環境において、遠い位置にある方の対象に着目した画像処理を行うこと、例えば着目する被写体の手前にフェンス等が存在しても、着目する被写体に合焦させることを目的とする。   The present invention has been made in view of such a situation. In an environment in which a plurality of targets exist in the perspective direction, image processing focusing on a target at a far position is performed. The object is to focus on the subject of interest even if there is a fence or the like in front.

上記目的を達成するため、本発明の一態様の画像処理装置は、画像を取得する取得手段と、前記画像の輝度の勾配に基づいて、当該画像に含まれる勾配方向が略一定の全てのエッジを特定する特定手段と、前記特定手段によって特定された勾配方向が略一定の全てのエッジを含む領域を除外した画像領域からAF評価値を算出するAF評価値算出手段と、を備えたことを特徴とする。
In order to achieve the above object, an image processing apparatus according to an aspect of the present invention includes an acquisition unit that acquires an image, and all edges whose gradient direction is substantially constant based on the luminance gradient of the image. And an AF evaluation value calculating means for calculating an AF evaluation value from an image area excluding an area including all edges having a substantially constant gradient direction specified by the specifying means. Features.

本発明によれば、着目する被写体の手前にフェンス等が存在しても、着目する被写体に合焦させることができる。   According to the present invention, even when a fence or the like is present in front of the subject of interest, the subject of interest can be focused.

本発明に係る画像処理装置の一実施形態である撮像装置のハードウェアの構成を示すブロック図である。1 is a block diagram illustrating a hardware configuration of an imaging apparatus that is an embodiment of an image processing apparatus according to the present invention. 図1の撮像装置の機能的構成のうち、AF評価処理を実行するための機能的構成を示す機能ブロック図である。It is a functional block diagram which shows the functional structure for performing AF evaluation process among the functional structures of the imaging device of FIG. スルー画像を示す模式図である。It is a schematic diagram which shows a through image. 図3のスルー画像から輝度値を抽出して生成した輝度画像を示す模式図である。It is a schematic diagram which shows the luminance image produced | generated by extracting a luminance value from the through image of FIG. 図4の輝度画像の一部を、画素レベルに拡大して示す模式図である。FIG. 5 is a schematic diagram showing a part of the luminance image of FIG. 4 enlarged to a pixel level. 勾配ヒストグラムの作成を示す図である。It is a figure which shows preparation of a gradient histogram. AF評価処理の流れを説明するフローチャートである。It is a flowchart explaining the flow of AF evaluation processing. 変形例を示す図である。It is a figure which shows a modification.

以下、本発明の実施形態について、図を用いて説明する。
図1は、本発明に係る画像処理装置の一実施形態である撮像装置1のハードウェアの構成を示すブロック図である。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
FIG. 1 is a block diagram showing a hardware configuration of an imaging apparatus 1 which is an embodiment of an image processing apparatus according to the present invention.

撮像装置1は、CPU(Central Processing Unit)11と、ROM(Read Only Memory)12と、RAM(Random Access Memory)13と、画像処理部14と、バス15と、入出力インターフェース16と、撮像部17と、操作部18と、表示部19と、記憶部20と、通信部21と、ドライブ22と、を備えている。   The imaging device 1 includes a CPU (Central Processing Unit) 11, a ROM (Read Only Memory) 12, a RAM (Random Access Memory) 13, an image processing unit 14, a bus 15, an input / output interface 16, and an imaging unit. 17, an operation unit 18, a display unit 19, a storage unit 20, a communication unit 21, and a drive 22.

CPU11は、ROM12に記録されているプログラム、又は、記憶部20からRAM13にロードされたプログラムに従って各種の処理を実行する。   The CPU 11 executes various processes according to a program recorded in the ROM 12 or a program loaded from the storage unit 20 to the RAM 13.

RAM13には、CPU11が各種の処理を実行する上において必要なデータ等も適宜記憶される。   The RAM 13 appropriately stores data necessary for the CPU 11 to execute various processes.

画像処理部14は、DSP(Digital Signal Processor)や、VRAM(Video Random Access Memory)等から構成されており、CPU11と協働して、画像のデータに対して各種画像処理を施す。
例えば、画像処理部14は、後述する撮像部17から出力される撮像画像のデータに対して、ノイズ低減、ホワイトバランス、手ぶれ補正等の画像処理を施す。
The image processing unit 14 is configured by a DSP (Digital Signal Processor), a VRAM (Video Random Access Memory), and the like, and performs various image processing on image data in cooperation with the CPU 11.
For example, the image processing unit 14 performs image processing such as noise reduction, white balance, camera shake correction, and the like on captured image data output from the imaging unit 17 described later.

CPU11、ROM12、RAM13及び画像処理部14は、バス15を介して相互に接続されている。このバス15にはまた、入出力インターフェース16も接続されている。入出力インターフェース16には、撮像部17、操作部18、表示部19、記憶部20、通信部21及びドライブ22が接続されている。   The CPU 11, ROM 12, RAM 13, and image processing unit 14 are connected to each other via a bus 15. An input / output interface 16 is also connected to the bus 15. An imaging unit 17, an operation unit 18, a display unit 19, a storage unit 20, a communication unit 21, and a drive 22 are connected to the input / output interface 16.

撮像部17は、光学系31と、イメージセンサ32と、レンズ駆動部33と、を備えている。   The imaging unit 17 includes an optical system 31, an image sensor 32, and a lens driving unit 33.

光学系31は、被写体を撮像するための光を集光するレンズ、例えば、フォーカスレンズやズームレンズ等で構成される。
フォーカスレンズは、イメージセンサ32の受光面に被写体像を結像させるレンズであり、後述するレンズ駆動部33によって位置(合焦位置)が調節されることにより、被写体の合焦を行うレンズである。
ズームレンズは、焦点距離を一定の範囲で自在に変化させるレンズである。
The optical system 31 includes a lens that collects light for imaging a subject, such as a focus lens and a zoom lens.
The focus lens is a lens that forms a subject image on the light receiving surface of the image sensor 32, and is a lens that focuses the subject by adjusting a position (focusing position) by a lens driving unit 33 described later. .
The zoom lens is a lens that freely changes the focal length within a certain range.

イメージセンサ32は、光電変換素子や、AFE(Analog Front End)等から構成される。
光電変換素子は、例えばCMOS(Complementary Metal Oxide Semiconductor)型の光電変換素子等から構成される。光電変換素子には、光学系31から被写体像が入射される。そこで、光電変換素子は、被写体像を光電変換(撮像)して画像信号を一定時間蓄積し、蓄積した画像信号をアナログ信号としてAFEに順次供給する。
AFEは、このアナログの画像信号に対して、A/D(Analog/Digital)変換処理等の各種信号処理を実行する。AFEでの各種信号処理によって、ディジタル信号が生成され、撮像部17の出力信号として出力される。
なお、以下、撮像部17の出力信号を、「撮像画像のデータ」と呼ぶ。従って、撮像部17からは撮像画像のデータが出力されて、CPU11、画像処理部14、記憶部20等に適宜供給される。
The image sensor 32 includes a photoelectric conversion element, an AFE (Analog Front End), and the like.
The photoelectric conversion element is composed of, for example, a CMOS (Complementary Metal Oxide Semiconductor) type photoelectric conversion element or the like. The subject image is incident on the photoelectric conversion element from the optical system 31. Therefore, the photoelectric conversion element photoelectrically converts (captures) the subject image, accumulates the image signal for a predetermined time, and sequentially supplies the accumulated image signal as an analog signal to the AFE.
The AFE performs various signal processing such as A / D (Analog / Digital) conversion processing on the analog image signal. A digital signal is generated by various signal processing in the AFE and output as an output signal of the imaging unit 17.
Hereinafter, the output signal of the imaging unit 17 is referred to as “captured image data”. Accordingly, captured image data is output from the imaging unit 17 and is appropriately supplied to the CPU 11, the image processing unit 14, the storage unit 20, and the like.

レンズ駆動部33は、CPU11等の制御に基づいて、光学系31を構成するフォーカスレンズやズームレンズ等を駆動して、各位置を調整する。例えば、レンズ駆動部33は、後述するCPU11によるAF位置決定処理の結果に基づいて、ズームレンズを駆動して、その位置を調整する。   The lens driving unit 33 adjusts each position by driving a focus lens, a zoom lens, and the like constituting the optical system 31 based on the control of the CPU 11 and the like. For example, the lens driving unit 33 drives the zoom lens and adjusts the position based on the result of AF position determination processing by the CPU 11 described later.

操作部18は、例えば、図示せぬリレーズ釦等の各種釦により構成され、ユーザの指示操作を受け付ける。   The operation unit 18 includes, for example, various buttons such as a relay button (not shown), and accepts a user instruction operation.

表示部19は、各種画像を表示可能なディスプレイ等により構成される。   The display unit 19 includes a display that can display various images.

記憶部20は、DRAM(Dynamic Random Access Memory)等で構成され、後述するスルー画像、表示対象の原画像、当該原画像に合成され得る画像等の各種画像のデータを記憶する。   The storage unit 20 is configured by a DRAM (Dynamic Random Access Memory) or the like, and stores data of various images such as a through image described later, an original image to be displayed, and an image that can be combined with the original image.

通信部21は、インターネットを含むネットワークを介して他の装置(図示せず)との間で行う通信を制御する。   The communication unit 21 controls communication with other devices (not shown) via a network including the Internet.

ドライブ22には、磁気ディスク、光ディスク、光磁気ディスク、或いは半導体メモリ等よりなる、リムーバブルメディア23が適宜装着される。ドライブ22によってリムーバブルメディア23から読み出されたプログラムは、必要に応じて記憶部20にインストールされる。また、リムーバブルメディア23は、記憶部20に記憶されている画像のデータ等の各種データも、記憶部20と同様に記憶することができる。   A removable medium 23 composed of a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is appropriately attached to the drive 22. The program read from the removable medium 23 by the drive 22 is installed in the storage unit 20 as necessary. The removable medium 23 can also store various data such as image data stored in the storage unit 20 in the same manner as the storage unit 20.

撮像装置1は、以上のようなハードウェアの構成により、手前にフェンス等が存在しても、着目する被写体に合焦させることが可能なAF処理を実行することができる。   With the hardware configuration described above, the imaging apparatus 1 can execute AF processing that can focus on a subject of interest even when a fence or the like is present in front.

AF処理として、フォーカスレンズの各位置でAF評価値を算出する処理(以下、AF評価処理と呼ぶ)と、算出されたAF評価値を比較して、合焦位置を決定する処理(以下、AF位置決定処理と呼ぶ)とが含まれている。   As AF processing, processing for calculating an AF evaluation value at each position of the focus lens (hereinafter referred to as AF evaluation processing) and processing for determining an in-focus position by comparing the calculated AF evaluation values (hereinafter referred to as AF). Called position determination processing).

本実施形態では、このようなAF処理のうちAF評価処理として、手前にフェンス等の遮蔽物が存在しても、着目する被写体に合焦させるために、当該遮蔽物を考慮しないでAF評価値の算出が可能になるAF評価処理が採用されている。
そこで、以下、本実施形態で採用されているAF評価処理について主に説明する。
In the present embodiment, as an AF evaluation process among such AF processes, an AF evaluation value is considered without considering the shielding object in order to focus on the subject of interest even when a shielding object such as a fence exists in front. AF evaluation processing that enables calculation of the above is adopted.
Therefore, the AF evaluation process adopted in the present embodiment will be mainly described below.

図2は、図1の撮像装置1の機能的構成のうち、AF評価処理を実行するための機能的構成を示す機能ブロック図である。   FIG. 2 is a functional block diagram showing a functional configuration for executing the AF evaluation process among the functional configurations of the imaging apparatus 1 of FIG.

本実施形態では、画像処理部14は、AF評価処理を実行すべく、スルー画像取得部41と、輝度画像生成部42と、ノイズ除去部43と、勾配ヒストグラム作成部44と、勾配ピーク選定部45と、除外画素選定部46と、AF評価用画像生成部47と、AF評価部48と、を備える。   In the present embodiment, the image processing unit 14 performs a AF evaluation process, and a through image acquisition unit 41, a luminance image generation unit 42, a noise removal unit 43, a gradient histogram creation unit 44, and a gradient peak selection unit. 45, an excluded pixel selection unit 46, an AF evaluation image generation unit 47, and an AF evaluation unit 48.

なお、図2の機能的構成は例示であって、画像処理部14の機能の少なくとも一部を、画像処理部14以外の他の構成要素(CPU11等)に移譲させることも当然可能である。   2 is merely an example, and it is naturally possible to transfer at least a part of the functions of the image processing unit 14 to other components (CPU 11 or the like) other than the image processing unit 14.

スルー画像取得部41は、撮像部17から出力された撮像画像のデータを、スルー画像のデータとして取得する。
即ち、CPU11等は、AF評価処理の実行中やその前後に、スルー撮像処理及びスルー表示処理を実行することで、スルー画像を表示部19に表示させる。
具体的には、CPU11等は、例えば操作部18のレリーズ釦が半押しされると、撮像部17による撮像動作を継続させる。そして、CPU11等は、撮像部17による撮像動作が継続されている間、当該撮像部17から順次出力される撮像画像のデータを、メモリ(本実施形態では記憶部20)に一時的に記憶させる。このような一連の制御処理が、ここでいう「スルー撮像処理」である。
また、CPU11等は、スルー撮像処理の最中にメモリ(本実施形態では記憶部20)に一時的に記録された各撮像画像のデータを順次読み出して、当該撮像画像を表示部19に順次表示させる。このような一連の制御処理が、ここでいう「スルー表示処理」であり、スルー表示処理により表示部19に表示されている撮像画像を、以下、「スルー画像」と呼ぶ。
The through image acquisition unit 41 acquires the captured image data output from the imaging unit 17 as through image data.
That is, the CPU 11 or the like displays the through image on the display unit 19 by executing the through imaging process and the through display process during or before the AF evaluation process.
Specifically, for example, when the release button of the operation unit 18 is half-pressed, the CPU 11 or the like continues the imaging operation by the imaging unit 17. The CPU 11 and the like temporarily store captured image data sequentially output from the imaging unit 17 in the memory (the storage unit 20 in the present embodiment) while the imaging operation by the imaging unit 17 is continued. . Such a series of control processes is the “through imaging process” referred to herein.
In addition, the CPU 11 and the like sequentially read out data of each captured image temporarily recorded in the memory (the storage unit 20 in the present embodiment) during the through imaging process, and sequentially display the captured image on the display unit 19. Let Such a series of control processes is the “through display process” here, and the captured image displayed on the display unit 19 by the through display process is hereinafter referred to as a “through image”.

ここで、本実施形態の理解を容易なものとすべく、スルー画像取得部41が、図3に示すようなスルー画像のデータを取得したものとして、以下説明する。
図3は、スルー画像の一例を示す模式図である。
具体的には、図3には、フェンスFの奥に存在する被写体PO(例えば樹木)を撮像部17が撮像したときに得られた撮像画像が、スルー画像として表示部19に表示されている様子が示されている。
ここで、フェンスFは、被写体POの手前に存在する遮蔽物に該当し、所定の角度で折り曲げられた複数の列線が組み合わされることによって、平行四辺形の網目状となるように形成されたフェンス、いわゆる、ひし型金網(以下、「フェンス」と呼ぶ)である。
なお、スルー画像では、フェンスFは被写体よりも手前にあり、撮像装置の最至近に存在するため、フェンスFの位置が合焦レンズ位置として算出されフェンスFに合焦しているものとする。
Here, in order to facilitate understanding of the present embodiment, it will be described below that the through image acquisition unit 41 has acquired through image data as shown in FIG.
FIG. 3 is a schematic diagram illustrating an example of a through image.
Specifically, in FIG. 3, a captured image obtained when the imaging unit 17 images a subject PO (for example, a tree) that is present behind the fence F is displayed on the display unit 19 as a through image. The situation is shown.
Here, the fence F corresponds to a shield existing in front of the subject PO, and is formed to have a parallelogram mesh shape by combining a plurality of column lines bent at a predetermined angle. A fence, a so-called diamond wire mesh (hereinafter referred to as “fence”).
In the through image, since the fence F is in front of the subject and is closest to the imaging apparatus, the position of the fence F is calculated as the focus lens position and is in focus on the fence F.

図2に戻り、輝度画像生成部42は、スルー画像取得部41により取得されたスルー画像のデータから輝度成分を画素単位で抽出し、抽出された各輝度成分を画素値としてそれぞれ有する画像(以下、「輝度画像」と呼ぶ)のデータを生成する。
例えば、輝度画像生成部42は、図3に示すようなスルー画像のデータから、図4に示すような輝度画像のデータを生成する。
図4は、図3のスルー画像から生成された輝度画像の一例を示す模式図である。
図4の例の輝度画像においては、黒くなるほど輝度が低くなり、白くなる程輝度が高くなるようになされている。例えば、フェンスFは、その形状がはっきりと写っており、輝度が高いため白に近い色で表示されている。
Returning to FIG. 2, the luminance image generation unit 42 extracts luminance components in pixel units from the data of the through image acquired by the through image acquisition unit 41, and images each having the extracted luminance components as pixel values (hereinafter referred to as pixel values). , Called “luminance image”).
For example, the luminance image generation unit 42 generates luminance image data as illustrated in FIG. 4 from the through image data as illustrated in FIG. 3.
FIG. 4 is a schematic diagram illustrating an example of a luminance image generated from the through image of FIG.
In the luminance image in the example of FIG. 4, the luminance decreases as the color becomes black, and the luminance increases as the color becomes white. For example, the fence F is clearly shown in its shape and is displayed in a color close to white due to its high brightness.

図2に戻り、ノイズ除去部43は、輝度画像生成部42により生成された輝度画像のデータに対して、ノイズを除去する処理を施す。ノイズ除去部43におけるノイズの除去の手法は、主に画像内の輝度の変化を滑らかにする手法、即ち、いわゆる平滑化処理を目的とするものであれば足り、本実施形態においては、ガウスフィルタ(ガウシアンフィルタ)を用いた手法が採用されている。   Returning to FIG. 2, the noise removing unit 43 performs a process of removing noise on the luminance image data generated by the luminance image generating unit 42. A noise removal method in the noise removal unit 43 suffices as long as the method mainly smoothes a change in luminance in an image, that is, a so-called smoothing process. In the present embodiment, a Gaussian filter is sufficient. A method using a (Gaussian filter) is employed.

そして、画像の内の輝度の勾配を計算することでエッジの強さを計算し、勾配の方向からエッジの局所的方向を予測し、その方向の勾配が局所的に極大となる箇所を探す。なお本実施例においては、勾配ヒストグラム作成部44によって、輝度画像生成部42により生成された輝度画像のデータにおける輝度の勾配ヒストグラムを作成することで、画像の輝度の勾配を見積もる。   Then, the intensity of the edge is calculated by calculating the luminance gradient in the image, the local direction of the edge is predicted from the direction of the gradient, and a part where the gradient in the direction is locally maximum is searched. In the present embodiment, the gradient of the image brightness is estimated by creating a gradient histogram of the luminance in the luminance image data generated by the luminance image generating unit 42 by the gradient histogram generating unit 44.

ここで、勾配ヒストグラムの作成手法の一例について説明する。
勾配ヒストグラムとは、輝度画像のデータから画素単位で取得可能な勾配強度Mについての、勾配方向θ毎の分布を表した図である。
まず、勾配ヒストグラム作成部44は、輝度画像のデータから、各画素における勾配方向θをそれぞれ算出する。
各画素における勾配方向θは、例えば、次の式(1)により算出される。
ここで、式(1)の左辺の(x,y)とは、輝度画像において、処理の対象として注目すべき画素(以下、「注目画素」と呼ぶ)の位置を示す座標である。当該座標は、輝度画像において、水平右向方向をx軸として垂直下向方向をy軸として構築される直交座標系により表現される。即ち、左辺のθ(x,y)とは、輝度画像内の座標(x,y)に位置する画素、即ち注目画素の勾配方向θを示している。
式(1)の右辺のmod(α,β)は、値αを値βで除算した場合の剰余を出力するMODULO関数である。
H(x,y)は、輝度画像内の座標(x,y)に位置する画素、即ち注目画素における、水平(Horizon)方向のコントラストの度合い(以下、「水平コントラスト長」と呼ぶ)を示しており、次の式(2)によって定義される。
また、V(x,y)は、輝度画像内の座標(x,y)に位置する画素、即ち注目画素における、垂直(Vertical)方向のコントラストの度合い(以下、「垂直コントラスト長」と呼ぶ)を示しており、次の式(3)によって定義される。
式(2)及び式(3)において、P(xα,xb)は、輝度画像内の座標(xα,xb)についての輝度値(画素値)を示している。
Here, an example of a gradient histogram creation method will be described.
The gradient histogram is a diagram showing a distribution for each gradient direction θ with respect to the gradient intensity M that can be acquired in pixel units from the data of the luminance image.
First, the gradient histogram creation unit 44 calculates the gradient direction θ in each pixel from the luminance image data.
The gradient direction θ in each pixel is calculated by the following equation (1), for example.
Here, (x, y) on the left side of Equation (1) is a coordinate indicating the position of a pixel to be noted as a processing target (hereinafter referred to as “target pixel”) in the luminance image. In the luminance image, the coordinates are represented by an orthogonal coordinate system constructed with the horizontal right direction as the x axis and the vertical downward direction as the y axis. That is, θ (x, y) on the left side indicates the gradient direction θ of the pixel located at the coordinate (x, y) in the luminance image, that is, the target pixel.
Mod (α, β) on the right side of Equation (1) is a MODULO function that outputs a remainder when the value α is divided by the value β.
H (x, y) indicates the degree of contrast in the horizontal direction (hereinafter referred to as “horizontal contrast length”) at the pixel located at the coordinates (x, y) in the luminance image, that is, the target pixel. And is defined by the following equation (2).
V (x, y) is the degree of contrast in the vertical direction (hereinafter referred to as “vertical contrast length”) at the pixel located at the coordinate (x, y) in the luminance image, that is, the target pixel. And is defined by the following equation (3).
In the equations (2) and (3), P (xα, xb) represents the luminance value (pixel value) with respect to the coordinates (xα, xb) in the luminance image.

ここで、図5を参照して、式(2)の水平コントラスト長と式(3)の垂直コントラスト長についてさらに詳しく説明する。
図5は、図4の輝度画像の一部を、画素レベルに拡大して示す模式図である。
図5において、1つの黒丸印は、1つの画素を示している。同図には、x方向(水平方向)に5個分の画素、かつ、y方向(垂直方向)に5個分の画素で、総計25個(=5×5個)の画素が示されている。
ここで、注目画素と隣接する画素を、以下、「隣接画素」と呼ぶならば、式(2)の注目画素の水平コントラスト長H(x,y)は、右方の隣接画素の輝度値P(x+1、y)と、左方の隣接画素の輝度値P(x−1、y)との差分により求められる。また、式(3)の注目画素の垂直コントラスト長V(x,y)は、下方の隣接画素の輝度値P(x、y+1)と、上方の隣接画素の輝度値P(x、y−1)との差分により求められる。
具体的には例えば、右方の隣接画素の輝度値P(x+1、y)が、白を示す「1」であり、左方の隣接画素の輝度値P(x−1、y)が、黒を示す「0」であるとする。この場合、式(2)の注目画素の水平コントラスト長H(x,y)は、「1」(=1−0)になる。
また例えば、下方の隣接画素の輝度値P(x、y+1)が、白を示す「1」であり、上方の隣接画素の輝度値P(x、y―1)が、黒を示す「0」であるとする。この場合、式(3)の注目画素の垂直コントラスト長V(x,y)は、「1」(=1−0)になる。
従って、本例の場合、式(1)のtan−1{V(x,y)/H(x,y)}は、45度になるため、式(1)の右辺のMODULO関数の出力は、(45/180)の余りである45になる。即ち、注目画素の勾配方向θは、45度になる。
なお、このようにMODULO関数を用いて、全方位(0度乃至360度)で特定される角度を180度で除算してその余りを、注目画素の勾配方向θとして出力しているため、注目画素の勾配方向θは、0度乃至180度の範囲内で特定されることになる。
Here, with reference to FIG. 5, the horizontal contrast length of Expression (2) and the vertical contrast length of Expression (3) will be described in more detail.
FIG. 5 is a schematic diagram showing a part of the luminance image of FIG. 4 enlarged to the pixel level.
In FIG. 5, one black circle indicates one pixel. The figure shows a total of 25 (= 5 × 5) pixels, with 5 pixels in the x direction (horizontal direction) and 5 pixels in the y direction (vertical direction). Yes.
Here, if a pixel adjacent to the target pixel is hereinafter referred to as an “adjacent pixel”, the horizontal contrast length H (x, y) of the target pixel in Expression (2) is the luminance value P of the right adjacent pixel. It is obtained by the difference between (x + 1, y) and the luminance value P (x-1, y) of the left adjacent pixel. In addition, the vertical contrast length V (x, y) of the target pixel in Expression (3) is the luminance value P (x, y + 1) of the lower adjacent pixel and the luminance value P (x, y−1) of the upper adjacent pixel. ) And the difference.
Specifically, for example, the luminance value P (x + 1, y) of the right adjacent pixel is “1” indicating white, and the luminance value P (x−1, y) of the left adjacent pixel is black. It is assumed that it is “0” indicating In this case, the horizontal contrast length H (x, y) of the target pixel in Expression (2) is “1” (= 1-0).
Further, for example, the luminance value P (x, y + 1) of the lower adjacent pixel is “1” indicating white, and the luminance value P (x, y−1) of the upper adjacent pixel is “0” indicating black. Suppose that In this case, the vertical contrast length V (x, y) of the target pixel in Expression (3) is “1” (= 1-0).
Therefore, in this example, tan −1 {V (x, y) / H (x, y)} in equation (1) is 45 degrees, so the output of the MODULO function on the right side of equation (1) is , 45 which is the remainder of (45/180). That is, the gradient direction θ of the target pixel is 45 degrees.
Note that the MODULO function is used to divide the angle specified in all directions (0 degrees to 360 degrees) by 180 degrees, and the remainder is output as the gradient direction θ of the target pixel. The gradient direction θ of the pixel is specified within a range of 0 degrees to 180 degrees.

次に、輝度画像のデータから、各画素における勾配強度Mをそれぞれ算出する。
勾配強度Mは、全画素において、画素間の輝度の差分を算出することにより特定される。
各画素における勾配強度Mは、例えば次の式(4)により算出される。
式(4)に示すように、注目画素の勾配強度Mは、水平コントラスト長H(x,y)の2乗と垂直コントラスト長V(x,y)の2乗との和の平方根をとることによって演算される。
具体的には例えば、図5を用いて説明した上述の例では、式(2)の注目画素の水平コントラスト長H(x,y)は「1」となり、式(3)の注目画素の垂直コントラスト長V(x,y)は「1」となったので、注目画素の勾配強度Mは、「√2」になる。
Next, the gradient intensity M in each pixel is calculated from the luminance image data.
The gradient intensity M is specified by calculating a luminance difference between pixels in all pixels.
The gradient intensity M in each pixel is calculated by the following equation (4), for example.
As shown in Expression (4), the gradient intensity M of the pixel of interest takes the square root of the sum of the square of the horizontal contrast length H (x, y) and the square of the vertical contrast length V (x, y). Is calculated by
Specifically, for example, in the above-described example described with reference to FIG. 5, the horizontal contrast length H (x, y) of the target pixel in Expression (2) is “1”, and the vertical direction of the target pixel in Expression (3) is Since the contrast length V (x, y) is “1”, the gradient intensity M of the target pixel is “√2”.

なお、本実施形態においては、勾配強度Mは、注目画素が示す被写体についての、撮像装置1からの実際の距離が考慮される。具体的には例えば、注目画素が、撮像装置1から近い距離にある被写体の一部を示す画素である場合には、勾配強度Mに対する重み付けの度合いが高くなる。逆に、注目画素が、撮像装置1から遠い距離にある被写体の一部を示す画素である場合には、勾配強度Mに対する重み付けの度合いが低くなる。このように撮像装置1からの距離に応じて勾配強度Mの重み付けを変えることにより、近距離にある遮蔽物を示す画素の勾配強度Mが大きくなる一方、遠くの遮蔽物を示す画素の勾配強度Mが小さくなる。このため、例えば、手前にある金網等の被写体を積極的に除去することができるようになる。   In the present embodiment, the gradient strength M takes into account the actual distance from the imaging apparatus 1 regarding the subject indicated by the target pixel. Specifically, for example, when the target pixel is a pixel indicating a part of a subject at a distance close to the imaging device 1, the degree of weighting with respect to the gradient intensity M is increased. On the other hand, when the target pixel is a pixel indicating a part of a subject at a distance far from the imaging device 1, the degree of weighting with respect to the gradient intensity M is low. In this way, by changing the weighting of the gradient intensity M according to the distance from the imaging device 1, the gradient intensity M of the pixel indicating the shielding object at a short distance is increased, while the gradient intensity of the pixel indicating the distant shielding object is increased. M becomes smaller. For this reason, for example, it becomes possible to positively remove a subject such as a wire mesh in front.

このようにして、勾配ヒストグラム作成部44は、輝度画像を構成する全画素を対象に、勾配方向θ及び勾配強度Mを算出すると、その算出結果に基づいて、例えば図6に示すような勾配ヒストグラムを作成する。画素の勾配強度Mを画素が有する勾配角度とすると、勾配ヒストグラムは、画像に含まれる勾配角度の分布を表すということができる。   In this way, when the gradient histogram creating unit 44 calculates the gradient direction θ and the gradient intensity M for all the pixels constituting the luminance image, based on the calculation results, for example, a gradient histogram as shown in FIG. Create If the gradient intensity M of the pixel is a gradient angle of the pixel, it can be said that the gradient histogram represents the distribution of gradient angles included in the image.

図6は、図4の輝度画像から作成された勾配ヒストグラムを示している。
図6においては、縦軸は勾配強度Mを示し、横軸は勾配方向θを示す。
ここで、縦軸の勾配強度Mは、式(4)の各画素の算出値である勾配強度M(x,y)そのものを意味せず、各勾配方向θ毎の、同一の勾配方向θを有する画素群の各勾配強度M(x、y)(式(4)の各算出結果)の総和を示している。
ただし、本実施形態では、式(4)の各画素の勾配強度M(x,y)のうち、所定の閾値ThM以下のものは、ノイズの影響を受けている可能性があるものとして、勾配ヒストグラムに反映させない。即ち、勾配ヒストグラム作成部44は、ノイズ除去を行った上で、勾配ヒストグラムを作成する。
具体的には例えば、本実施形態では、次の式(5)に従って、勾配ヒストグラムが作成される。
式(5)において、「hist(θ)+=M(x,y)」とは、勾配ヒストグラムにおいて、所定の勾配方向θ(横軸の所定値)についての勾配強度M(縦軸の高さ)に対して、注目画素の式(4)の演算結果である勾配強度M(x、y)を加算する、という意味である。即ち、所定の勾配方向θ(横軸の所定値)を有する画素群のうち、その勾配強度M(x、y)が閾値ThMを超えているもののみが演算対象となり、演算対象となった各画素の勾配強度M(x、y)の総和が、当該所定の勾配方向θについての勾配強度M(縦軸の高さ)として、勾配ヒストグラムにプロットされる。換言すると、所定の勾配方向θ(横軸の所定値)を有する画素群のうち、その勾配強度M(x、y)が閾値ThM以下のものは演算対象とならずに、ノイズとして除去される。
FIG. 6 shows a gradient histogram created from the luminance image of FIG.
In FIG. 6, the vertical axis represents the gradient strength M, and the horizontal axis represents the gradient direction θ.
Here, the gradient intensity M on the vertical axis does not mean the gradient intensity M (x, y) itself, which is the calculated value of each pixel in Equation (4), and the same gradient direction θ for each gradient direction θ. The sum of the gradient intensities M (x, y) (calculation results of Expression (4)) of the pixel group is shown.
However, in this embodiment, among the gradient intensities M (x, y) of each pixel in Expression (4), those that are equal to or smaller than the predetermined threshold ThM are assumed to be affected by noise. Do not reflect on the histogram. That is, the gradient histogram creation unit 44 creates a gradient histogram after removing noise.
Specifically, for example, in this embodiment, a gradient histogram is created according to the following equation (5).
In Expression (5), “hist (θ) + = M (x, y)” means gradient strength M (vertical axis height) for a predetermined gradient direction θ (predetermined value on the horizontal axis) in the gradient histogram. ) Is added to the gradient intensity M (x, y), which is the calculation result of the expression (4) of the target pixel. That is, of the pixel group having a predetermined gradient direction θ (predetermined value on the horizontal axis), only those whose gradient intensity M (x, y) exceeds the threshold ThM are to be calculated, The sum of the gradient intensities M (x, y) of the pixels is plotted in the gradient histogram as the gradient intensity M (the height of the vertical axis) for the predetermined gradient direction θ. In other words, a pixel group having a predetermined gradient direction θ (predetermined value on the horizontal axis) whose gradient intensity M (x, y) is equal to or less than the threshold value ThM is not calculated and is removed as noise. .

以上、勾配ヒストグラムの作成手法の一例について説明した。このような作成手法に従って、図2の勾配ヒストグラム作成部44により作成された勾配ヒストグラムは、勾配ピーク選定部45に供給される。   Heretofore, an example of a gradient histogram creation method has been described. The gradient histogram created by the gradient histogram creation unit 44 of FIG. 2 according to such a creation method is supplied to the gradient peak selection unit 45.

勾配ピーク選定部45は、勾配ヒストグラム作成部44により作成された勾配ヒストグラムにおいて、勾配のピークを選定する。   The gradient peak selection unit 45 selects a gradient peak in the gradient histogram created by the gradient histogram creation unit 44.

勾配のピークとは、勾配ヒストグラムにおいて、所定の勾配方向θの勾配強度Mの極大点に該当する部分をいう。即ち、勾配強度Mが、勾配方向θが前後において最高値となっている部分(勾配強度Mを勾配方向θ方向に微分した場合に、その微分値が正から負に変わる部分)が、勾配のピークである。
勾配のピークとなっている勾配方向θは、スルー画像(原画像)に含まれるオブジェクトのうち、合焦しているオブジェクトのエッジの実角度(オブジェクトに対応する実物体の、実世界上での輪郭の角度)を示している可能性が高い。当該オブジェクトに合焦する程(ピントが合う程)、当該オブジェクトのコントラストが高くなるため、当該オブジェクトを構成する各画素の勾配強度M(x,y)(式(4)の演算結果)が高くなるからである。即ち、その結果として、それらの総和である勾配強度M(勾配ヒストグラムの縦軸の高さ)が高くなるからである。
ただし、スルー画像のうち動物等の被写体に合焦している場合、その被写体のエッジでは、同一角度となっている領域(画素群)は少ない。即ち、動物等の被写体のエッジについては、同一の勾配方向θを有する画素数は少なくなる。このため、動物等の被写体のエッジを構成する各画素の勾配強度M(x,y)(式(4)の演算結果)がある程度の高値を有していたとしても、全体の画素数が少ない以上、それらの総和である勾配強度M(勾配ヒストグラムの縦軸の高さ)はさほど高くならない。
一方で、スルー画像のうち手前のフェンスに合焦している場合、フェンスは、ほぼ全体が、略同一角度のエッジ(線)の集合体、通常は2種類の角度のエッジの集合体で構成されている。即ち、2種類の角度のうちの何れかを勾配方向θとして有する画素の数は非常に多くなる。このため、フェンスに合焦すると、当該フェンスを構成する各画素の勾配強度M(x,y)(式(4)の演算結果)がある程度の高値を有するようになり、かつ、全体の画素数が非常に多いため、2種類の角度の各々に対応する勾配方向θにおいて、それらの総和である勾配強度M(勾配ヒストグラムの縦軸の高さ)は非常に高くなる。
ここで、勾配ヒストグラムにおける複数の勾配ピークのうち、最高値の勾配強度M(縦軸の高さ)を有する勾配ピークを、以下、「第1の勾配ピーク」と呼び、2番目に高い勾配強度M(縦軸の高さ)を有する勾配ピークを、以下、「第2の勾配ピーク」と呼ぶ。この場合、第1の勾配ピークにおける勾配方向θと、第2の勾配ピークにおける勾配方向θとは、上述の内容により、フェンスを構成する各画素の勾配方向θであると判断することが可能である。
従って、撮像装置1は、第1及び第2の勾配ピークを判断することにより、スルー画像において、合焦しているフェンスF等の遮蔽物を識別することができる。
The gradient peak is a portion corresponding to the maximum point of the gradient intensity M in the predetermined gradient direction θ in the gradient histogram. That is, the portion where the gradient strength M is the highest in the gradient direction θ (the portion where the differential value changes from positive to negative when the gradient strength M is differentiated in the gradient direction θ direction) It is a peak.
The gradient direction θ that is the peak of the gradient is the actual angle of the edge of the focused object among the objects included in the through image (original image) (the real object corresponding to the object in the real world) The angle of the contour) is high. Since the contrast of the object becomes higher as the object is focused (focused), the gradient intensity M (x, y) (calculation result of Expression (4)) of each pixel constituting the object is higher. Because it becomes. That is, as a result, the gradient strength M (the height of the vertical axis of the gradient histogram), which is the sum of them, increases.
However, when the through image is focused on a subject such as an animal, there are few regions (pixel groups) having the same angle at the edge of the subject. That is, the number of pixels having the same gradient direction θ is reduced for the edge of a subject such as an animal. For this reason, even if the gradient strength M (x, y) (calculation result of Expression (4)) of each pixel constituting the edge of a subject such as an animal has a certain high value, the total number of pixels is small. As described above, the gradient intensity M (the height of the vertical axis of the gradient histogram) that is the sum of them is not so high.
On the other hand, when the through image is focused on the front fence, the fence is almost entirely composed of a collection of edges (lines) of substantially the same angle, usually a collection of edges of two angles. Has been. That is, the number of pixels having one of the two types of angles as the gradient direction θ is very large. For this reason, when focusing on the fence, the gradient strength M (x, y) of each pixel constituting the fence (the calculation result of Expression (4)) has a certain high value, and the total number of pixels Therefore, in the gradient direction θ corresponding to each of the two types of angles, the gradient intensity M (the height of the vertical axis of the gradient histogram) that is the sum of them is very high.
Here, among the plurality of gradient peaks in the gradient histogram, the gradient peak having the highest gradient intensity M (vertical height) is hereinafter referred to as a “first gradient peak” and is the second highest gradient intensity. Hereinafter, the gradient peak having M (the height of the vertical axis) is referred to as a “second gradient peak”. In this case, the gradient direction θ at the first gradient peak and the gradient direction θ at the second gradient peak can be determined to be the gradient direction θ of each pixel constituting the fence based on the above-described contents. is there.
Therefore, the imaging apparatus 1 can identify the focused object such as the fence F in focus in the through image by determining the first and second gradient peaks.

具体的には例えば、図6の勾配ヒストグラムは、フェンスFに合焦した状態の図3のスルー画像から作成された図4の輝度画像に基づいて作成されたものである。このフェンスの像は、図4に示すように、略40度のエッジと略130度のエッジとの集合体により構成されている。このため、図6の勾配ヒストグラムでは、勾配方向θが略40度と略130度とのそれぞれにおいて、勾配のピークが表れているのである。
即ち、勾配方向θが略40度における勾配ピークが、第1の勾配ピークである。また、勾配方向θが略130度における勾配ピークが、第2の勾配ピークである。
この場合、勾配ピーク選定部45は、勾配ヒストグラムから2第1の勾配ピーク及び第2の勾配ピークを選定する。
このようにして、勾配ピーク選定部45は、第1及び第2の勾配ピークを選定することで、スルー画像において規則的に配置される連子状の遮蔽物であるフェンスFを特定することができる。
Specifically, for example, the gradient histogram of FIG. 6 is created based on the luminance image of FIG. 4 created from the through image of FIG. As shown in FIG. 4, this fence image is composed of an aggregate of an edge of approximately 40 degrees and an edge of approximately 130 degrees. For this reason, in the gradient histogram of FIG. 6, the gradient peaks appear when the gradient direction θ is approximately 40 degrees and approximately 130 degrees, respectively.
That is, the gradient peak when the gradient direction θ is approximately 40 degrees is the first gradient peak. In addition, the gradient peak when the gradient direction θ is approximately 130 degrees is the second gradient peak.
In this case, the gradient peak selection unit 45 selects the second first gradient peak and the second gradient peak from the gradient histogram.
In this way, the gradient peak selection unit 45 can identify the fence F, which is a continuous shield arranged in the through image, by selecting the first and second gradient peaks. it can.

除外画素選定部46は、勾配ピーク選定部45により選定された勾配ピーク(本実施形態においては、第1の勾配ピーク及び第2の勾配ピーク)に対応する画素を選定する。
勾配ピークに対応する画素とは、勾配ピークとなっている勾配方向θ(上述の例では略40度と略130度)を有する画素をいい、スルー画像において規則的に配置される連子状の遮蔽物(上述の例ではフェンスF)の一部を示すと想定される画素である。詳細については後述するが、本実施形態では、このような画素が除外されてAF評価が行われる。そこで、以下、勾配ピークに対応する画素を、以下、「除外画素」と呼ぶ。
即ち、除外画素選定部46は、輝度画像を構成する各画素の中から、勾配ピークに対応する画素を除外画素として選定し、AF評価用画像生成部47に通知する。
The excluded pixel selection unit 46 selects pixels corresponding to the gradient peak selected by the gradient peak selection unit 45 (in this embodiment, the first gradient peak and the second gradient peak).
The pixel corresponding to the gradient peak is a pixel having the gradient direction θ (approximately 40 degrees and approximately 130 degrees in the above example) that is the gradient peak, and is a continuous-like arrangement of pixels in the through image. It is a pixel that is supposed to show a part of a shield (a fence F in the above example). Although details will be described later, in this embodiment, such pixels are excluded and AF evaluation is performed. Therefore, hereinafter, the pixel corresponding to the gradient peak is referred to as “excluded pixel”.
That is, the excluded pixel selecting unit 46 selects a pixel corresponding to the gradient peak as an excluded pixel from the pixels constituting the luminance image, and notifies the AF evaluation image generating unit 47 of the selected pixel.

AF評価用画像生成部47は、輝度画像生成部42により生成された輝度画像のデータから、周波数成分(直流成分を除く)を画素単位で抽出して、抽出値を各画素値とする画像のデータを生成する。
ここで、AF評価用画像生成部47により生成される画像のデータを構成する各画素値は、上述の如く、輝度画像のデータから抽出された周波数成分(直流成分を除く)であり、後述するAF評価値の算出においてAF検波値として用いられる。そこで、以下、このようにしてAF評価用画像生成部47により生成される画像のデータを、以下、「AF評価用画像のデータ」と呼ぶ。
ここで、AF評価用画像生成部47には、除外画素選定部46により選定された除外画素、即ち、図4のフェンスF等の遮蔽物の一部を示すと想定される除外画素が通知されている。そこで、AF評価用画像生成部47は、除外画素をマスクしたAF評価用画像のデータを生成する。除外画素をマスクするとは、AF評価用画像における除外画素の画素値を、AF検波値としてほぼ用いることができないようにすること、即ち、その画素値を0又は低値にすることを意味する。
The AF evaluation image generation unit 47 extracts the frequency component (excluding the DC component) from the luminance image data generated by the luminance image generation unit 42 in units of pixels, and uses the extracted values as the pixel values. Generate data.
Here, as described above, each pixel value constituting the image data generated by the AF evaluation image generation unit 47 is a frequency component (excluding a DC component) extracted from the luminance image data, which will be described later. It is used as an AF detection value in the calculation of the AF evaluation value. Therefore, hereinafter, the image data generated by the AF evaluation image generation unit 47 in this way is hereinafter referred to as “AF evaluation image data”.
Here, the AF evaluation image generation unit 47 is notified of the exclusion pixel selected by the exclusion pixel selection unit 46, that is, the exclusion pixel assumed to indicate a part of a shield such as the fence F in FIG. 4. ing. Therefore, the AF evaluation image generation unit 47 generates AF evaluation image data with the excluded pixels masked. Masking an excluded pixel means that the pixel value of the excluded pixel in the AF evaluation image cannot be used as an AF detection value, that is, the pixel value is set to 0 or a low value.

AF評価部48は、AF評価用画像生成部47により生成されたAF評価用画像のデータのうち、AF評価エリア内の各画素のデータ(AF検波値としての画素値)を積分することによって、AF評価値を求める。
この場合、AF評価エリア内の各画素の中に除外画素が存在する場合、除外画素のデータ(AF検波値としての画素値)は0又は低値であるので、積分結果としてのAF評価値には反映されない。即ち、除外画素はマスクされてAF評価値が求められるのと等価の処理が実行される。
The AF evaluation unit 48 integrates the data (pixel value as the AF detection value) of each pixel in the AF evaluation area among the data of the AF evaluation image generated by the AF evaluation image generation unit 47, An AF evaluation value is obtained.
In this case, if there is an excluded pixel in each pixel in the AF evaluation area, the data of the excluded pixel (pixel value as the AF detection value) is 0 or a low value, so the AF evaluation value as the integration result is Is not reflected. In other words, processing that is equivalent to obtaining the AF evaluation value by masking the excluded pixels is performed.

従って、撮像装置1のCPU11等は、上述したAF評価部48により生成されるAF評価値を用いることにより、除外画素をマスクしたAF位置決定処理を実行することができる。即ち、除外画素とは、図4のフェンスF等のような所定の方向で規則的に覆うような遮蔽物の一部を示す画素であるため、このような遮蔽物をマスクして、本来合焦させたい被写体のみに着目して、合焦位置を自動的に決定することができるようになる。例えば、図3のようなフェンスF越しに、フェンスFの奥の風景を撮影したい場合に、フェンスFの奥の樹木(被写体PO)に合焦位置を自動的に合わせることができるようになる。   Therefore, the CPU 11 or the like of the imaging apparatus 1 can execute the AF position determination process with the excluded pixels masked by using the AF evaluation value generated by the AF evaluation unit 48 described above. That is, an excluded pixel is a pixel that shows a part of a shield that is regularly covered in a predetermined direction, such as the fence F in FIG. Focusing only on the subject to be focused, the in-focus position can be automatically determined. For example, when it is desired to photograph a landscape behind the fence F through the fence F as shown in FIG. 3, the in-focus position can be automatically adjusted to a tree (subject PO) behind the fence F.

以上、図2乃至図6を参照して、本実施形態の撮像装置1の機能的構成について説明した。   The functional configuration of the imaging device 1 according to the present embodiment has been described above with reference to FIGS.

次に、このような機能的構成を有する撮像装置1が実行するAF機能に係る処理のうちAF評価処理の流れについて説明する。
図7は、図2の機能的構成を有する図1の撮像装置1が実行するAF評価処理の流れを説明する図である。
Next, the flow of the AF evaluation process among the processes related to the AF function executed by the imaging apparatus 1 having such a functional configuration will be described.
FIG. 7 is a diagram for explaining the flow of AF evaluation processing executed by the imaging apparatus 1 of FIG. 1 having the functional configuration of FIG.

AF評価処理は、本実施形態においては、例えば、ユーザが操作部18のリレーズ釦に対して半押しの操作をすることにより、スルー画像取得部41により、図3に示すようなフェンスF越しに風景が映し出されたスルー画像が取得されることを契機として開始される。その結果、レンズ駆動部33は、フォーカスレンズを所定の位置(初期位置)に移動させる。
なお、AF評価処理が終了し、その後、合焦位置が決定した後に、ユーザが操作部18のリレーズ釦に対して全押しの操作をすることで、決定された合焦位置での撮像が行われる。
In the present embodiment, the AF evaluation process is performed, for example, when the user performs a half-press operation on the relays button of the operation unit 18 so that the through image acquisition unit 41 passes over the fence F as illustrated in FIG. The process is started when a through image on which a landscape is projected is acquired. As a result, the lens driving unit 33 moves the focus lens to a predetermined position (initial position).
Note that after the AF evaluation process is completed and the in-focus position is determined, the user performs a full-press operation on the relays button of the operation unit 18 so that imaging at the determined in-focus position is performed. Is called.

ステップS1において、輝度画像生成部42は、輝度画像を生成する。詳細には、輝度画像生成部42は、スルー画像取得部41により取得されたスルー画像のデータから輝度成分を画素単位で抽出し、抽出された各輝度成分を画素値としてそれぞれ有する輝度画像のデータを生成する。本実施形態においては、輝度画像生成部42は、図3に示すようなスルー画像のデータから、図4に示すような輝度画像のデータを生成する。   In step S1, the luminance image generation unit 42 generates a luminance image. More specifically, the luminance image generation unit 42 extracts luminance components from the through image data acquired by the through image acquisition unit 41 in units of pixels, and luminance image data each having each extracted luminance component as a pixel value. Is generated. In the present embodiment, the luminance image generation unit 42 generates luminance image data as shown in FIG. 4 from the through image data as shown in FIG. 3.

ステップS2において、ノイズ除去部43は、ノイズを除去する。詳細には、輝度画像生成部42により生成された輝度画像のデータに対して、ノイズを除去するガウスフィルタの処理を施す。   In step S2, the noise removing unit 43 removes noise. More specifically, the luminance image data generated by the luminance image generation unit 42 is subjected to Gaussian filter processing for removing noise.

ステップS3において、勾配ヒストグラム作成部44は、勾配ヒストグラムを作成する。詳細には、輝度画像生成部42により生成された輝度画像のデータから、勾配ヒストグラムを作成する。本実施形態においては、勾配ヒストグラム作成部44は、ノイズ除去部43によりノイズが除去された輝度画像の各画素から上述した式(1)を演算し勾配方向θを算出し、上述した式(4)を演算して勾配強度Mを算出する。また、勾配ヒストグラム作成部44は、上述した式(5)によりノイズ除去を行う。最終的に、勾配ヒストグラム作成部44は、算出した各画素の勾配方向θ及び勾配強度Mに基づいて、図6に示すような勾配ヒストグラムを作成する。   In step S3, the gradient histogram creating unit 44 creates a gradient histogram. Specifically, a gradient histogram is created from the luminance image data generated by the luminance image generation unit 42. In the present embodiment, the gradient histogram creation unit 44 calculates the above-described equation (1) from each pixel of the luminance image from which noise has been removed by the noise removal unit 43 to calculate the gradient direction θ, and the above-described equation (4) ) To calculate the gradient strength M. Further, the gradient histogram creation unit 44 performs noise removal according to the above-described equation (5). Finally, the gradient histogram creating unit 44 creates a gradient histogram as shown in FIG. 6 based on the calculated gradient direction θ and gradient intensity M of each pixel.

ステップS4において、勾配ピーク選定部45は、勾配ピークを選定する。詳細には、勾配ピーク選定部45は、勾配ヒストグラム作成部44により作成された勾配ヒストグラムにおいて、勾配のピークを選定する。また、勾配ピーク選定部45は、勾配ヒストグラム作成部44で作成された勾配ヒストグラムにおいて、第1の勾配ピーク及び第2の勾配ピークを選定する。本実施形態においては、図6に示すように、勾配方向θが略40度を第1の勾配ピークとし、勾配方向θが略130度を第2の勾配ピークとして選定する。   In step S4, the gradient peak selection unit 45 selects a gradient peak. Specifically, the gradient peak selection unit 45 selects a gradient peak in the gradient histogram created by the gradient histogram creation unit 44. In addition, the gradient peak selection unit 45 selects the first gradient peak and the second gradient peak in the gradient histogram created by the gradient histogram creation unit 44. In the present embodiment, as shown in FIG. 6, the gradient direction θ is selected to be approximately 40 degrees as the first gradient peak, and the gradient direction θ is selected as approximately 130 degrees as the second gradient peak.

ステップS5において、除外画素選定部46は、除外画素を選定する。詳細には、除外画素選定部46は、勾配ピーク選定部45により選定された勾配ピーク(本実施形態においては、第1の勾配ピーク及び第2の勾配ピーク)に対応する画素を選定する。   In step S5, the excluded pixel selecting unit 46 selects an excluded pixel. Specifically, the excluded pixel selection unit 46 selects pixels corresponding to the gradient peaks selected by the gradient peak selection unit 45 (first gradient peak and second gradient peak in the present embodiment).

ステップS6において、AF評価用画像生成部47は、AF評価用画像を生成する。詳細には、AF評価用画像生成部47は、輝度画像生成部42により生成された輝度画像のデータから、周波数成分(直流成分を除く)を画素単位で抽出して、抽出値を各画素値とするAF評価用画像のデータを生成する。   In step S6, the AF evaluation image generation unit 47 generates an AF evaluation image. Specifically, the AF evaluation image generation unit 47 extracts a frequency component (excluding a DC component) from the luminance image data generated by the luminance image generation unit 42 in units of pixels, and extracts the extracted value for each pixel value. The image data for AF evaluation is generated.

ステップS7において、AF評価部48は、AF評価を行う。詳細には、AF評価用画像生成部47により生成されたAF評価用画像のデータのうち、AF評価エリア内の各画素のデータ(AF検波値としての画素値)を積分することによって、AF評価値を求める。   In step S7, the AF evaluation unit 48 performs AF evaluation. Specifically, by integrating the data of each pixel in the AF evaluation area (pixel value as the AF detection value) out of the AF evaluation image data generated by the AF evaluation image generation unit 47, the AF evaluation is performed. Find the value.

撮像装置1においては、ステップS1乃至S7の処理が実行されてAF評価処理が終了した場合、撮像装置1のCPU11等は、他の複数の合焦位置で再度、AF評価処理が行われる。その後、撮像装置1のCPU11等は、上述したAF評価部48により生成されるAF評価値を用いることにより、除外画素をマスクしたAF位置決定処理を実行して、合焦位置を自動的に合わせる。その後、ユーザが操作部18のリレーズ釦に対して全押しの操作をすることで、決定された合焦位置での撮像が行われる。   In the imaging apparatus 1, when the processing of steps S1 to S7 is executed and the AF evaluation process is completed, the CPU 11 of the imaging apparatus 1 performs the AF evaluation process again at other in-focus positions. Thereafter, the CPU 11 or the like of the imaging apparatus 1 uses the AF evaluation value generated by the AF evaluation unit 48 described above to execute the AF position determination process that masks the excluded pixels, and automatically adjusts the in-focus position. . Thereafter, when the user fully presses the relays button of the operation unit 18, imaging at the determined in-focus position is performed.

以上説明したように、本実施形態における撮像装置1は、撮像部17から出力された撮像画像のデータに基づいてスルー画像を取得するスルー画像取得部41と、画像の輝度の勾配に基づいて勾配方向が略一定のエッジを特定する除外画素選定部46と、除外画素選定部46によって特定されたエッジを含む領域を除外した画像領域からAF評価値を算出するAF評価部48と、を備える。   As described above, the imaging apparatus 1 according to the present embodiment includes the through image acquisition unit 41 that acquires a through image based on the captured image data output from the imaging unit 17, and the gradient based on the gradient of the luminance of the image. An excluded pixel selection unit 46 that specifies an edge having a substantially constant direction, and an AF evaluation unit 48 that calculates an AF evaluation value from an image region that excludes an area that includes the edge specified by the excluded pixel selection unit 46.

このような構成により、撮像装置1は、被写体の前後に例えばフェンス等の遮蔽物が存在しても、取得したスルー画像から、遮蔽物を特定して除去した画像に基づいてAF評価値を算出することができる。
従って、撮像装置1は、被写体の前後にフェンス等の遮蔽物が存在しても、算出されたAF評価値に基づいて着目する被写体に合焦させることができる。
With such a configuration, the imaging apparatus 1 calculates an AF evaluation value based on an image obtained by identifying and removing the shielding object from the acquired through image even if there is a shielding object such as a fence before and after the subject. can do.
Therefore, the imaging apparatus 1 can focus on the subject of interest based on the calculated AF evaluation value even if there is a shield such as a fence before and after the subject.

また、撮像装置1は、さらに、第1の勾配ピーク(勾配強度が最大値となる勾配角度)と、その勾配角度とは異なり、勾配強度が2番目に高い値となる勾配角度を有する第2のエッジを特定する勾配ピーク選定部45を備える。
これにより、撮像装置1はスルー画像内に、ある所定の勾配角度を有する領域、例えば、連子状のフェンス等が存在しても遮蔽物として選定することができる。その結果、撮像装置1は、例えば手前にフェンス等の遮蔽物が存在しても、着目する被写体に合焦させることができる。
In addition, the imaging apparatus 1 further includes a first gradient peak (gradient angle at which the gradient strength becomes the maximum value) and a second gradient angle at which the gradient strength is the second highest value, unlike the gradient angle. Is provided with a gradient peak selection unit 45 that identifies the edges of
As a result, the imaging apparatus 1 can be selected as a shielding object even if a region having a certain gradient angle, for example, a continuous fence is present in the through image. As a result, the imaging apparatus 1 can focus on the subject of interest even if there is a shield such as a fence in front of it.

また、勾配ピーク選定部45は、更に第2の勾配ピーク(第1の勾配ピーク以外で勾配強度が2番目に大きな値となる勾配角度)を有する領域を選定し、第1の勾配ピークを有する領域と、第2の勾配ピークを有する領域とを遮蔽物として選定する。
これにより、撮像装置1は、スルー画像内に、2つの所定の勾配角度を有する領域、例えば、格子状のフェンス等が存在しても遮蔽物として選定することができる。その結果、撮像装置1は、例えば手前にフェンス等の遮蔽物が存在しても、着目する被写体に合焦させることができる。
Further, the gradient peak selection unit 45 further selects a region having a second gradient peak (gradient angle other than the first gradient peak where the gradient intensity is the second largest value), and has the first gradient peak. The region and the region having the second gradient peak are selected as shielding objects.
Thereby, the imaging device 1 can be selected as a shielding object even if there are two regions having a predetermined gradient angle in the through image, for example, a lattice-like fence. As a result, the imaging apparatus 1 can focus on the subject of interest even if there is a shield such as a fence in front of it.

また、勾配ピーク選定部45は、勾配ヒストグラム作成部44によって算出された勾配ヒストグラムのうち、勾配強さが所定値以上の勾配ヒストグラムのみを考慮して遮蔽物を選定する。
従って、撮像装置1は、AF評価値を算出する際に、除外する遮蔽物の選定精度を高めることができる。
In addition, the gradient peak selection unit 45 selects a shield in consideration of only the gradient histogram having a gradient strength equal to or greater than a predetermined value among the gradient histograms calculated by the gradient histogram creation unit 44.
Therefore, the imaging apparatus 1 can improve the selection accuracy of the shielding object to be excluded when calculating the AF evaluation value.

また、撮像装置1は、除外画素選定部46によって特定された遮蔽物の領域をマスクしたAF評価用画像を生成するAF評価用画像生成部47を備え、AF評価部48は、AF評価用画像生成部47によって生成されたAF評価用画像からAF評価値を算出する。
これにより、撮像装置1は、手前にフェンス等の遮蔽物が存在しても、特別な合焦に係るデータ等を取得することなく、スルー画像を利用して、着目する被写体に合焦させることができる。
The imaging apparatus 1 further includes an AF evaluation image generation unit 47 that generates an AF evaluation image that masks the area of the shielding object specified by the excluded pixel selection unit 46, and the AF evaluation unit 48 includes an AF evaluation image. An AF evaluation value is calculated from the AF evaluation image generated by the generation unit 47.
As a result, the imaging apparatus 1 uses the through image to focus on the subject of interest without acquiring data or the like related to special focusing even if there is a shield such as a fence in front. Can do.

なお、本発明は、上述の実施形態や数式に限定されるものではなく、本発明の目的を達成できる範囲での変形、改良等は本発明に含まれるものである。
つまり、上述の実施形態では、勾配ヒストグラムを算出することにより、勾配ピークを算出し、勾配方向が一定のエッジを特定したが、これに限らず、例えばPrewittオペレータやRoberts crossなど、他の手法を用いて画像の輝度の勾配を見積もるようにしてもよい。つまり、勾配方向が一定のエッジを特定できる方法であればよい。
In addition, this invention is not limited to the above-mentioned embodiment and numerical formula, The deformation | transformation, improvement, etc. in the range which can achieve the objective of this invention are included in this invention.
That is, in the above-described embodiment, a gradient peak is calculated by calculating a gradient histogram, and an edge having a fixed gradient direction is specified. However, the present invention is not limited to this, and other methods such as a Prewitt operator and Roberts cross are used. It may be used to estimate the gradient of the luminance of the image. That is, any method that can identify an edge having a constant gradient direction may be used.

また、上述の実施形態では、図3に示すように、勾配方向θが一定(本実施形態においては、略40度のエッジと略130度のエッジ)の遮蔽物を特定するように構成したが、本発明はこれに限定されない。
例えば、図8に示すような、勾配方向が画像内の位置により変化する遮蔽物の画像に対して勾配ヒストグラムを作成した場合を想定する。形成される勾配ピークは2つ存在する。しかし、図8に示す画像では、フェンスの方向が緩やかに変化しているため、得られる勾配ヒストグラムの勾配ピークは、図3に示す画像から得られる勾配ヒストグラム(図6参照)の勾配ピークよりも幅が広くなる。
従って、図8に示すような、勾配方向が画像内の位置に応じて緩やかに変化する遮蔽物や、遠近等の画像への映り込みの状態等により画像内で勾配方向が緩やかに変化する遮蔽物を選定する場合には、例えば、勾配ピーク選定部45が選定する勾配方向θを有する画素を特定する範囲をθ±γ広げればよい。即ち、勾配ピーク選定部45が選定する勾配ヒストグラムのピークの幅を、想定される勾配方向の変化分、例えば、γだけ広げればよい。
Further, in the above-described embodiment, as shown in FIG. 3, the shielding direction having a constant gradient direction θ (in this embodiment, an edge of about 40 degrees and an edge of about 130 degrees) is specified. However, the present invention is not limited to this.
For example, a case is assumed in which a gradient histogram is created for an image of a shield whose gradient direction changes depending on the position in the image, as shown in FIG. There are two gradient peaks formed. However, in the image shown in FIG. 8, since the direction of the fence changes gently, the gradient peak of the gradient histogram obtained is more than the gradient peak of the gradient histogram obtained from the image shown in FIG. 3 (see FIG. 6). The width becomes wider.
Therefore, as shown in FIG. 8, a shield whose gradient direction changes gently according to the position in the image, or a shield whose gradient direction changes gently in the image due to the state of reflection in the image such as perspective. When selecting an object, for example, the range for specifying the pixels having the gradient direction θ selected by the gradient peak selection unit 45 may be expanded by θ ± γ. That is, the peak width of the gradient histogram selected by the gradient peak selection unit 45 may be widened by a change in the assumed gradient direction, for example, γ.

また、上述の実施形態では、輝度画像に平滑化処理を行うことによりノイズの除去を実行し、勾配ヒストグラム作成時にも所定の勾配強度を除去することによってノイズの除去を実行するものとして説明した。しかし、これらのノイズの除去は、遮蔽物を特定するための精度を高めるに過ぎず、本発明の目的を達成するために、必須の構成ではなく、種々の使用目的等により適宜採用することができる。   Further, in the above-described embodiment, it has been described that noise removal is performed by performing a smoothing process on a luminance image, and noise removal is performed by removing a predetermined gradient strength even when creating a gradient histogram. However, the removal of these noises only increases the accuracy for specifying the shielding object, and is not an essential configuration, but may be appropriately adopted depending on various purposes of use, etc. in order to achieve the object of the present invention. it can.

また、上述の実施形態では、画像内における遮蔽物の特定を、勾配方向θに撮像装置からの遠近の重み付けを加味して判断するとして説明したが、本発明はこれに限定されない。撮像装置からの遠近の重み付けは、フェンス越しの撮影を想定し、手前にある遮蔽物は外形のエッジ(コントラスト)が強くなる傾向が高く、AF評価値に反映されやすいことを考慮して、手前にある遮蔽物を積極的に排除するという思想に基づいている。このため、必ずしも必須の構成ではなく、種々の使用目的等により適宜採用することができる。   Further, in the above-described embodiment, the description has been made assuming that the identification of the shielding object in the image is determined by adding the perspective weight from the imaging device to the gradient direction θ, but the present invention is not limited to this. The weighting of perspective from the imaging device is assumed to be taken through the fence, and the obstacle in front has a high tendency for the edge (contrast) of the outline to be strong, and it is easily reflected in the AF evaluation value. This is based on the idea of positively removing the shields. For this reason, it is not necessarily an indispensable structure, and can be adopted as appropriate depending on various purposes.

また、上述の実施形態では、本発明が適用される電子装置は、デジタルカメラ等の撮像装置1を例として説明したが、特にこれに限定されない。本発明は、上述のAF評価処理を実行可能な電子機器一般に適用することができる。具体的には、例えば、本発明は、ノート型のパーソナルコンピュータ、ビデオカメラ、携帯型ナビゲーション装置、携帯電話装置、ポータブルゲーム機、WEBカメラ等に適用可能である。   In the above-described embodiment, the electronic apparatus to which the present invention is applied has been described by taking the imaging apparatus 1 such as a digital camera as an example, but is not particularly limited thereto. The present invention can be applied to general electronic devices capable of executing the above-described AF evaluation processing. Specifically, for example, the present invention is applicable to a notebook personal computer, a video camera, a portable navigation device, a mobile phone device, a portable game machine, a WEB camera, and the like.

上述した一連の処理は、ハードウェアにより実行させることもできるし、ソフトウェアにより実行させることもできる。また例えば、上述した一連の処理は、ハードウェアにより実行させることもできるし、ソフトウェアにより実行させることもできる。換言すると、図2の機能的構成は例示に過ぎず、特に限定されない。即ち、上述した一連の処理を全体として実行できる機能が撮像装置1に備えられていれば足り、この機能を実現するためにどのような機能ブロックを用いるのかは特に図2の例に限定されない。また、1つの機能ブロックは、ハードウェア単体で構成してもよいし、ソフトウェア単体で構成してもよいし、それらの組み合わせで構成してもよい。   The series of processes described above can be executed by hardware or can be executed by software. For example, the series of processes described above can be executed by hardware or can be executed by software. In other words, the functional configuration of FIG. 2 is merely an example and is not particularly limited. That is, it is sufficient that the imaging apparatus 1 has a function capable of executing the above-described series of processing as a whole, and what functional blocks are used to realize this function is not particularly limited to the example of FIG. In addition, one functional block may be constituted by hardware alone, software alone, or a combination thereof.

一連の処理をソフトウェアにより実行させる場合には、そのソフトウェアを構成するプログラムが、コンピュータ等にネットワークや記録媒体からインストールされる。コンピュータは、専用のハードウェアに組み込まれているコンピュータであってもよい。また、コンピュータは、各種のプログラムをインストールすることで、各種の機能を実行することが可能なコンピュータ、例えば汎用のパーソナルコンピュータであってもよい。   When a series of processing is executed by software, a program constituting the software is installed on a computer or the like from a network or a recording medium. The computer may be a computer incorporated in dedicated hardware. The computer may be a computer capable of executing various functions by installing various programs, for example, a general-purpose personal computer.

このようなプログラムを含む記録媒体は、ユーザにプログラムを提供するために装置本体とは別に配布される図1のリムーバブルメディア23により構成されるだけでなく、装置本体に予め組み込まれた状態でユーザに提供される記録媒体等で構成される。外部メモリ26は、例えば、磁気ディスク(フロッピディスクを含む)、光ディスク、又は光磁気ディスク等により構成される。光ディスクは、例えば、CD−ROM(Compact Disk−Read Only Memory),DVD(Digital Versatile Disk)等により構成される。光磁気ディスクは、MD(Mini−Disk)等により構成される。また、装置本体に予め組み込まれた状態でユーザに提供される記録媒体は、例えば、プログラムが記録されている図1のROM12や、図1の記憶部20に含まれるハードディスク等で構成される。   The recording medium including such a program is not only configured by the removable medium 23 of FIG. 1 distributed separately from the apparatus main body in order to provide the program to the user, but also in a state of being incorporated in the apparatus main body in advance. The recording medium etc. provided in The external memory 26 is configured by, for example, a magnetic disk (including a floppy disk), an optical disk, a magneto-optical disk, or the like. The optical disk is composed of, for example, a CD-ROM (Compact Disk-Read Only Memory), a DVD (Digital Versatile Disk), or the like. The magneto-optical disk is configured by an MD (Mini-Disk) or the like. In addition, the recording medium provided to the user in a state of being preliminarily incorporated in the apparatus main body includes, for example, the ROM 12 in FIG. 1 in which a program is recorded, the hard disk included in the storage unit 20 in FIG.

なお、本明細書において、記録媒体に記録されるプログラムを記述するステップは、その順序に沿って時系列的に行われる処理はもちろん、必ずしも時系列的に処理されなくとも、並列的或いは個別に実行される処理をも含むものである。
また、本明細書において、システムの用語は、複数の装置や複数の手段などより構成される全体的な装置を意味するものとする。
In the present specification, the step of describing the program recorded on the recording medium is not limited to the processing performed in time series along the order, but is not necessarily performed in time series, either in parallel or individually. The process to be executed is also included.
Further, in the present specification, the term “system” means an overall device configured by a plurality of devices, a plurality of means, and the like.

以上、本発明のいくつかの実施形態について説明したが、これらの実施形態は、例示に過ぎず、本発明の技術的範囲を限定するものではない。本発明はその他の様々な実施形態を取ることが可能であり、更に、本発明の要旨を逸脱しない範囲で、省略や置換等種々の変更を行うことができる。これら実施形態やその変形は、本明細書等に記載された発明の範囲や要旨に含まれると共に、特許請求の範囲に記載された発明とその均等の範囲に含まれる。   As mentioned above, although several embodiment of this invention was described, these embodiment is only an illustration and does not limit the technical scope of this invention. The present invention can take other various embodiments, and various modifications such as omission and replacement can be made without departing from the gist of the present invention. These embodiments and modifications thereof are included in the scope and gist of the invention described in this specification and the like, and are included in the invention described in the claims and the equivalents thereof.

以下に、本願の出願当初の特許請求の範囲に記載された発明を付記する。
[付記1]
画像を取得する取得手段と、
前記画像の輝度の勾配に基づいて勾配方向が略一定のエッジを特定する特定手段と、
前記特定手段によって特定されたエッジを含む領域を除外した画像領域からAF評価値を算出するAF評価値算出手段と、
を備えたことを特徴とする画像処理装置。
[付記2]
前記特定手段は、前記勾配強度が最大値となる勾配角度を有する第1のエッジと、その勾配角度とは異なり、前記勾配強度が2番目に高い値となる勾配角度を有する第2のエッジを特定し、
前記AF評価値算出手段は、前記第1のエッジ及び前記2のエッジを含む領域を除外した画像領域からAF評価値を算出することを特徴とする付記1に記載の画像処理装置。
[付記3]
前記画像の輝度の勾配に基づいて、勾配強度についての勾配方向の分布を表す勾配ヒストグラムを算出するヒストグラム算出手段を更に備え、
前記特定手段は、前記ヒストグラム算出手段によって算出した勾配ヒストグラムに基づき、勾配方向が略一定のエッジを特定することを特徴とする付記1又は2に記載の画像処理装置。
[付記4]
前記特定手段は、前記ヒストグラム算出手段によって算出された勾配ヒストグラムのうち、勾配強度が所定値以上の勾配ヒストグラムのみを考慮して前記勾配方向が略一定のエッジを特定することを特徴とする付記3に記載の画像処理装置。
[付記5]
前記AF評価値算出手段は、前記取得手段によって取得した画像から前記特定手段によって特定されたエッジを含む領域をマスクしたマスク画像を生成する生成手段を含み、
前記AF評価値算出手段は、前記生成手段によって生成されたマスク画像からAF評価値を算出することを特徴とする付記1から4のいずれか1項に記載の画像処理装置。
[付記6]
画像を入力する入力ステップと、
この入力された画像の輝度の勾配に基づいて勾配方向が略一定のエッジを特定する特定ステップと、
この特定されたエッジを含む領域を除外した画像領域からAF評価値を算出するAF評価値算出ステップと、
を備えたことを特徴とする画像処理方法。
[付記7]
処理を制御するコンピュータに、
画像を入力する入力機能と、
前記画像の輝度の勾配に基づいて勾配方向が略一定のエッジを特定する特定機能と、
前記特定機能の発揮によって特定されたエッジを含む領域を除外した画像領域からAF評価値を算出するAF評価値算出機能と、
を実現させるためのプログラム。
The invention described in the scope of claims at the beginning of the filing of the present application will be appended.
[Appendix 1]
An acquisition means for acquiring an image;
A specifying means for specifying an edge having a substantially constant gradient direction based on a luminance gradient of the image;
AF evaluation value calculating means for calculating an AF evaluation value from an image area excluding an area including an edge specified by the specifying means;
An image processing apparatus comprising:
[Appendix 2]
The specifying means includes a first edge having a gradient angle at which the gradient strength becomes a maximum value, and a second edge having a gradient angle at which the gradient strength has a second highest value, unlike the gradient angle. Identify,
The image processing apparatus according to appendix 1, wherein the AF evaluation value calculation means calculates an AF evaluation value from an image area excluding an area including the first edge and the second edge.
[Appendix 3]
A histogram calculating means for calculating a gradient histogram representing a gradient direction distribution of the gradient intensity based on the luminance gradient of the image;
The image processing apparatus according to appendix 1 or 2, wherein the specifying unit specifies an edge having a substantially constant gradient direction based on the gradient histogram calculated by the histogram calculation unit.
[Appendix 4]
The specifying unit specifies an edge having a substantially constant gradient direction in consideration of only a gradient histogram having a gradient strength equal to or greater than a predetermined value among gradient histograms calculated by the histogram calculation unit. An image processing apparatus according to 1.
[Appendix 5]
The AF evaluation value calculating means includes a generating means for generating a mask image in which an area including an edge specified by the specifying means is masked from an image acquired by the acquiring means,
The image processing apparatus according to any one of appendices 1 to 4, wherein the AF evaluation value calculation unit calculates an AF evaluation value from the mask image generated by the generation unit.
[Appendix 6]
An input step for inputting an image;
A specifying step of specifying an edge having a substantially constant gradient direction based on the gradient of brightness of the input image;
An AF evaluation value calculating step for calculating an AF evaluation value from the image area excluding the area including the specified edge;
An image processing method comprising:
[Appendix 7]
To the computer that controls the process,
An input function for inputting images,
A specific function for identifying an edge having a substantially constant gradient direction based on a gradient of brightness of the image;
An AF evaluation value calculation function for calculating an AF evaluation value from an image area excluding an area including an edge specified by performing the specific function;
A program to realize

1・・・撮像装置、11・・・CPU、12・・・ROM、13・・・RAM、14・・・画像処理部、15・・・バス、16・・・入出力インターフェース、17・・・撮像部、18・・・操作部、19・・・表示部、20・・・記憶部、21・・・通信部、22・・・ドライブ、23・・・リムーバブルメディア、41・・・スルー画像取得部、42・・・輝度画像生成部42・・・ノイズ除去部、44・・・勾配ヒストグラム作成部、45・・・勾配ピーク選定部、46・・・除外画素選定部、47・・・AF評価用画像生成部、48・・・AF評価部   DESCRIPTION OF SYMBOLS 1 ... Imaging device, 11 ... CPU, 12 ... ROM, 13 ... RAM, 14 ... Image processing part, 15 ... Bus, 16 ... Input / output interface, 17 ... Image pick-up unit, 18 ... operation unit, 19 ... display unit, 20 ... storage unit, 21 ... communication unit, 22 ... drive, 23 ... removable media, 41 ... through Image acquisition unit 42 ... Luminance image generation unit 42 ... Noise removal unit 44 ... Gradient histogram creation unit 45 ... Gradient peak selection unit 46 ... Excluded pixel selection unit 47 ... AF evaluation image generation unit, 48... AF evaluation unit

Claims (7)

画像を取得する取得手段と、
前記画像の輝度の勾配に基づいて、当該画像に含まれる勾配方向が略一定の全てのエッジを特定する特定手段と、
前記特定手段によって特定された勾配方向が略一定の全てのエッジを含む領域を除外した画像領域からAF評価値を算出するAF評価値算出手段と、
を備えたことを特徴とする画像処理装置。
An acquisition means for acquiring an image;
A specifying means for specifying all edges having a substantially constant gradient direction included in the image based on the luminance gradient of the image;
AF evaluation value calculating means for calculating an AF evaluation value from an image area excluding an area including all edges whose gradient direction specified by the specifying means is substantially constant ;
An image processing apparatus comprising:
前記特定手段は、勾配強度が最大値となる勾配角度を有する全ての第1のエッジと、その勾配角度とは異なり、勾配強度が2番目に高い値となる勾配角度を有する全ての第2のエッジを特定し、
前記AF評価値算出手段は、前記全ての第1のエッジ及び前記全ての第2のエッジを含む領域を除外した画像領域からAF評価値を算出することを特徴とする請求項1に記載の画像処理装置。
The specifying means includes all first edges having a gradient angle at which the gradient strength is a maximum value, and all second edges having a gradient angle at which the gradient strength is the second highest value, unlike the gradient angle. Identify the edges,
2. The image according to claim 1, wherein the AF evaluation value calculation unit calculates an AF evaluation value from an image area excluding an area including all of the first edges and all of the second edges. Processing equipment.
前記画像の輝度の勾配に基づいて、勾配強度についての勾配方向の分布を表す勾配ヒストグラムを算出するヒストグラム算出手段を更に備え、
前記特定手段は、前記ヒストグラム算出手段によって算出した勾配ヒストグラムに基づき、勾配方向が略一定の全てのエッジを特定することを特徴とする請求項1又は2に記載の画像処理装置。
A histogram calculating means for calculating a gradient histogram representing a gradient direction distribution of the gradient intensity based on the luminance gradient of the image;
The image processing apparatus according to claim 1, wherein the specifying unit specifies all edges having a substantially constant gradient direction based on the gradient histogram calculated by the histogram calculation unit.
前記特定手段は、前記ヒストグラム算出手段によって算出された勾配ヒストグラムのうち、勾配強度が所定値以上の勾配ヒストグラムのみを考慮して前記勾配方向が略一定の全てのエッジを特定することを特徴とする請求項3に記載の画像処理装置。   The specifying unit specifies all edges having a substantially constant gradient direction in consideration of only a gradient histogram having a gradient strength equal to or greater than a predetermined value among the gradient histograms calculated by the histogram calculation unit. The image processing apparatus according to claim 3. 前記AF評価値算出手段は、前記取得手段によって取得した画像から前記特定手段によって特定された勾配方向が略一定の全てのエッジを含む領域をマスクしたマスク画像を生成する生成手段を含み、
前記AF評価値算出手段は、前記生成手段によって生成されたマスク画像からAF評価値を算出することを特徴とする請求項1から4のいずれか1項に記載の画像処理装置。
The AF evaluation value calculating means includes a generating means for generating a mask image that masks an area including all edges whose gradient directions specified by the specifying means are substantially constant from the image acquired by the acquiring means,
The image processing apparatus according to claim 1, wherein the AF evaluation value calculation unit calculates an AF evaluation value from the mask image generated by the generation unit.
画像を入力する入力ステップと、
この入力された画像の輝度の勾配に基づいて、当該画像に含まれる勾配方向が略一定の全てのエッジを特定する特定ステップと、
この特定された勾配方向が略一定の全てのエッジを含む領域を除外した画像領域からAF評価値を算出するAF評価値算出ステップと、
を備えたことを特徴とする画像処理方法。
An input step for inputting an image;
Based on the brightness gradient of the input image, a specifying step for specifying all edges having a substantially constant gradient direction included in the image;
An AF evaluation value calculating step for calculating an AF evaluation value from an image area excluding an area including all the edges in which the specified gradient direction is substantially constant ;
An image processing method comprising:
処理を制御するコンピュータに、
画像を入力する入力機能と、
前記画像の輝度の勾配に基づいて、当該画像に含まれる勾配方向が略一定の全てのエッジを特定する特定機能と、
前記特定機能の発揮によって特定された勾配方向が略一定の全てのエッジを含む領域を除外した画像領域からAF評価値を算出するAF評価値算出機能と、
を実現させるためのプログラム。
To the computer that controls the process,
An input function for inputting images,
Based on the brightness gradient of the image, a specifying function for specifying all edges having a substantially constant gradient direction included in the image;
An AF evaluation value calculation function for calculating an AF evaluation value from an image area excluding an area including all edges whose gradient direction specified by the specific function is substantially constant ;
A program to realize
JP2011011907A 2011-01-24 2011-01-24 Image processing apparatus, image processing method, and program Expired - Fee Related JP5853369B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011011907A JP5853369B2 (en) 2011-01-24 2011-01-24 Image processing apparatus, image processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011011907A JP5853369B2 (en) 2011-01-24 2011-01-24 Image processing apparatus, image processing method, and program

Publications (2)

Publication Number Publication Date
JP2012155000A JP2012155000A (en) 2012-08-16
JP5853369B2 true JP5853369B2 (en) 2016-02-09

Family

ID=46836815

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011011907A Expired - Fee Related JP5853369B2 (en) 2011-01-24 2011-01-24 Image processing apparatus, image processing method, and program

Country Status (1)

Country Link
JP (1) JP5853369B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116156157B (en) * 2023-04-24 2023-08-18 长沙海信智能系统研究院有限公司 Camera shielding abnormality detection method and electronic equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004048445A (en) * 2002-07-12 2004-02-12 Fuji Photo Film Co Ltd Method and apparatus for compositing image
JP4515208B2 (en) * 2003-09-25 2010-07-28 富士フイルム株式会社 Image processing method, apparatus, and program
JP4591120B2 (en) * 2005-03-07 2010-12-01 カシオ計算機株式会社 Imaging apparatus, autofocus control method, and autofocus control program
JP4924041B2 (en) * 2007-01-09 2012-04-25 トヨタ自動車株式会社 Image processing device
JP2010026804A (en) * 2008-07-18 2010-02-04 Olympus Corp Image processing device, image processing program and image processing method

Also Published As

Publication number Publication date
JP2012155000A (en) 2012-08-16

Similar Documents

Publication Publication Date Title
JP6271990B2 (en) Image processing apparatus and image processing method
US9251589B2 (en) Depth measurement apparatus, image pickup apparatus, and depth measurement program
US9607240B2 (en) Image processing apparatus, image capturing apparatus, image processing method, image capturing method, and non-transitory computer-readable medium for focus bracketing
JP5397481B2 (en) Image sorting apparatus and image sorting method
US10115178B2 (en) Image processing apparatus, image capturing apparatus, image processing method, and storage medium
JP5374119B2 (en) Distance information acquisition device, imaging device, and program
JP2007199633A (en) Focusing detector
JP2013042371A (en) Image pickup device and distance information acquisition method
JP6317635B2 (en) Image processing apparatus, image processing method, and image processing program
JP2010279054A (en) Image pickup device, image processing device, image pickup method, and image processing method
US10880457B2 (en) Image processing apparatus, image capturing apparatus, image processing method, and storage medium
JP5369729B2 (en) Image processing apparatus, imaging apparatus, and program
JP5853369B2 (en) Image processing apparatus, image processing method, and program
JP2016156950A (en) Automatic focus adjustment device and control method of the same
JP6486453B2 (en) Image processing apparatus, image processing method, and program
JP6556033B2 (en) Image processing apparatus, image processing method, and program
JP5213493B2 (en) Motion detection device
JP2019191724A (en) Image processing apparatus, image processing method, and program
JP2018152095A (en) Image processing apparatus, imaging apparatus, and image processing program
JP6248662B2 (en) Image processing apparatus, imaging apparatus, and image processing program
JP5631181B2 (en) Image processing apparatus, control method therefor, and program
JP6326841B2 (en) Image processing apparatus, imaging apparatus, and image processing program
JP6314281B1 (en) Image processing method and foreground region acquisition method
US20230274398A1 (en) Image processing apparatus for reducing influence of fine particle in an image, control method of same, and non-transitory computer-readable storage medium
JP2012018466A (en) Image processing device and image processing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140122

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20141121

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20141209

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20141224

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20150602

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150618

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20150803

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20151110

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20151123

R150 Certificate of patent or registration of utility model

Ref document number: 5853369

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees