JP6012230B2 - Edge direction determination device, control method of edge direction determination device, and image processing device - Google Patents

Edge direction determination device, control method of edge direction determination device, and image processing device Download PDF

Info

Publication number
JP6012230B2
JP6012230B2 JP2012087468A JP2012087468A JP6012230B2 JP 6012230 B2 JP6012230 B2 JP 6012230B2 JP 2012087468 A JP2012087468 A JP 2012087468A JP 2012087468 A JP2012087468 A JP 2012087468A JP 6012230 B2 JP6012230 B2 JP 6012230B2
Authority
JP
Japan
Prior art keywords
block
pixel
value
blocks
size
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
JP2012087468A
Other languages
Japanese (ja)
Other versions
JP2013219490A5 (en
JP2013219490A (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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2012087468A priority Critical patent/JP6012230B2/en
Publication of JP2013219490A publication Critical patent/JP2013219490A/en
Publication of JP2013219490A5 publication Critical patent/JP2013219490A5/ja
Application granted granted Critical
Publication of JP6012230B2 publication Critical patent/JP6012230B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、エッジ方向判定装置、エッジ方向判定装置の制御方法、及び、画像処理装置に関する。   The present invention relates to an edge direction determination device, a control method for an edge direction determination device, and an image processing device.

インターレース画像信号を補間によりプログレッシブ画像信号に変換する方法として、動き適応型IP(インターレース−プログレッシブ)変換と呼ばれる方法がある。これは、補間画素の生成位置での画像の動き(動き情報)を検出し、その動き情報に応じて、補間画素としてフィールド内補間画素を生成するか、フィールド間補間画素を生成するかを適応的に切り換える方法である。   As a method for converting an interlaced image signal into a progressive image signal by interpolation, there is a method called motion adaptive IP (interlace-progressive) conversion. This detects image motion (motion information) at the interpolation pixel generation position, and adapts whether to generate intra-field interpolation pixels or inter-field interpolation pixels according to the motion information. It is a method of switching automatically.

動き適応型IP変換では、「動きあり」と判定された位置に対して、同一フィールド内において該位置の垂直方向に隣接する画素を用いて補間画素が生成される。そのため、斜め方向のエッジ部分(斜めエッジ部分)では、ジャギーと呼ばれるギザギザが発生することとなり、画像品位(画質)が著しく劣化してしまう。   In the motion-adaptive IP conversion, an interpolation pixel is generated using a pixel adjacent to the position in the same field in the same field for a position determined to be “with motion”. Therefore, a jagged edge is generated at an oblique edge portion (an oblique edge portion), and the image quality (image quality) is significantly deteriorated.

ジャギーの発生を抑制する技術として、入力されたインターレース画像信号の画素情報からエッジの方向を判定し、エッジの方向に応じた画素を用いて補間画素を生成する方法が提案されている。
そのような方法は、例えば、特許文献1に開示されている。
具体的には、特許文献1には、予め決められた斜め方向のリファレンスパターンと入力画像信号とのパターンマッチングにより、エッジの方向を判定することが開示されている。また、リファレンスパターンのサイズ(ブロックサイズ)を大きくすることで、より角度の浅いエッジの方向が判定可能となることが開示されている。
As a technique for suppressing the occurrence of jaggy, a method has been proposed in which the direction of an edge is determined from pixel information of an input interlaced image signal, and an interpolation pixel is generated using a pixel corresponding to the direction of the edge.
Such a method is disclosed in Patent Document 1, for example.
Specifically, Patent Document 1 discloses determining the edge direction by pattern matching between a predetermined oblique reference pattern and an input image signal. It is also disclosed that the direction of an edge having a shallower angle can be determined by increasing the size (block size) of the reference pattern.

特開2008−182725号公報JP 2008-182725 A

しかしながら、上述した従来の技術では、エッジの方向を精度良く判定することができず、エッジの方向の誤判定が発生してしまうことがある。例えば、ブロックサイズが大きい場合には、角度が深い斜めエッジ部分において、斜めエッジ部分以外の画像がパターンマッチングに大きな影響を与えてしまうことがある。そのため、大きなブロックサイズでのパターンマッチングによりエッジの方向を判定する構成では、角度の深いエッジの方向を精度良く判定することができない。また逆に、小さなブロックサイズでのパターンマッチングによりエッジの方向を判定する構成では、角度の浅いエッジの方向を精度良く判定することができない。エッジの方向の誤判定があると、エッジの方向の判定結果に基づく画像処理を行った際に、画質が劣化してしまう。例えば、上述したジャギー等の視覚的な妨害のある画像が生成されてしまう。   However, in the conventional technique described above, the edge direction cannot be accurately determined, and an erroneous determination of the edge direction may occur. For example, when the block size is large, an image other than the oblique edge portion may greatly affect pattern matching in the oblique edge portion having a deep angle. Therefore, in the configuration in which the edge direction is determined by pattern matching with a large block size, the edge direction having a deep angle cannot be accurately determined. Conversely, in the configuration in which the edge direction is determined by pattern matching with a small block size, the direction of the edge having a shallow angle cannot be accurately determined. If there is an erroneous determination of the edge direction, the image quality deteriorates when image processing based on the determination result of the edge direction is performed. For example, an image having visual disturbance such as the above-described jaggy is generated.

本発明は、エッジの方向を精度良く判定することのできる技術を提供することを目的とする。   An object of the present invention is to provide a technique capable of accurately determining the direction of an edge.

本発明の第の態様は、
画像の注目点におけるエッジの方向を判定するエッジ方向判定装置であって、
エッジの方向の候補である複数の方向のそれぞれについて、注目点を通るその方向の直線上に、同じサイズの領域であるn個(nは2以上の整数)のブロックを設定する設定手段と、
前記複数の方向のそれぞれについて、前記設定手段で設定されたn個のブロック間の画像の類似度を算出し、類似度が最も高い方向を、前記注目点におけるエッジの方向として判定する判定手段と、
を有し、
前記設定手段は、エッジの方向の候補である前記方向毎に、
その方向に対して設定するn個のブロックのうちの少なくとも1つのブロックについて、そのブロックの設定位置である前記直線上の位置における、所定方向の位置の変化に対する画素値の変化の勾配を算出し、
勾配が大きいときよりも、勾配が小さいときのほうが、前記所定方向の長さが長くなるように、前記設定するn個のブロックのサイズを制御する
ことを特徴とする。
The first aspect of the present invention is:
An edge direction determination device that determines the direction of an edge at a point of interest in an image,
For each of a plurality of directions that are edge direction candidates, setting means for setting n (n is an integer of 2 or more) blocks of the same size on a straight line in that direction passing through the point of interest;
Determination means for calculating the image similarity between the n blocks set by the setting means for each of the plurality of directions and determining the direction having the highest similarity as the edge direction at the point of interest; ,
Have
For each of the directions that are candidates for edge directions, the setting means
For at least one of the n blocks set for that direction, the gradient of the change in pixel value with respect to the change in the position in the predetermined direction at the position on the straight line, which is the set position of that block, is calculated. ,
The size of the n blocks to be set is controlled so that the length in the predetermined direction becomes longer when the gradient is small than when the gradient is large .

本発明の第の態様は、
インターレース画像信号を補間によりプログレッシブ画像信号に変換する画像処理装置であって、
上記エッジ方向判定装置と、
前記エッジ方向判定装置で判定されたエッジの方向に基づいて、フィールド内補間による補間画素を生成する補間画素生成手段と、
を有することを特徴とする。
The second aspect of the present invention is:
An image processing apparatus that converts an interlaced image signal into a progressive image signal by interpolation,
The edge direction determination device;
Interpolation pixel generation means for generating an interpolation pixel by intra-field interpolation based on the edge direction determined by the edge direction determination device;
It is characterized by having.

本発明の第の態様は、
画像の注目点におけるエッジの方向を判定するエッジ方向判定装置の制御方法であって、
エッジの方向の候補である複数の方向のそれぞれについて、注目点を通るその方向の直線上に、同じサイズの領域であるn個(nは2以上の整数)のブロックを設定する設定ステップと、
前記複数の方向のそれぞれについて、前記設定ステップで設定されたn個のブロック間の画像の類似度を算出し、類似度が最も高い方向を、前記注目点におけるエッジの方向として判定する判定ステップと、
を有し、
前記設定ステップでは、エッジの方向の候補である前記方向毎に、
その方向に対して設定するn個のブロックのうちの少なくとも1つのブロックについて、そのブロックの設定位置である前記直線上の位置における、所定方向の位置の変化に対する画素値の変化の勾配が算出され、
勾配が大きいときよりも、勾配が小さいときのほうが、前記所定方向の長さが長くなるように、前記設定するn個のブロックのサイズが制御される
ことを特徴とする。
The third aspect of the present invention is:
A control method of an edge direction determination device that determines the direction of an edge at a point of interest in an image,
A setting step of setting n (n is an integer of 2 or more) blocks of the same size on a straight line passing through the point of interest for each of a plurality of directions that are edge direction candidates;
A determination step of calculating an image similarity between the n blocks set in the setting step for each of the plurality of directions, and determining a direction having the highest similarity as an edge direction at the point of interest; ,
Have
In the setting step, for each direction that is a candidate for an edge direction,
For at least one of the n blocks set for that direction, the gradient of the change in pixel value with respect to the change in position in the predetermined direction at the position on the straight line, which is the set position of that block, is calculated. ,
The size of the n blocks to be set is controlled so that the length in the predetermined direction becomes longer when the gradient is small than when the gradient is large .

本発明によれば、エッジの方向を精度良く判定することができる。   According to the present invention, the edge direction can be determined with high accuracy.

実施例1に係る画像処理装置の構成の一例を示す図1 is a diagram illustrating an example of a configuration of an image processing apparatus according to a first embodiment. 実施例1に係るフィールド内補間画素生成部の構成の一例を示す図The figure which shows an example of a structure of the interpolation pixel production | generation part in a field which concerns on Example 1. FIG. 実施例1に係る角度情報に応じた画素の選択方法の一例を示す図FIG. 6 is a diagram illustrating an example of a pixel selection method according to angle information according to the first embodiment. 実施例1に係る斜め検出部の構成の一例を示す図The figure which shows an example of a structure of the diagonal detection part which concerns on Example 1. FIG. 実施例1に係る斜め検出部の処理の流れの一例を示すフローチャート7 is a flowchart illustrating an example of a process flow of the oblique detection unit according to the first embodiment. 実施例1に係るブロックの中心位置の一例を示す図The figure which shows an example of the center position of the block which concerns on Example 1. FIG. 実施例1に係る角度とブロックサイズの対応関係の一例を示す図The figure which shows an example of the correspondence of the angle which concerns on Example 1, and block size 実施例1に係るブロックマッチング部の処理の一例を示す図The figure which shows an example of the process of the block matching part which concerns on Example 1. FIG. 実施例1に係るブロックマッチング部の処理の一例を示す図The figure which shows an example of the process of the block matching part which concerns on Example 1. FIG. 実施例1に係る角度とブロックサイズの対応関係の一例を示す図The figure which shows an example of the correspondence of the angle which concerns on Example 1, and block size 実施例1に係るSAD値算出の具体例を示す図The figure which shows the specific example of SAD value calculation which concerns on Example 1. FIG. 実施例2に係る斜め検出部の構成の一例を示す図The figure which shows an example of a structure of the diagonal detection part which concerns on Example 2. FIG. 実施例2に係る斜め検出部の処理の流れの一例を示すフローチャート10 is a flowchart illustrating an example of a processing flow of an oblique detection unit according to the second embodiment. 実施例2に係るブロックの中心位置の一例を示す図The figure which shows an example of the center position of the block which concerns on Example 2. FIG. 実施例2に係るSAD値算出の具体例を示す図The figure which shows the specific example of SAD value calculation which concerns on Example 2. FIG. 実施例3に係る斜め検出部の構成の一例を示す図The figure which shows an example of a structure of the diagonal detection part which concerns on Example 3. FIG. 実施例3に係る勾配算出部の動作の具体例を示す図The figure which shows the specific example of operation | movement of the gradient calculation part which concerns on Example 3. FIG. 実施例3に係るブロックサイズ補正部の動作の一例を示すフローチャート10 is a flowchart illustrating an example of the operation of the block size correction unit according to the third embodiment. 実施例4に係るブロックマッチングの様子の一例を示す図The figure which shows an example of the mode of the block matching which concerns on Example 4.

<実施例1>
以下、本発明の実施例1に係るエッジ方向判定装置、エッジ方向判定装置の制御方法、及び、画像処理装置について、図面を用いて説明する。本実施例では、エッジ方向判定装置を有する画像処理装置が、IP変換(具体的には動き適応型IP変換)を行う画像処理装置である場合の例について説明するが、本発明のエッジ方向判定装置(及びその制御方法)は、画像の注目点におけるエッジの方向を判定するいかなる装置にも適用することができる。IP変換は、インターレース画像信号を補間によりプログレッシブ画像信号に変
換する処理である。動き適応型IP変換は、補間画素の生成位置での画像の動き(動き情報)を検出し、その動き情報に応じて、補間画素としてフィールド内補間画素を生成するか、フィールド間補間画素を生成するかを適応的に切り換えるIP変換である。
<Example 1>
Hereinafter, an edge direction determination apparatus, an edge direction determination apparatus control method, and an image processing apparatus according to Embodiment 1 of the present invention will be described with reference to the drawings. In this embodiment, an example in which an image processing apparatus having an edge direction determination apparatus is an image processing apparatus that performs IP conversion (specifically, motion adaptive IP conversion) will be described. The device (and its control method) can be applied to any device that determines the direction of an edge at a point of interest in an image. IP conversion is a process of converting an interlaced image signal into a progressive image signal by interpolation. Motion-adaptive IP conversion detects the motion (motion information) of an image at the interpolation pixel generation position, and generates an intra-field interpolation pixel or an inter-field interpolation pixel as an interpolation pixel according to the motion information. This is IP conversion that adaptively switches whether to do.

図1は、本実施例に係る画像処理装置の構成を示すブロック図である。
図1において、フィールドメモリ100,101はフィールド単位で装置に入力されるインターレース画像信号を蓄積し、該インターレース画像信号を1フィールド分だけ遅延させて出力する。即ち、画像処理装置にN番目のフィールド(Nフィールド)の画像信号FD0が入力された時に、フィールドメモリ100からは、N−1番目のフィールド(N−1フィールド)の画像信号FD1が出力される。フィールドメモリ101からは、N−2番目のフィールド(N−2フィールド)の画像信号FD2が出力される。本実施例では、N−1フィールドの画像信号FD1に対して補間画素が生成される。
FIG. 1 is a block diagram illustrating the configuration of the image processing apparatus according to the present embodiment.
In FIG. 1, field memories 100 and 101 store interlaced image signals input to the apparatus on a field-by-field basis, and output the interlaced image signals delayed by one field. That is, when the image signal FD0 of the Nth field (N field) is input to the image processing apparatus, the image signal FD1 of the (N-1) th field (N-1 field) is output from the field memory 100. . From the field memory 101, an image signal FD2 of the (N-2) th field (N-2 field) is output. In this embodiment, interpolation pixels are generated for the image signal FD1 of the N-1 field.

動き検出部102は、補間画素の生成位置での画像の動きを検出する。本実施例では、動き検出部102は、Nフィールド信号FD0及びN−2フィールド信号FD2の2つのフィールドの画像信号を用いて、補間画素の生成位置での画像の動き(動き情報MV)を検出する。具体的には、動き検出部102は、画素毎に、2つのフィールド間の画素値の差分値を閾値と比較することにより、動きの有無を判定する。差分値が閾値以上の場合は、画像の動きがある(MV=1(動き))と判定され、差分値が閾値未満の場合には、画像の動きがない(MV=0(静止))と判定される。そして、この判定結果(画素毎のMVの値)が動き情報として補間画素生成部105へ出力される。なお、動きの検出方法はこれに限らない。例えば、ブロックマッチングにより動きが検出されてもよい。   The motion detector 102 detects the motion of the image at the interpolation pixel generation position. In the present embodiment, the motion detection unit 102 detects the motion of the image (motion information MV) at the interpolation pixel generation position using the image signals of the two fields of the N field signal FD0 and the N-2 field signal FD2. To do. Specifically, the motion detection unit 102 determines the presence or absence of motion for each pixel by comparing the difference value of the pixel values between the two fields with a threshold value. If the difference value is greater than or equal to the threshold value, it is determined that there is an image motion (MV = 1 (motion)). If the difference value is less than the threshold value, there is no image motion (MV = 0 (still)). Determined. Then, this determination result (MV value for each pixel) is output to the interpolated pixel generation unit 105 as motion information. Note that the motion detection method is not limited to this. For example, the motion may be detected by block matching.

斜め検出部103は、補間画素の生成位置(注目点)におけるエッジの方向を判定する(エッジ方向判定装置)。具体的には、斜め検出部103は、補間画素の生成位置がエッジ部分か否かを判定する。そして、斜め検出部103は、補間画素の生成位置がエッジ部分であると判定した場合に、該エッジの方向を表す情報をフィールド内補間画素生成部104へ出力する。本実施例では、エッジの方向を表す情報として、当該方向の水平方向に対する傾斜角度を表す角度情報ANGLEが出力される。本実施例では、角度情報ANGLEは、−15〜+15の値を取り得るものとする。斜め検出部103が本実施例に係るエッジ方向判定装置に相当する。斜め検出部103の動作の詳細については、後述する。   The oblique detection unit 103 determines an edge direction at an interpolation pixel generation position (attention point) (edge direction determination device). Specifically, the oblique detection unit 103 determines whether or not the interpolation pixel generation position is an edge portion. When the oblique detection unit 103 determines that the generation position of the interpolation pixel is an edge portion, the oblique detection unit 103 outputs information representing the edge direction to the intra-field interpolation pixel generation unit 104. In the present embodiment, angle information ANGLE indicating the inclination angle of the direction with respect to the horizontal direction is output as information indicating the direction of the edge. In this embodiment, it is assumed that the angle information ANGLE can take a value of −15 to +15. The oblique detection unit 103 corresponds to the edge direction determination device according to the present embodiment. Details of the operation of the oblique detection unit 103 will be described later.

フィールド内補間画素生成部104は、角度情報ANGLEに基づいて、フィールド内補間による補間画素(フィールド内補間画素)を生成して出力する。具体的には、フィールド内補間画素生成部104は、フィールド内補間画素の画素値ID1を算出し、出力する。フィールド内補間画素は、画像の動きのある位置に生成するのに適した補間画素であり、補間画素の生成の対象となるN−1フィールド信号FD1の画素値を用いて生成される補間画素である。   The intra-field interpolation pixel generation unit 104 generates and outputs an interpolation pixel (intra-field interpolation pixel) by intra-field interpolation based on the angle information ANGLE. Specifically, the intra-field interpolation pixel generation unit 104 calculates and outputs the pixel value ID1 of the intra-field interpolation pixel. The intra-field interpolation pixel is an interpolation pixel suitable for generation at a position where the image moves, and is an interpolation pixel generated using the pixel value of the N-1 field signal FD1 that is a target of generation of the interpolation pixel. is there.

フィールド内補間画素生成部104は、例えば、図2に示すような構成を有する。
フィールド内補間画素生成部104に入力されたN−1フィールド信号FD1は、ラインメモリ200と選択部A201に入力される。
ラインメモリ200は、入力されたN−1フィールド信号FD1を1H(1水平走査期間)だけ遅延させ、当該遅延させた信号を1H遅延信号LD1として選択部B202に出力する。
選択部A201は、補間画素の生成位置毎に、N−1フィールド信号FD1(補間画素の生成位置の1つ下のラインの画像信号)から、角度情報ANGLEに応じた画素を選択し、その画素の画素値S1を出力する。
選択部B202は、補間画素の生成位置毎に、1H遅延信号LD1(補間画素の生成位置の1つ上のラインの画像信号)から、角度情報ANGLEに応じた画素を選択し、その
画素の画素値S2を出力する。
The intra-field interpolation pixel generation unit 104 has a configuration as shown in FIG. 2, for example.
The N−1 field signal FD1 input to the intra-field interpolation pixel generation unit 104 is input to the line memory 200 and the selection unit A201.
The line memory 200 delays the input N-1 field signal FD1 by 1H (one horizontal scanning period), and outputs the delayed signal to the selection unit B202 as a 1H delay signal LD1.
For each interpolation pixel generation position, the selection unit A201 selects a pixel corresponding to the angle information ANGLE from the N-1 field signal FD1 (the image signal of the line immediately below the interpolation pixel generation position), and the pixel The pixel value S1 is output.
For each interpolation pixel generation position, the selection unit B202 selects a pixel corresponding to the angle information ANGLE from the 1H delay signal LD1 (the image signal of the line one line above the interpolation pixel generation position), and the pixel of the pixel The value S2 is output.

選択部A201及び選択部B202における画素の選択方法について、図3(A)を用いて説明する。
図3(A)において、画素u(x)は、補間画素の生成位置Hの1つ上のライン上の画素であり、図2における1H遅延信号LD1で表される画素である。画素d(x)は、補間画素の生成位置Hの1つ下のライン上の画素であり、図2におけるN−1フィールド信号FD1で表される画素である。xは、補間画素の生成位置に対する画素u(x),d(x)の位置の水平方向のずれ量(補間画素の生成位置を基準とする画素u(x),d(x)の水平方向の位置を示す値)である。xの値が負の値である場合には、画素u(x),d(x)の水平方向の位置は、補間画素の生成位置に対して左側へ|x|画素ずれた位置となる。xの値が正の値である場合には、画素u(x),d(x)の水平方向の位置は、補間画素の生成位置に対して右側へ|x|画素ずれた位置となる。
A pixel selection method in the selection unit A201 and the selection unit B202 will be described with reference to FIG.
In FIG. 3A, a pixel u (x) is a pixel on a line immediately above the interpolation pixel generation position H, and is a pixel represented by the 1H delay signal LD1 in FIG. The pixel d (x) is a pixel on the line immediately below the interpolation pixel generation position H, and is a pixel represented by the N-1 field signal FD1 in FIG. x is a horizontal shift amount of the positions of the pixels u (x) and d (x) with respect to the generation position of the interpolation pixel (the horizontal direction of the pixels u (x) and d (x) based on the generation position of the interpolation pixel). Is a value indicating the position). When the value of x is a negative value, the horizontal positions of the pixels u (x) and d (x) are shifted by | x | pixels to the left with respect to the interpolation pixel generation position. When the value of x is a positive value, the horizontal positions of the pixels u (x) and d (x) are shifted by | x | pixels to the right from the interpolation pixel generation position.

本実施例では、斜め検出部103は、角度情報ANGLEとして、上述したxの値を出力する。また、斜め検出部103は、補間画素の生成位置がエッジ部分でない場合には、角度情報ANGLE=0を出力する。
角度情報ANGLE=+A(Aは自然数)の場合は、選択部A201でu(+A)が選択され、選択部B202でd(−A)が選択される。図3(A)は、補間画素の生成位置Hに対する角度情報ANGLEが+3の場合の例である。この場合、選択部A201でu(+3)が選択され、選択部B202でd(−3)が選択される。また、角度情報ANGLE=0の場合には、図3(B)に示すように、選択部A201でu(0)が選択され、選択部B202でd(0)が選択される。
In the present embodiment, the oblique detection unit 103 outputs the value of x described above as the angle information ANGLE. Further, the oblique detection unit 103 outputs angle information ANGLE = 0 when the interpolation pixel generation position is not an edge portion.
When the angle information ANGLE = + A (A is a natural number), u (+ A) is selected by the selection unit A201, and d (−A) is selected by the selection unit B202. FIG. 3A shows an example in which the angle information ANGLE for the interpolation pixel generation position H is +3. In this case, u (+3) is selected by the selection unit A201, and d (-3) is selected by the selection unit B202. When the angle information ANGLE = 0, as shown in FIG. 3B, u (0) is selected by the selection unit A201, and d (0) is selected by the selection unit B202.

加算器203は、選択部A201から出力された画素値S1と選択部B202から出力された画素値S2とを足し合わせることにより画素値S3を算出し、乗算器204へ出力する。
乗算器204は、画素値S3を1/2倍し、その結果(画素値S3を1/2倍した値)を、フィールド内補間画素の画素値ID1(フィールド内補間値)として出力する。
これにより、N−1フィールド信号FD1において、エッジ部分の補間画素の画素値として、そのエッジの方向に隣接する2画素の画素値の平均値を得ることができる。また、エッジ部分以外の位置の補間画素の画素値として、垂直方向に隣接する2画素の画素値の平均値を得ることができる。
The adder 203 calculates a pixel value S3 by adding the pixel value S1 output from the selection unit A201 and the pixel value S2 output from the selection unit B202, and outputs the pixel value S3 to the multiplier 204.
The multiplier 204 halves the pixel value S3 and outputs the result (a value obtained by halving the pixel value S3) as the pixel value ID1 (intra-field interpolation value) of the intra-field interpolation pixel.
Thereby, in the N-1 field signal FD1, the average value of the pixel values of two pixels adjacent in the direction of the edge can be obtained as the pixel value of the interpolation pixel of the edge portion. Moreover, the average value of the pixel values of two pixels adjacent in the vertical direction can be obtained as the pixel value of the interpolation pixel at a position other than the edge portion.

補間画素生成部105は、補間画素の生成位置毎に、動き情報MVに応じて補間方法を切り換え、補間画素を生成する(補間画素の画素値ID2を決定する)。即ち、補間画素生成部105は、動き適応型IP変換により補間画素を生成する。具体的には、補間画素の生成位置において画像の動きがない場合(MV=0である場合)には、補間画素生成部105は、該生成位置に対し、N−2フィールド信号FD2の画素値を画素値ID2として用いて、補間画素(フィールド間補間画素)を生成する。画像の動きがある場合(MV=1である場合)には、補間画素生成部105は、該生成位置に対し、フィールド内補間値ID1を画素値ID2として用いて、補間画素(フィールド内補間画素)を生成する。そして、補間画素生成部105は、各補間画素の画素値ID2を倍速変換部106へ出力する。なお、フィールド間補間画素は、画像の動きのない位置に生成するのに適した補間画素であって、N−2フィールド信号の画素値(補間画素の生成位置と同じ位置の画素値)と同じ画素値を有する補間画素である。   The interpolation pixel generation unit 105 switches the interpolation method according to the motion information MV for each generation position of the interpolation pixel, and generates an interpolation pixel (determines the pixel value ID2 of the interpolation pixel). That is, the interpolation pixel generation unit 105 generates an interpolation pixel by motion adaptive IP conversion. Specifically, when there is no image motion at the generation position of the interpolation pixel (when MV = 0), the interpolation pixel generation unit 105 outputs the pixel value of the N-2 field signal FD2 to the generation position. Is used as the pixel value ID2 to generate an interpolation pixel (inter-field interpolation pixel). When there is a motion of the image (when MV = 1), the interpolation pixel generation unit 105 uses the intra-field interpolation value ID1 as the pixel value ID2 for the generation position, and performs the interpolation pixel (intra-field interpolation pixel). ) Is generated. Then, the interpolation pixel generation unit 105 outputs the pixel value ID2 of each interpolation pixel to the double speed conversion unit 106. The inter-field interpolation pixel is an interpolation pixel suitable for generation at a position where there is no motion of the image, and is the same as the pixel value of the N-2 field signal (the pixel value at the same position as the generation position of the interpolation pixel). An interpolation pixel having a pixel value.

倍速変換部106は、各補間画素の画素値ID2と、N−1フィールド信号FD1とを合成してプログレッシブ画像信号(プログレッシブ画像の1フレームの画像信号)として出力する。具体的には、倍速変換部106は、N−1フィールド信号FD1と、各補間画
素の画素値ID2とを、インターレース画像信号が入力される速度の2倍の速度でライン毎に交互に読み出す。これにより、N−1フィールド信号FD1のオリジナルライン(N−1フィールドのインターレース画像を構成する画素からなるライン)のデータと、画素値ID2を有する補間画素からなるライン(補間ライン)のデータとがライン毎に交互に読み出される。そして、倍速変換部106は、データを読み出す度に、読み出したデータをプログレッシブ画像信号(プログレッシブ画像の1ラインのデータ)として出力する。
The double speed conversion unit 106 synthesizes the pixel value ID2 of each interpolation pixel and the N-1 field signal FD1 and outputs the result as a progressive image signal (an image signal for one frame of a progressive image). Specifically, the double speed conversion unit 106 alternately reads out the N-1 field signal FD1 and the pixel value ID2 of each interpolation pixel for each line at a speed twice the speed at which the interlaced image signal is input. Thereby, the data of the original line (line consisting of pixels constituting the interlaced image of the N-1 field) of the N-1 field signal FD1 and the data of the line (interpolation line) consisting of the interpolation pixel having the pixel value ID2 are obtained. It is alternately read for each line. Then, each time the data is read, the double speed conversion unit 106 outputs the read data as a progressive image signal (data of one line of the progressive image).

次に、斜め検出部103の構成について説明する。図4は、本実施例に係る斜め検出部103の内部構成を示すブロック図である。図4に示すように、本実施例に係る斜め検出部103は、ラインメモリ300、マッチング領域算出部D301、マッチング領域算出部U302、制御部303、切り出し位置決定部304、マッチング角度決定部305、ブロックサイズ決定部306、ブロックマッチング部307、マッチング角度算出部308などを備える。   Next, the configuration of the oblique detection unit 103 will be described. FIG. 4 is a block diagram illustrating an internal configuration of the oblique detection unit 103 according to the present embodiment. As shown in FIG. 4, the oblique detection unit 103 according to the present embodiment includes a line memory 300, a matching region calculation unit D301, a matching region calculation unit U302, a control unit 303, a cutout position determination unit 304, a matching angle determination unit 305, A block size determination unit 306, a block matching unit 307, a matching angle calculation unit 308, and the like are provided.

ラインメモリ300は、入力されたN−1フィールド信号FD1を1H(1水平走査期間)だけ遅延させ、当該遅延させた信号を1H遅延信号D0として出力する。   The line memory 300 delays the input N-1 field signal FD1 by 1H (one horizontal scanning period), and outputs the delayed signal as a 1H delay signal D0.

マッチング領域算出部D301とマッチング領域算出部U302は、エッジの方向の候補である複数の方向(候補方向)のそれぞれについて、注目点を通るその方向の直線上にn個(nは2以上の整数)のブロックを設定する。n個のブロックは、同じサイズのn個の領域である。ブロックは、所定方向(本実施例では水平方向)に沿った長辺を有する矩形状の領域である。
具体的には、マッチング領域算出部D301には、1H遅延信号D0(補間画素の生成位置の1つ下のラインの画素値)が入力される。マッチング領域算出部D301は、上記n個のブロックのうちの1つとして、補間画素の生成位置の1つ下のライン上の複数の画素からなる領域を設定する。そして、マッチング領域算出部D301は、設定したブロック内の1H遅延信号D0の画素値を、ブロックマッチング部307に出力する。即ち、ブロック内の画素値として、画素d(x)の画素値が出力される。
マッチング領域算出部U302には、N−1フィールド遅延信号FD1(補間画素の生成位置の1つ上のラインの画素値)が入力される。マッチング領域算出部U302は、上記n個のブロックのうちの1つとして、補間画素の生成位置の1つ上のライン上の複数の画素からなる領域を設定する。そして、マッチング領域算出部U302は、設定したブロック内のN−1フィールド遅延信号FD1の画素値を、ブロックマッチング部307に出力する。即ち、ブロック内の画素値として、画素u(x)の画素値が出力される。
For each of a plurality of directions (candidate directions) that are edge direction candidates, the matching area calculation unit D301 and the matching area calculation unit U302 are n (n is an integer of 2 or more) on a straight line in the direction passing through the point of interest. ) Block. The n blocks are n areas of the same size. The block is a rectangular region having a long side along a predetermined direction (horizontal direction in the present embodiment).
Specifically, the matching area calculation unit D301 receives the 1H delay signal D0 (the pixel value of the line immediately below the interpolation pixel generation position). The matching area calculation unit D301 sets, as one of the n blocks, an area composed of a plurality of pixels on a line immediately below the interpolation pixel generation position. Then, the matching area calculation unit D301 outputs the pixel value of the 1H delay signal D0 in the set block to the block matching unit 307. That is, the pixel value of the pixel d (x) is output as the pixel value in the block.
The matching area calculation unit U302 receives the N-1 field delay signal FD1 (the pixel value of the line immediately above the interpolation pixel generation position). The matching area calculation unit U302 sets, as one of the n blocks, an area composed of a plurality of pixels on a line that is one level above the interpolation pixel generation position. Then, the matching area calculation unit U302 outputs the pixel value of the N−1 field delay signal FD1 in the set block to the block matching unit 307. That is, the pixel value of the pixel u (x) is output as the pixel value in the block.

ブロック(画素u(x)のxの範囲および画素d(x)のxの範囲)は、切り出し位置決定部304から出力されたPと、ブロックサイズ決定部306から出力されたBSとから決定される。Pは、候補方向を表す値である。本実施例では、Pは、注目点(補間画素の生成位置)を通る候補方向の直線上の画素u(x)の水平方向位置xである。注目点を通る候補方向の直線上の画素d(x)の水平方向位置xは−Pとなる。BSはブロックの所定方向(本実施例では水平方向)のサイズ(画素数)である。画素u(x)のxの範囲(水平範囲)および画素d(x)のxの範囲は以下の算出式で算出される。なお、以下の式において、int(B/2)は、その値が整数であることを意味する。本実施例では、int(B/2)は、B/2の小数点以下を切り捨てた値である。
uの範囲:(P−int(BS/2))〜(P+int(BS/2))
dの範囲:(−P−int(BS/2))〜(−P+int(BS/2))
The block (the x range of the pixel u (x) and the x range of the pixel d (x)) is determined from P output from the cutout position determining unit 304 and the BS output from the block size determining unit 306. The P is a value representing the candidate direction. In this embodiment, P is the horizontal position x of the pixel u (x) on the straight line in the candidate direction passing through the point of interest (interpolation pixel generation position). The horizontal position x of the pixel d (x) on the straight line in the candidate direction passing through the point of interest is −P. BS is the size (number of pixels) in a predetermined direction (horizontal direction in this embodiment) of the block. The x range (horizontal range) of the pixel u (x) and the x range of the pixel d (x) are calculated by the following calculation formula. In the following expression, int (B / 2) means that the value is an integer. In this embodiment, int (B / 2) is a value obtained by rounding down the decimal point of B / 2.
u range: (P-int (BS / 2)) to (P + int (BS / 2))
Range of d: (-P-int (BS / 2)) to (-P + int (BS / 2))

ブロックマッチング部307は、複数の候補方向のそれぞれについて、設定されたn個(本実施例では2つ)のブロック間の画像の類似度を算出する。
マッチング角度算出部308は、複数の候補方向のうち、類似度が最も高い方向を、注
目点(補間画素の生成位置)におけるエッジの方向として判定する。
The block matching unit 307 calculates the similarity of images between the set n (two in this embodiment) blocks for each of a plurality of candidate directions.
The matching angle calculation unit 308 determines the direction with the highest similarity among the plurality of candidate directions as the edge direction at the point of interest (interpolation pixel generation position).

次に、本実施例に係る斜め検出部103の処理の流れを図5のフローチャートを用いて説明する。
まず、S102で、制御部303が、iの初期化を行い、iの初期値を切り出し位置決定部304に出力する。iは、候補方向を表す値である。本実施例では、iは、注目点(補間画素の生成位置)を通る候補方向の直線上の画素u(x)の水平方向位置xであり、−15〜15の値が設定される。本実施例では、初期値としてi=−15が設定される。
Next, the processing flow of the oblique detection unit 103 according to the present embodiment will be described with reference to the flowchart of FIG.
First, in step S <b> 102, the control unit 303 initializes i and outputs an initial value of i to the cut-out position determination unit 304. i is a value representing the candidate direction. In this embodiment, i is the horizontal position x of the pixel u (x) on the straight line in the candidate direction passing through the point of interest (interpolation pixel generation position), and a value of -15 to 15 is set. In this embodiment, i = −15 is set as an initial value.

次に、S103で、切り出し位置決定部304が、切り出し位置Pを決定し、マッチング領域算出部D301、マッチング領域算出部U302、マッチング角度決定部305、及び、ブロックマッチング部307に出力する。具体的には、切り出し位置決定部304は、制御部303から入力されたiを切り出し位置Pとして出力する。図6に示すように、マッチング領域算出部D301とマッチング領域算出部U302において、決定されたPの値から、設定するブロックの中心位置が判断される。具体的には、マッチング領域算出部U302では、画素u(P)の位置が中心位置として判断される。マッチング領域算出部D301では、画素d(−P)の位置が中心位置として判断される。画素u(P)は、補間画素の生成位置Hを中心として画素d(−P)と点対称の位置にある。図6は、P=−3の例である。   Next, in S103, the cutout position determination unit 304 determines the cutout position P and outputs the cutout position P to the matching region calculation unit D301, the matching region calculation unit U302, the matching angle determination unit 305, and the block matching unit 307. Specifically, the cutout position determination unit 304 outputs i input from the control unit 303 as the cutout position P. As shown in FIG. 6, the matching area calculation unit D301 and the matching area calculation unit U302 determine the center position of the block to be set from the determined P value. Specifically, in the matching area calculation unit U302, the position of the pixel u (P) is determined as the center position. In the matching area calculation unit D301, the position of the pixel d (−P) is determined as the center position. The pixel u (P) is point-symmetric with the pixel d (−P) with the generation position H of the interpolation pixel as the center. FIG. 6 is an example of P = -3.

そして、S104で、マッチング角度決定部305が、S103で決定された切り出し位置Pに基づいて、マッチング角度MAを算出する。マッチング角度決定部305は、算出したマッチング角度MAを、ブロックサイズ決定部306に出力する。マッチング角度MAは、図6に示すように、切り出し位置Pで表される候補方向の、所定方向(本実施例では水平方向)に対する角度である。換言すれば、マッチング角度MAは、画素u(P)と画素d(−P)とを結ぶ直線と、水平方向とのなす角度である。本実施例では、切り出し位置P毎のマッチング角度MAを表すテーブルが予め用意されており、当該テーブルを用いて、S103で決定された切り出し位置Pからマッチング角度MAが決定される。   In step S104, the matching angle determination unit 305 calculates the matching angle MA based on the cutout position P determined in step S103. The matching angle determination unit 305 outputs the calculated matching angle MA to the block size determination unit 306. As shown in FIG. 6, the matching angle MA is an angle of the candidate direction represented by the cutout position P with respect to a predetermined direction (horizontal direction in the present embodiment). In other words, the matching angle MA is an angle formed between a straight line connecting the pixel u (P) and the pixel d (−P) and the horizontal direction. In this embodiment, a table representing the matching angle MA for each cutout position P is prepared in advance, and the matching angle MA is determined from the cutout position P determined in S103 using the table.

次に、S105で、ブロックサイズ決定部306が、S104で算出されたマッチング角度MAに基づいて、ブロックサイズBSを算出する。具体的には、マッチング角度MAが大きい候補方向について設定するブロックよりも、マッチング角度MAが小さい候補方向について設定するブロックのほうが、所定方向(本実施例では水平方向)の長さが長くなるように、ブロックサイズBSが算出される。本実施例では、マッチング角度毎(若しくはマッチング角度MAの範囲毎)のブロックサイズBSを表すテーブルが予め用意されており、当該テーブルを用いて、S104で算出されたマッチング角度MAからブロックサイズBSが決定される。テーブルの一例を図7に示す。
ブロックサイズ決定部306は、算出したブロックサイズBSを、マッチング領域算出部D301、マッチング領域算出部U302、及び、ブロックマッチング部307に出力する。その後、マッチング領域算出部D301とマッチング領域算出部U302において、上記決定されたブロックサイズBSのブロックが設定され、ブロック内の画素値がブロックマッチング部307に出力される。
このように、本実施例では、マッチング角度MAに基づいて、設定するn個のブロックのサイズが制御される。
Next, in S105, the block size determination unit 306 calculates the block size BS based on the matching angle MA calculated in S104. Specifically, the length of the predetermined direction (horizontal direction in the present embodiment) is longer in the block set for the candidate direction having the smaller matching angle MA than in the block set for the candidate direction having the larger matching angle MA. Next, the block size BS is calculated. In this embodiment, a table representing the block size BS for each matching angle (or for each range of the matching angle MA) is prepared in advance, and the block size BS is calculated from the matching angle MA calculated in S104 using the table. It is determined. An example of the table is shown in FIG.
The block size determination unit 306 outputs the calculated block size BS to the matching region calculation unit D301, the matching region calculation unit U302, and the block matching unit 307. Thereafter, in the matching area calculation unit D301 and the matching area calculation unit U302, the block having the determined block size BS is set, and the pixel value in the block is output to the block matching unit 307.
Thus, in the present embodiment, the size of n blocks to be set is controlled based on the matching angle MA.

そして、S106で、ブロックマッチング部307が、S103で算出された切り出し位置P、S105で算出されたブロックサイズBS、マッチング領域算出部D301とマッチング領域算出部U302から出力された画素値を用いて、ブロックマッチングを行う。ブロックマッチングは、マッチング領域算出部D301で設定されたブロック内の画素値と、マッチング領域算出部U302で設定されたブロック内の画素値とを比較する処理
である。ブロックマッチングにより、SAD値(差分絶対値和)が算出される。
In step S106, the block matching unit 307 uses the cutout position P calculated in step S103, the block size BS calculated in step S105, and the pixel values output from the matching region calculation unit D301 and the matching region calculation unit U302. Perform block matching. Block matching is a process of comparing the pixel value in the block set by the matching area calculation unit D301 with the pixel value in the block set by the matching area calculation unit U302. A SAD value (sum of absolute differences) is calculated by block matching.

図8に、設定されたブロックの一例を示す。図8は、切り出し位置Pが−3であり、ブロックサイズBSが5である場合に設定されるブロックを示す。図8の例では、実ラインUの画素u(−1)〜u(−5)の領域と、実ラインDの画素d(+1)〜d(+5)の領域とが、それぞれブロックとして設定されている。実ラインUは、補間画素の生成位置Hの1つ上のラインであり、実ラインDは、補間画素の生成位置の1つ下のラインである。また、図8中の補間ラインは補間画素が生成されるラインである。画素d(+1)〜d(+5)は、補間画素の生成位置Hを中心として、画素u(−1)〜u(−5)と点対称の位置にある。   FIG. 8 shows an example of the set block. FIG. 8 shows a block set when the cutout position P is −3 and the block size BS is 5. In the example of FIG. 8, the areas of pixels u (−1) to u (−5) on the actual line U and the areas of pixels d (+1) to d (+5) on the actual line D are set as blocks, respectively. ing. The actual line U is a line immediately above the interpolation pixel generation position H, and the actual line D is a line immediately below the interpolation pixel generation position. Further, the interpolation line in FIG. 8 is a line in which an interpolation pixel is generated. The pixels d (+1) to d (+5) are point-symmetric with respect to the pixels u (−1) to u (−5) around the interpolation pixel generation position H.

図8に示すブロックが設定された場合、実ラインUの画素u(−1)〜u(−5)と、実ラインDの画素d(+1)〜d(+5)の値とを用いて、SAD値が算出される。SAD値は、以下の式を用いて算出される。

Figure 0006012230
When the block shown in FIG. 8 is set, the pixels u (−1) to u (−5) of the actual line U and the values of the pixels d (+1) to d (+5) of the actual line D are used. A SAD value is calculated. The SAD value is calculated using the following equation.
Figure 0006012230

例えば、図8の例では、SAD値は以下の演算により算出される。なお、以下の式において、u(x)、d(x)はその画素の画素値を表す。
SAD(−3)=|u(−5)−d(+1)|
+|u(−4)−d(+2)|
+|u(−3)−d(+3)|
+|u(−2)−d(+4)|
+|u(−1)−d(+5)|
For example, in the example of FIG. 8, the SAD value is calculated by the following calculation. In the following expression, u (x) and d (x) represent pixel values of the pixel.
SAD (−3) = | u (−5) −d (+1) |
+ | U (-4) -d (+2) |
+ | U (-3) -d (+3) |
+ | U (-2) -d (+4) |
+ | U (-1) -d (+5) |

S106の次に、S107で、ブロックマッチング部307が、SAD値の正規化を行う。上述したように、本実施例では、ブロックサイズが一定ではない(候補方向によって変化する)。複数のブロックサイズで得られた複数のSADは、同じ基準で扱うことはできない。そこで、本ステップでは、或るブロックサイズに対応する値となるように、S106で算出したSAD値を正規化する。本実施例では、一番小さなブロックサイズに対応する値となるように、S106で算出したSAD値を正規化する。例えば、ブロックサイズの最小値が3であり、ブロックサイズを15としてSAD値が算出された場合には、算出されたSAD値に3/15を乗算することにより、正規化後のSAD値が得られる。なお、SAD値が一番小さくなるブロックサイズに対応する値となるように、SAD値が正規化されてもよいし、SAD値が一番大きくなるブロックサイズに対応する値となるように、SAD値が正規化されてもよい。   Following S106, in S107, the block matching unit 307 normalizes the SAD value. As described above, in this embodiment, the block size is not constant (changes depending on the candidate direction). A plurality of SADs obtained with a plurality of block sizes cannot be handled on the same basis. Therefore, in this step, the SAD value calculated in S106 is normalized so that the value corresponds to a certain block size. In this embodiment, the SAD value calculated in S106 is normalized so that the value corresponds to the smallest block size. For example, when the minimum value of the block size is 3 and the SAD value is calculated with the block size being 15, the normalized SAD value is obtained by multiplying the calculated SAD value by 3/15. It is done. Note that the SAD value may be normalized so that the SAD value becomes a value corresponding to the smallest block size, or the SAD so that the SAD value becomes a value corresponding to the largest block size. The value may be normalized.

次に、S108で、制御部303が、i=+15か否かを判定する。この判定により、複数の候補方向の全てについてSAD値が算出されたか否かを判定することができる。つまり、i=+15の場合には、制御部303が、複数の候補方向の全てについてSAD値が算出されたと判断し、本フローが終了される。i=+15でない場合には、制御部303が、複数の候補方向の全てについてのSAD値の算出が完了していないと判断し、S109でiを1インクリメントする。そして、S103へ処理が戻され、i=+15となるまで、S103〜S107の処理が繰り返される。   Next, in S108, the control unit 303 determines whether i = + 15. This determination makes it possible to determine whether or not SAD values have been calculated for all of the plurality of candidate directions. That is, in the case of i = + 15, the control unit 303 determines that the SAD values have been calculated for all of the plurality of candidate directions, and this flow ends. When i is not +15, the control unit 303 determines that calculation of SAD values for all of the plurality of candidate directions is not completed, and increments i by 1 in S109. Then, the process returns to S103, and the processes of S103 to S107 are repeated until i = + 15.

ブロックマッチング部307は、上記処理フローにより得られた複数のSAD値をマッチング角度算出部308に出力する。上記複数のSAD値は、P=−15〜+15に対応する31個のSAD値(正規化された値)である。正規化されたSAD値は、ブロック間
の画像の類似度に対応する(非類似度を表す)。そして、マッチング角度算出部308は、上記31個のSAD値から、エッジの方向を判定する(詳細は後述する)。
以上述べた処理は、補間画素の生成位置毎に行われる。
なお、図5では、iの値をカウントして、候補方向毎にSAD値を算出する例を示したが、複数の候補方向に対応する複数のSAD値が並列に算出されてもよい。
The block matching unit 307 outputs a plurality of SAD values obtained by the above processing flow to the matching angle calculation unit 308. The plurality of SAD values are 31 SAD values (normalized values) corresponding to P = −15 to +15. The normalized SAD value corresponds to the image similarity between blocks (represents dissimilarity). Then, the matching angle calculation unit 308 determines the edge direction from the 31 SAD values (details will be described later).
The processing described above is performed for each interpolation pixel generation position.
Although FIG. 5 shows an example in which the value of i is counted and the SAD value is calculated for each candidate direction, a plurality of SAD values corresponding to a plurality of candidate directions may be calculated in parallel.

マッチング角度算出部308は、ブロックマッチング部307で算出された31個のSAD値(正規化された値)から、補間画素の生成位置でのエッジの方向を判定し、判定結果を角度情報ANGLEとして出力する。本実施例では、複数(31個)の候補方向のうち、ブロック間の画像の類似度が最も高い方向が、注目点(補間画素の生成位置)におけるエッジの方向として判定される。SAD値は、ブロック間の画像の類似度が高いほど小さくなる。そのため、本実施例では、マッチング角度算出部308は、上記31個のSAD値の最小値に対応するPの値が、補間画素の生成位置でのエッジの方向を表す値であると判定される。SAD値の最小値(SADmin)は以下の式で算出される。なお、以下の式において、Pは−15〜15であり、MINは最小値を算出する関数である。
SADmin=MIN(SAD(P))
マッチング角度算出部308は、SADmin=SAD(P)となるPの値を角度情報ANGLEとして出力する。なお、SADminが所定の閾値以上である場合には、補間画素の生成位置がエッジ部分ではないと判定されてもよい。補間画素の生成位置がエッジ部分ではないと判定された場合には、角度情報ANGLEとして0が出力される。
The matching angle calculation unit 308 determines the edge direction at the generation position of the interpolation pixel from the 31 SAD values (normalized values) calculated by the block matching unit 307, and uses the determination result as angle information ANGLE. Output. In the present embodiment, among the plurality (31) of candidate directions, the direction with the highest image similarity between blocks is determined as the edge direction at the point of interest (interpolation pixel generation position). The SAD value decreases as the image similarity between blocks increases. Therefore, in the present embodiment, the matching angle calculation unit 308 determines that the value of P corresponding to the minimum value of the 31 SAD values is a value that represents the direction of the edge at the interpolation pixel generation position. . The minimum SAD value (SADmin) is calculated by the following equation. In the following formula, P is −15 to 15, and MIN is a function for calculating the minimum value.
SADmin = MIN (SAD (P))
The matching angle calculation unit 308 outputs a value of P satisfying SADmin = SAD (P) as angle information ANGLE. When SADmin is equal to or greater than a predetermined threshold value, it may be determined that the interpolation pixel generation position is not an edge portion. If it is determined that the interpolation pixel generation position is not an edge portion, 0 is output as the angle information ANGLE.

例えば、図9(A)に示すような画素構成の画像(斜めエッジ部分の画像)を表す信号が入力された場合には、補間画素の生成位置Hに対して算出された31個のSAD値の分布は図9(B)のようになる。図9(B)の例では、実ラインUのu(+3)の位置(P=+3の位置)に対応するSAD値が最小値SADminとなっている。そのため、マッチング角度算出部308からは、角度情報ANGLE=+3が出力される。   For example, when a signal representing an image having a pixel configuration as shown in FIG. 9A (an image of an oblique edge portion) is input, 31 SAD values calculated for the interpolation pixel generation position H The distribution of is as shown in FIG. In the example of FIG. 9B, the SAD value corresponding to the position of u (+3) on the actual line U (the position of P = + 3) is the minimum value SADmin. Therefore, angle information ANGLE = + 3 is output from the matching angle calculation unit 308.

次に、マッチング角度MAが30°、10°、5°の場合における、SAD値算出の具体例を説明する。
マッチング角度MAとブロックサイズBSの関係の一例を図10に示す。マッチング角度MAとブロックサイズBSの関係が図10に示す関係であった場合、MA=30°のときにBS=5となり、MA=10°のときにBS=9となり、MA=5°のときにBS=15となる。
Next, a specific example of SAD value calculation when the matching angle MA is 30 °, 10 °, and 5 ° will be described.
An example of the relationship between the matching angle MA and the block size BS is shown in FIG. When the relationship between the matching angle MA and the block size BS is as shown in FIG. 10, BS = 5 when MA = 30 °, BS = 9 when MA = 10 °, and when MA = 5 °. BS = 15.

図11(A)を用いて、MA=30°の場合の例について詳細に説明する。
図11(A)の例では、実ラインUと実ラインDのそれぞれについて、補間ライン上に位置する注目点(補間画素の生成位置)を通り、MA=30°を満たす直線上の画素を中心として、水平方向5画素分の領域がブロックとして設定される。実ラインUに対して設定されたブロックをブロック1A、実ラインDに対して設定されたブロックをブロック2Aと記載する。
具体的には、切り出し位置決定部304においてP=−3とされ、マッチング角度決定部305においてMA=30°とされ、ブロックサイズ決定部306において図10の関係からBS=5とされる。そのため、実ラインUについては、注目点から左側に3画素離れた画素(実ラインU上の画素)を中心とする水平方向5画素分の領域が、ブロック1Aとして設定される。実ラインDについては、注目点から右側に3画素離れた画素(実ラインD上の画素)を中心とする水平方向5画素分の領域が、ブロック2Aとして設定される。ブロック1Aは、注目点を中心としてブロック2Aと点対称の位置にある。
そして、ブロックマッチング部307において、ブロック1Aの画素値と、ブロック2Aの画素値とが比較されて、SAD値が算出される。
An example in the case of MA = 30 ° will be described in detail with reference to FIG.
In the example of FIG. 11A, for each of the real line U and the real line D, the pixel on the straight line that passes through the point of interest (interpolation pixel generation position) located on the interpolation line and satisfies MA = 30 ° is centered. As a result, an area for five pixels in the horizontal direction is set as a block. A block set for the actual line U is referred to as a block 1A, and a block set for the actual line D is referred to as a block 2A.
Specifically, P = −3 is set in the cutout position determination unit 304, MA = 30 ° in the matching angle determination unit 305, and BS = 5 in the block size determination unit 306 from the relationship of FIG. Therefore, for the actual line U, an area corresponding to 5 pixels in the horizontal direction centering on a pixel (pixel on the actual line U) that is 3 pixels to the left of the attention point is set as a block 1A. For the real line D, an area corresponding to 5 pixels in the horizontal direction centered on a pixel (pixel on the real line D) that is 3 pixels to the right of the point of interest is set as a block 2A. The block 1A is point-symmetric with the block 2A with the point of interest as the center.
Then, in the block matching unit 307, the pixel value of the block 1A and the pixel value of the block 2A are compared, and the SAD value is calculated.

図11(B)を用いて、MA=10°の場合の例について詳細に説明する。
図11(B)の例では、実ラインUと実ラインDのそれぞれについて、補間ライン上に位置する注目点(補間画素の生成位置)を通り、MA=10°を満たす直線上の画素を中心として、水平方向9画素分の領域がブロックとして設定される。実ラインUに対して設定されたブロックをブロック1B、実ラインDに対して設定されたブロックをブロック2Bと記載する。
具体的には、切り出し位置決定部304においてP=−6とされ、マッチング角度決定部305においてMA=10°とされ、ブロックサイズ決定部306において図10の関係からBS=9とされる。そのため、実ラインUについては、注目点から左側に6画素離れた画素(実ラインU上の画素)を中心とする水平方向9画素分の領域が、ブロック1Bとして設定される。実ラインDについては、注目点から右側に6画素離れた画素(実ラインD上の画素)を中心とする水平方向9画素分の領域が、ブロック2Bとして設定される。ブロック1Bは、注目点を中心としてブロック2Bと点対称の位置にある。
そして、ブロックマッチング部307において、ブロック1Bの画素値と、ブロック2Bの画素値とが比較されて、SAD値が算出される。
ここで、SAD値がBS=5に対応する値に正規化されるものとすると、上記算出されたSAD値(正規化前のSAD値;9画素SAD)は以下の式により正規化される。以下の式において、5画素SADは正規化後のSAD値である。
5画素SAD=9画素SAD×(5/9)
An example in the case of MA = 10 ° will be described in detail with reference to FIG.
In the example of FIG. 11B, for each of the real line U and the real line D, the pixel on the straight line that passes through the point of interest (interpolation pixel generation position) located on the interpolation line and satisfies MA = 10 ° is centered. As a result, an area for nine pixels in the horizontal direction is set as a block. A block set for the actual line U is referred to as a block 1B, and a block set for the actual line D is referred to as a block 2B.
Specifically, P = −6 is set in the cutout position determination unit 304, MA = 10 ° in the matching angle determination unit 305, and BS = 9 in the block size determination unit 306 from the relationship of FIG. Therefore, for the actual line U, an area corresponding to 9 pixels in the horizontal direction centered on a pixel (pixel on the actual line U) that is 6 pixels to the left of the point of interest is set as the block 1B. For the real line D, an area corresponding to 9 pixels in the horizontal direction centered on a pixel (pixel on the real line D) that is 6 pixels to the right of the point of interest is set as a block 2B. The block 1B is point-symmetric with the block 2B around the point of interest.
Then, in the block matching unit 307, the pixel value of the block 1B and the pixel value of the block 2B are compared to calculate the SAD value.
Here, assuming that the SAD value is normalized to a value corresponding to BS = 5, the calculated SAD value (SAD value before normalization; 9-pixel SAD) is normalized by the following equation. In the following formula, 5 pixel SAD is a normalized SAD value.
5 pixels SAD = 9 pixels SAD × (5/9)

図11(C)を用いて、MA=5°の場合の例について詳細に説明する。
図11(C)の例では、実ラインUと実ラインDのそれぞれについて、補間ライン上に位置する注目点(補間画素の生成位置)を通り、MA=5°を満たす直線上の画素を中心として、水平方向15画素分の領域がブロックとして設定される。実ラインUに対して設定されたブロックをブロック1C、実ラインDに対して設定されたブロックをブロック2Cと記載する。
具体的には、切り出し位置決定部304においてP=−12とされ、マッチング角度決定部305においてMA=5°とされ、ブロックサイズ決定部306において図10の関係からBS=15とされる。そのため、実ラインUについては、注目点から左側に12画素離れた画素(実ラインU上の画素)を中心とする水平方向15画素分の領域が、ブロック1Cとして設定される。実ラインDについては、注目点から右側に12画素離れた画素(実ラインD上の画素)を中心とする水平方向15画素分の領域が、ブロック2Cとして設定される。ブロック1Cは、注目点を中心としてブロック2Cと点対称の位置にある。
そして、ブロックマッチング部307において、ブロック1Cの画素値と、ブロック2Cの画素値とが比較されて、SAD値が算出される。
ここで、SAD値がBS=5に対応する値に正規化されるものとすると、上記算出されたSAD値(正規化前のSAD値;15画素SAD)は以下の式により正規化される。以下の式において、5画素SADは正規化後のSAD値である。
5画素SAD=15画素SAD×(5/15)
An example in the case of MA = 5 ° will be described in detail with reference to FIG.
In the example of FIG. 11C, for each of the real line U and the real line D, the pixel on the straight line that passes through the point of interest (interpolation pixel generation position) located on the interpolation line and satisfies MA = 5 ° is the center. As a result, a region for 15 pixels in the horizontal direction is set as a block. A block set for the actual line U is referred to as a block 1C, and a block set for the actual line D is referred to as a block 2C.
Specifically, P = −12 is set in the cut-out position determination unit 304, MA = 5 ° is set in the matching angle determination unit 305, and BS = 15 is set in the block size determination unit 306 from the relationship of FIG. Therefore, for the real line U, an area for 15 pixels in the horizontal direction centering on a pixel 12 pixels away from the target point to the left (pixels on the real line U) is set as a block 1C. For the real line D, an area for 15 pixels in the horizontal direction centered on a pixel 12 pixels away from the target point on the right side (a pixel on the real line D) is set as a block 2C. The block 1C is point-symmetric with the block 2C around the point of interest.
Then, in the block matching unit 307, the pixel value of the block 1C and the pixel value of the block 2C are compared, and the SAD value is calculated.
Here, assuming that the SAD value is normalized to a value corresponding to BS = 5, the calculated SAD value (SAD value before normalization; 15 pixel SAD) is normalized by the following expression. In the following formula, 5 pixel SAD is a normalized SAD value.
5 pixels SAD = 15 pixels SAD × (5/15)

以上述べたように、本実施例によれば、エッジの方向の候補である候補方向の、所定方向(本実施例では水平方向)に対する角度に依ってブロックサイズが変更される。具体的には、所定方向に対する角度が大きい候補方向について設定するブロックよりも、所定方向に対する角度が小さい候補方向について設定するブロックのほうが、所定方向の長さが長くなるように、ブロックのサイズが制御される。即ち、本実施例では、エッジ方向が上記角度の浅い方向である可能性の度合いを算出する際に、ブロックのサイズが大きくされ、エッジ方向が上記角度の深い方向である可能性の度合いを算出する際に、ブロックのサイズが小さくされる。それにより、エッジの方向を精度良く判定することができる。なお、上記可能性の度合いは、ブロック間の画像の類似度である。
具体的には、ブロックの所定方向の長さが長い場合、エッジ方向が上記角度の浅い方向
である可能性の度合いを精度良く算出することができるが、エッジ方向が上記角度の深い方向である可能性の度合いは精度良く算出することができない。一方、ブロックの所定方向の長さが短い場合、エッジ方向が上記角度の深い方向である可能性の度合いを精度良く算出することができるが、エッジ方向が上記角度の浅い方向である可能性の度合いは精度良く算出することができない。本実施例では、上述したようにブロックのサイズを制御することにより、エッジ方向が上記角度の浅い方向である可能性の度合いと、エッジ方向が上記角度の深い方向である可能性の度合いとの両方を精度良く算出することができる。それにより、エッジの方向を精度良く判定することができ、ひいては、正確な補間画素を生成することができ、ジャギーの発生を抑制することができる。
As described above, according to the present embodiment, the block size is changed depending on the angle of the candidate direction, which is a candidate for the edge direction, with respect to the predetermined direction (the horizontal direction in the present embodiment). Specifically, the block size is set so that the length in the predetermined direction is longer in the block set in the candidate direction having a small angle with respect to the predetermined direction than in the block set in the candidate direction having a large angle with respect to the predetermined direction. Be controlled. That is, in this embodiment, when calculating the degree of possibility that the edge direction is a shallow direction of the angle, the size of the block is increased, and the degree of possibility that the edge direction is a direction having a deep angle is calculated. In doing so, the block size is reduced. Thereby, the direction of the edge can be accurately determined. Note that the degree of possibility is the similarity of images between blocks.
Specifically, when the length of the block in a predetermined direction is long, the degree of possibility that the edge direction is a direction with a shallow angle can be calculated with high accuracy, but the edge direction is a direction with a deep angle. The degree of possibility cannot be calculated with high accuracy. On the other hand, when the length of the predetermined direction of the block is short, the degree of possibility that the edge direction is the deep direction of the angle can be accurately calculated, but the edge direction may be the shallow direction of the angle. The degree cannot be calculated with high accuracy. In this embodiment, by controlling the block size as described above, the degree of possibility that the edge direction is a direction with a shallow angle and the degree of possibility that the edge direction is a direction with a deep angle. Both can be calculated with high accuracy. Thereby, the direction of the edge can be determined with high accuracy, and hence an accurate interpolation pixel can be generated, and the occurrence of jaggy can be suppressed.

なお、本実施例では、注目点が補間画素の生成位置である場合の例を示したが、注目点はこれに限らない。例えば、注目点は実ライン上の画素位置であってもよい。
なお、本実施例では、画像の類似度に対応する値としてSAD値(正規化されたSAD値)である場合の例を説明したが、類似度に対応する値はSAD値に限らない。例えば、ブロック毎に画像のパターンが解析され、ブロック間のパターンの差が、類似度に対応する値(非類似度)として算出されてもよい。また、SAD値の逆数が類似度として算出されてもよい。
なお、本実施例では、注目点の上下に隣接するライン上にブロックが設定されるものとしたが、注目点から離れたライン上にブロックが設定されてもよい。また、本実施例では、ブロックの垂直方向のサイズが1画素であるものとしたが、垂直方向のサイズは複数画素分のサイズであってもよい。ブロックは注目点を含む領域であってもよい。
In this embodiment, an example in which the attention point is the interpolation pixel generation position is shown, but the attention point is not limited thereto. For example, the attention point may be a pixel position on an actual line.
In the present embodiment, an example in which an SAD value (normalized SAD value) is used as a value corresponding to the similarity of images has been described, but the value corresponding to the similarity is not limited to the SAD value. For example, the image pattern may be analyzed for each block, and the pattern difference between the blocks may be calculated as a value (dissimilarity) corresponding to the similarity. Further, the reciprocal of the SAD value may be calculated as the similarity.
In this embodiment, the blocks are set on the lines adjacent above and below the point of interest, but the blocks may be set on a line away from the point of interest. In this embodiment, the vertical size of the block is one pixel, but the vertical size may be a size corresponding to a plurality of pixels. The block may be an area including a point of interest.

<実施例2>
以下、本発明の実施例2に係るエッジ方向判定装置、エッジ方向判定装置の制御方法、及び、画像処理装置について、図面を用いて説明する。実施例1では、候補方向毎に2つのブロックを設定する例について説明した。本実施例では、候補方向毎に3つのブロックを設定する例について説明する。なお、実施例1と同様の機能や構成については極力説明を省略する。
本実施例に係る画像処理装置の大まかな構成は実施例1(図1)と同様のため、その説明は省略する。
<Example 2>
Hereinafter, an edge direction determination apparatus, an edge direction determination apparatus control method, and an image processing apparatus according to Embodiment 2 of the present invention will be described with reference to the drawings. In the first embodiment, an example in which two blocks are set for each candidate direction has been described. In this embodiment, an example in which three blocks are set for each candidate direction will be described. Note that descriptions of functions and configurations similar to those of the first embodiment are omitted as much as possible.
Since the general configuration of the image processing apparatus according to the present embodiment is the same as that of the first embodiment (FIG. 1), description thereof is omitted.

本実施例では、斜め検出部の内部構成が実施例1と異なる。図12は、本実施例に係る斜め検出部の内部構成を示すブロック図である。   In the present embodiment, the internal configuration of the oblique detection unit is different from that of the first embodiment. FIG. 12 is a block diagram illustrating an internal configuration of the oblique detection unit according to the present embodiment.

ラインメモリ400は、入力されたN−1フィールド信号FD1を1H(1水平走査期間)だけ遅延させ、当該遅延させた信号を1H遅延信号D0として出力する。
ラインメモリ401は、入力された1H遅延信号D0を1Hだけ遅延させ、当該遅延させた信号を2H遅延信号D1として出力する。2H遅延信号D1は、N−1フィールド信号FD1を2Hだけ遅延させた信号である。
The line memory 400 delays the input N-1 field signal FD1 by 1H (one horizontal scanning period), and outputs the delayed signal as a 1H delay signal D0.
The line memory 401 delays the input 1H delay signal D0 by 1H, and outputs the delayed signal as a 2H delay signal D1. The 2H delay signal D1 is a signal obtained by delaying the N-1 field signal FD1 by 2H.

マッチング領域算出部2D402、マッチング領域算出部D403、及び、マッチング領域算出部U404は、複数の候補方向のそれぞれについて、注目点を通るその方向の直線上に3つのブロックを設定する。
具体的には、マッチング領域算出部2D402には、2H遅延信号D1(補間画素の生成位置の3つ下のラインの画素値)が入力される。マッチング領域算出部2D402は、上記3つのブロックのうちの1つとして、補間画素の生成位置の3つ下のライン上の複数の画素からなる領域を設定する。そして、マッチング領域算出部2D402は、設定したブロック内の2H遅延信号D1の画素値を、ブロックマッチング部409に出力する。本実施例では、補間画素の生成位置の3つ下のライン上の画素をd2と記載する。
マッチング領域算出部D403には、1H遅延信号D0(補間画素の生成位置の1つ下
のラインの画素値)が入力される。マッチング領域算出部D403は、上記3つのブロックのうちの1つとして、補間画素の生成位置の1つ下のライン上の複数の画素からなる領域を設定する。そして、マッチング領域算出部D403は、設定したブロック内の1H遅延信号D0の画素値を、ブロックマッチング部409に出力する。即ち、ブロック内の画素値として、画素d(x)の画素値が出力される。
マッチング領域算出部U404には、N−1フィールド遅延信号FD1(補間画素の生成位置の1つ上のラインの画素値)が入力される。マッチング領域算出部U404は、上記3つのブロックのうちの1つとして、補間画素の生成位置の1つ上のライン上の複数の画素からなる領域を設定する。そして、マッチング領域算出部U404は、設定したブロック内のN−1フィールド遅延信号FD1の画素値を、ブロックマッチング部409に出力する。即ち、ブロック内の画素値として、画素u(x)の画素値が出力される。
The matching area calculation unit 2D402, the matching area calculation unit D403, and the matching area calculation unit U404 set, for each of a plurality of candidate directions, three blocks on a straight line in that direction passing through the point of interest.
Specifically, a 2H delay signal D1 (a pixel value of a line three lines below the interpolation pixel generation position) is input to the matching region calculation unit 2D402. The matching area calculation unit 2D402 sets, as one of the above three blocks, an area composed of a plurality of pixels on a line three lower than the interpolation pixel generation position. Then, the matching area calculation unit 2D402 outputs the pixel value of the 2H delay signal D1 in the set block to the block matching unit 409. In this embodiment, the pixel on the line three lines below the interpolation pixel generation position is denoted as d2.
The matching area calculation unit D403 receives the 1H delay signal D0 (the pixel value of the line immediately below the interpolation pixel generation position). The matching area calculation unit D403 sets, as one of the three blocks, an area composed of a plurality of pixels on the line immediately below the interpolation pixel generation position. Then, the matching area calculation unit D403 outputs the pixel value of the 1H delay signal D0 in the set block to the block matching unit 409. That is, the pixel value of the pixel d (x) is output as the pixel value in the block.
The matching area calculation unit U404 receives the N-1 field delay signal FD1 (the pixel value of the line immediately above the interpolation pixel generation position). The matching area calculation unit U404 sets, as one of the three blocks, an area composed of a plurality of pixels on a line that is one level above the interpolation pixel generation position. Then, the matching area calculation unit U404 outputs the pixel value of the N−1 field delay signal FD1 in the set block to the block matching unit 409. That is, the pixel value of the pixel u (x) is output as the pixel value in the block.

ブロック(画素u(x)のxの範囲、画素d(x)のxの範囲、及び、画素d2(x)のxの範囲)は、切り出し位置決定部406から出力されたPと、ブロックサイズ決定部408から出力されたBSとから決定される。画素u(x)のxの範囲(水平範囲)、画素d(x)のxの範囲、及び、画素d2(x)のxの範囲は以下の算出式で算出される。
uの範囲:(P−int(BS/2))〜(P+int(BS/2))
dの範囲:(−P−int(BS/2))〜(−P+int(BS/2))
d2の範囲:(−3P−int(BS/2))〜(−3P+int(BS/2))
The blocks (the x range of the pixel u (x), the x range of the pixel d (x), and the x range of the pixel d2 (x)) are P and the block size output from the cutout position determining unit 406. It is determined from the BS output from the determination unit 408. The x range (horizontal range) of the pixel u (x), the x range of the pixel d (x), and the x range of the pixel d2 (x) are calculated by the following calculation formulas.
u range: (P-int (BS / 2)) to (P + int (BS / 2))
Range of d: (-P-int (BS / 2)) to (-P + int (BS / 2))
d2 range: (-3P-int (BS / 2)) to (-3P + int (BS / 2))

次に、本実施例に係る斜め検出部の処理の流れを図13のフローチャートを用いて説明する。
まず、S202で、制御部405が、iの初期化を行い、iの初期値を切り出し位置決定部406に出力する。本実施例では、実施例1と同様に、iの値として、−15〜15の値が設定される。本実施例では、初期値としてi=−15が設定される。
Next, the processing flow of the oblique detection unit according to the present embodiment will be described with reference to the flowchart of FIG.
First, in step S <b> 202, the control unit 405 initializes i and outputs an initial value of i to the cut-out position determination unit 406. In the present embodiment, as in the first embodiment, a value of -15 to 15 is set as the value of i. In this embodiment, i = −15 is set as an initial value.

次に、S203で、切り出し位置決定部406が、実施例1と同様に、切り出し位置Pを決定する。決定された切り出し位置Pは、マッチング領域算出部2D402、マッチング領域算出部D403、マッチング領域算出部U404、マッチング角度決定部407、及び、ブロックマッチング部409に出力される。図14に示すように、マッチング領域算出部2D402、マッチング領域算出部D403、及び、マッチング領域算出部U404において、決定されたPの値から、設定するブロックの中心位置が判断される。具体的には、マッチング領域算出部U404では、画素u(P)の位置が中心位置として判断される。マッチング領域算出部D403では、画素d(−P)の位置が中心位置として判断される。マッチング領域算出部2D402では、画素d(−3P)の位置が中心位置として判断される。画素u(P)は、補間画素の生成位置Hを中心として画素d(−P)と点対称の位置にある。画素d(−3P)は、画素u(P)と画素d(−P)を通る直線上の画素である。図14は、P=−1の例である。   Next, in S <b> 203, the cutout position determination unit 406 determines the cutout position P as in the first embodiment. The determined cutout position P is output to the matching region calculation unit 2D402, the matching region calculation unit D403, the matching region calculation unit U404, the matching angle determination unit 407, and the block matching unit 409. As shown in FIG. 14, the matching area calculation unit 2D402, the matching area calculation unit D403, and the matching area calculation unit U404 determine the center position of the block to be set from the determined P value. Specifically, in the matching area calculation unit U404, the position of the pixel u (P) is determined as the center position. In the matching area calculation unit D403, the position of the pixel d (−P) is determined as the center position. In the matching area calculation unit 2D402, the position of the pixel d (-3P) is determined as the center position. The pixel u (P) is point-symmetric with the pixel d (−P) with the generation position H of the interpolation pixel as the center. The pixel d (−3P) is a pixel on a straight line passing through the pixel u (P) and the pixel d (−P). FIG. 14 is an example of P = -1.

そして、S204で、マッチング角度決定部407が、S203で決定された切り出し位置Pに基づいて、マッチング角度MAを算出する。算出方法は実施例1と同じである。   In step S204, the matching angle determination unit 407 calculates the matching angle MA based on the cutout position P determined in step S203. The calculation method is the same as in the first embodiment.

次に、S205で、ブロックサイズ決定部408が、S204で算出されたマッチング角度MAに基づいて、ブロックサイズBSを算出する。算出方法は実施例1と同じである。算出されたブロックサイズBSは、マッチング領域算出部2D402、マッチング領域算出部D403、マッチング領域算出部U404、及び、ブロックマッチング部409に出力される。その後、マッチング領域算出部2D402、マッチング領域算出部D403、及び、マッチング領域算出部U404において、上記決定されたブロックサイズBSのブロックが設定され、ブロック内の画素値がブロックマッチング部409に出力される。   Next, in S205, the block size determination unit 408 calculates the block size BS based on the matching angle MA calculated in S204. The calculation method is the same as in the first embodiment. The calculated block size BS is output to the matching area calculation unit 2D402, the matching area calculation unit D403, the matching area calculation unit U404, and the block matching unit 409. Thereafter, in the matching region calculation unit 2D402, the matching region calculation unit D403, and the matching region calculation unit U404, the block having the determined block size BS is set, and the pixel value in the block is output to the block matching unit 409. .

そして、S206で、ブロックマッチング部409が、S203で算出された切り出し位置P、S205で算出されたブロックサイズBS、マッチング領域算出部D403とマッチング領域算出部U404から出力された画素値を用いて、ブロックマッチングを行う。具体的には、マッチング領域算出部D403で設定されたブロック内の画素値と、マッチング領域算出部U404で設定されたブロック内の画素値とから、実施例1と同様の方法でSAD値が算出される。本ステップで算出されるSAD値を、upSADと記載する。   In step S206, the block matching unit 409 uses the cutout position P calculated in step S203, the block size BS calculated in step S205, and the pixel values output from the matching region calculation unit D403 and the matching region calculation unit U404. Perform block matching. Specifically, the SAD value is calculated in the same manner as in the first embodiment from the pixel value in the block set by the matching area calculation unit D403 and the pixel value in the block set by the matching area calculation unit U404. Is done. The SAD value calculated in this step is referred to as upSAD.

次に、S207で、ブロックマッチング部409が、S203で算出された切り出し位置P、S205で算出されたブロックサイズBS、マッチング領域算出部2D402とマッチング領域算出部D403から出力された画素値を用いて、ブロックマッチングを行う。具体的には、マッチング領域算出部2D402で設定されたブロック内の画素値と、マッチング領域算出部D403で設定されたブロック内の画素値とから、実施例1と同様の方法でSAD値が算出される。本ステップで算出されるSAD値を、downSADと記載する。   Next, in S207, the block matching unit 409 uses the cutout position P calculated in S203, the block size BS calculated in S205, and the pixel values output from the matching region calculation unit 2D402 and the matching region calculation unit D403. Perform block matching. Specifically, the SAD value is calculated in the same manner as in the first embodiment from the pixel value in the block set by the matching area calculation unit 2D402 and the pixel value in the block set by the matching area calculation unit D403. Is done. The SAD value calculated in this step is referred to as downSAD.

そして、S208で、ブロックマッチング部409がupSADの正規化を行い、S209で、ブロックマッチング部409がdownSADの正規化を行う。正規化を行う理由、及び、正規化の方法は実施例1と同様である。   In step S208, the block matching unit 409 normalizes upSAD. In step S209, the block matching unit 409 normalizes downSAD. The reason for normalization and the normalization method are the same as in the first embodiment.

次に、S210で、制御部405が、i=+15か否かを判定する。i=+15の場合には、制御部405が、複数の候補方向の全てについてSAD値(upSAD、downSAD)が算出されたと判断し、本フローが終了される。i=+15でない場合には、制御部405が、複数の候補方向の全てについてのSAD値の算出が完了していないと判断し、S211でiを1インクリメントする。そして、S203へ処理が戻され、i=+15となるまで、S203〜S209の処理が繰り返される。   Next, in S210, the control unit 405 determines whether i = + 15. In the case of i = + 15, the control unit 405 determines that the SAD values (upSAD, downSAD) have been calculated for all of the plurality of candidate directions, and this flow ends. When i is not +15, the control unit 405 determines that calculation of SAD values for all of the plurality of candidate directions has not been completed, and increments i by 1 in S211. Then, the process returns to S203, and the processes of S203 to S209 are repeated until i = + 15.

ブロックマッチング部409は、上記処理フローにより得られた複数のSAD値をマッチング角度算出部410に出力する。上記複数のSAD値は、P=−15〜+15に対応する31個のupSAD(正規化された値)、及び、P=−15〜+15に対応する31個のdownSAD(正規化された値)である。そして、マッチング角度算出部410は、上記62個のSAD値から、エッジの方向を判定する(詳細は後述する)。   The block matching unit 409 outputs a plurality of SAD values obtained by the above processing flow to the matching angle calculation unit 410. The plurality of SAD values include 31 upSADs corresponding to P = -15 to +15 (normalized values) and 31 downSADs corresponding to P = -15 to +15 (normalized values). It is. Then, the matching angle calculation unit 410 determines the edge direction from the 62 SAD values (details will be described later).

マッチング角度算出部410は、ブロックマッチング部409で算出された31個のupSAD値(正規化された値)と、31個のdownSAD(正規化された値)とから、補間画素の生成位置でのエッジの方向を判定する。そして、マッチング角度算出部410は、判定結果を角度情報ANGLEとして出力する。本実施例では、upSADの最小値に対応するPの値、または、downSADの最小値に対応するPの値が、補間画素の生成位置でのエッジの方向を表す値であると判定される。そして、補間画素の生成位置でのエッジの方向を表す値であると判定されたPの値が、角度情報ANGLEとして出力される。また、upSADの最小値に対応するPの値と、downSADの最小値に対応するPの値との差が所定の閾値以上である場合には、補間画素の生成位置がエッジ部分ではないと判定され、角度情報ANGLEとして0が出力される。   The matching angle calculation unit 410 uses the 31 upSAD values (normalized values) calculated by the block matching unit 409 and the 31 downSADs (normalized values) at the interpolation pixel generation position. Determine the direction of the edge. Then, the matching angle calculation unit 410 outputs the determination result as angle information ANGLE. In this embodiment, it is determined that the value of P corresponding to the minimum value of upSAD or the value of P corresponding to the minimum value of downSAD is a value representing the direction of the edge at the generation position of the interpolation pixel. Then, the value of P determined to be a value representing the direction of the edge at the interpolation pixel generation position is output as angle information ANGLE. Further, when the difference between the value of P corresponding to the minimum value of upSAD and the value of P corresponding to the minimum value of downSAD is equal to or greater than a predetermined threshold, it is determined that the generation position of the interpolation pixel is not an edge portion. Then, 0 is output as the angle information ANGLE.

以下、マッチング角度算出部410の処理について、式を用いて説明する。
まず、以下の式により、upSADの最小値(upSADmin)とdownSADの最小値(downSADmin)が算出される。なお、以下の式において、Pは−15〜15であり、MINは最小値を算出する関数である。
upSADmin=MIN(upSAD(P))
downSADmin=MIN(downSAD(P))
そして、以下の条件式を満たす場合には、upSADmin=upSAD(P)となるPの値、または、downSADmin=downSAD(P)となるPの値が角度情報ANGLEとして出力される。以下の条件式を満たさない場合には、角度情報ANGLEとして0が出力される。なお、以下の式において、upPは、upSADmin=upSAD(P)となるPの値であり、downPは、downSADmin=downSAD(P)となるPの値である。
|upP−downP|<閾値
Hereinafter, the processing of the matching angle calculation unit 410 will be described using equations.
First, the minimum value of upSAD (upSADmin) and the minimum value of downSAD (downSADmin) are calculated by the following equations. In the following formula, P is −15 to 15, and MIN is a function for calculating the minimum value.
upSADmin = MIN (upSAD (P))
downSADmin = MIN (downSAD (P))
When the following conditional expression is satisfied, a value of P satisfying upSADmin = upSAD (P) or a value of P satisfying downSADmin = downSAD (P) is output as the angle information ANGLE. When the following conditional expression is not satisfied, 0 is output as the angle information ANGLE. In the following expression, upP is a value of P that satisfies upSADmin = upSAD (P), and downP is a value of P that satisfies downSADmin = downSAD (P).
| UpP-downP | <Threshold

次に、マッチング角度MAが30°、10°、5°の場合における、SAD値算出の具体例を説明する。マッチング角度MAとブロックサイズBSの関係は、図10に示す関係であるものとする。   Next, a specific example of SAD value calculation when the matching angle MA is 30 °, 10 °, and 5 ° will be described. Assume that the relationship between the matching angle MA and the block size BS is as shown in FIG.

図15(A)を用いて、MA=30°の場合の例について詳細に説明する。
図15(A)の例では、実ラインU、実ラインD、実ラインD2のそれぞれについて、補間ライン上に位置する注目点(補間画素の生成位置)を通り、MA=30°を満たす直線上の画素を中心として、水平方向5画素分の領域がブロックとして設定される。実ラインUに対して設定されたブロックをブロック1D、実ラインDに対して設定されたブロックをブロック2D、実ラインD2に対して設定されたブロックをブロック3Dと記載する。
具体的には、切り出し位置決定部406においてP=−3とされ、マッチング角度決定部407においてMA=30°とされ、ブロックサイズ決定部408においてBS=5とされる。そのため、実ラインUについては、注目点から左側に3画素離れた画素(実ラインU上の画素)を中心とする水平方向5画素分の領域が、ブロック1Dとして設定される。実ラインDについては、注目点から右側に3画素離れた画素(実ラインD上の画素)を中心とする水平方向5画素分の領域が、ブロック2Dとして設定される。実ラインD2については、注目点から右側に9画素離れた画素(実ラインD2上の画素)を中心とする水平方向5画素分の領域が、ブロック3Dとして設定される。ブロック1Dは、注目点を中心としてブロック2Dと点対称の位置にある。ブロック3Dの中心は、ブロック1Dの中心とブロック2Dの中心とを通る直線(注目点を通る直線)上に位置する。
そして、ブロックマッチング部409において、ブロック1Dの画素値と、ブロック2Dの画素値とが比較されて、upSADが算出される。また、ブロック2Dの画素値と、ブロック3Dの画素値とが比較されて、downSADが算出される。
An example in the case of MA = 30 ° will be described in detail with reference to FIG.
In the example of FIG. 15A, each of the real line U, the real line D, and the real line D2 passes through a point of interest (interpolation pixel generation position) located on the interpolation line, and is on a straight line that satisfies MA = 30 °. A region corresponding to 5 pixels in the horizontal direction is set as a block centering on this pixel. A block set for the actual line U is referred to as a block 1D, a block set for the actual line D is referred to as a block 2D, and a block set for the actual line D2 is referred to as a block 3D.
Specifically, P = −3 is set in the cutout position determination unit 406, MA = 30 ° in the matching angle determination unit 407, and BS = 5 in the block size determination unit 408. Therefore, for the real line U, an area corresponding to 5 pixels in the horizontal direction centering on a pixel (pixel on the real line U) that is 3 pixels to the left of the attention point is set as a block 1D. For the real line D, an area corresponding to 5 pixels in the horizontal direction centering on a pixel (pixel on the real line D) that is 3 pixels to the right of the point of interest is set as a block 2D. For the real line D2, a region for five pixels in the horizontal direction centered on a pixel (pixel on the real line D2) that is 9 pixels to the right of the point of interest is set as a block 3D. The block 1D is in a point-symmetric position with respect to the block 2D with the attention point as the center. The center of the block 3D is located on a straight line passing through the center of the block 1D and the center of the block 2D (a straight line passing through the point of interest).
Then, in the block matching unit 409, the pixel value of the block 1D is compared with the pixel value of the block 2D, and upSAD is calculated. Further, the pixel value of the block 2D and the pixel value of the block 3D are compared to calculate the downSAD.

図15(B)を用いて、MA=10°の場合の例について詳細に説明する。
図15(B)の例では、実ラインU、実ラインD、実ラインD2のそれぞれについて、補間ライン上に位置する注目点(補間画素の生成位置)を通り、MA=10°を満たす直線上の画素を中心として、水平方向5画素分の領域がブロックとして設定される。実ラインUに対して設定されたブロックをブロック1E、実ラインDに対して設定されたブロックをブロック2E、実ラインD2に対して設定されたブロックをブロック3Eと記載する。
具体的には、切り出し位置決定部406においてP=−6とされ、マッチング角度決定部407においてMA=10°とされ、ブロックサイズ決定部408においてBS=9とされる。そのため、実ラインUについては、注目点から左側に6画素離れた画素(実ラインU上の画素)を中心とする水平方向9画素分の領域が、ブロック1Eとして設定される。実ラインDについては、注目点から右側に6画素離れた画素(実ラインD上の画素)を中心とする水平方向9画素分の領域が、ブロック2Eとして設定される。実ラインD2については、注目点から右側に18画素離れた画素(実ラインD2上の画素)を中心とする水平方向9画素分の領域が、ブロック3Eとして設定される。ブロック1Eは、注目点を中心としてブロック2Eと点対称の位置にある。ブロック3Eの中心は、ブロック1Eの中心とブロック2Eの中心とを通る直線(注目点を通る直線)上に位置する。
そして、ブロックマッチング部409において、ブロック1Eの画素値と、ブロック2Eの画素値とが比較されて、upSADが算出される。また、ブロック2Eの画素値と、ブロック3Eの画素値とが比較されて、downSADが算出される。実施例1と同様に、算出されたupSADとdownSADが、BS=5に対応する値に正規化される。
An example in the case of MA = 10 ° will be described in detail with reference to FIG.
In the example of FIG. 15B, each of the real line U, the real line D, and the real line D2 passes through a point of interest (interpolation pixel generation position) located on the interpolation line and is on a straight line that satisfies MA = 10 °. A region corresponding to 5 pixels in the horizontal direction is set as a block centering on this pixel. A block set for the actual line U is referred to as a block 1E, a block set for the actual line D is referred to as a block 2E, and a block set for the actual line D2 is referred to as a block 3E.
Specifically, P = −6 is set in the cutout position determination unit 406, MA = 10 ° in the matching angle determination unit 407, and BS = 9 in the block size determination unit 408. Therefore, for the actual line U, an area corresponding to 9 pixels in the horizontal direction centered on a pixel (pixel on the actual line U) that is 6 pixels to the left from the point of interest is set as a block 1E. For the real line D, an area for nine pixels in the horizontal direction centering on a pixel (pixels on the real line D) that is 6 pixels to the right of the point of interest is set as a block 2E. For the real line D2, an area for nine pixels in the horizontal direction centered on a pixel (pixel on the real line D2) that is 18 pixels to the right of the point of interest is set as a block 3E. The block 1E is point-symmetric with the block 2E around the point of interest. The center of the block 3E is located on a straight line passing through the center of the block 1E and the center of the block 2E (a straight line passing through the point of interest).
Then, in the block matching unit 409, the pixel value of the block 1E and the pixel value of the block 2E are compared to calculate upSAD. Further, the pixel value of the block 2E and the pixel value of the block 3E are compared, and downSAD is calculated. Similar to the first embodiment, the calculated upSAD and downSAD are normalized to a value corresponding to BS = 5.

図15(C)を用いて、MA=5°の場合の例について詳細に説明する。
図15(C)の例では、実ラインU、実ラインD、実ラインD2のそれぞれについて、補間ライン上に位置する注目点(補間画素の生成位置)を通り、MA=5°を満たす直線上の画素を中心として、水平方向5画素分の領域がブロックとして設定される。実ラインUに対して設定されたブロックをブロック1F、実ラインDに対して設定されたブロックをブロック2F、実ラインD2に対して設定されたブロックをブロック3Fと記載する。
具体的には、切り出し位置決定部406においてP=−12とされ、マッチング角度決定部407においてMA=5°とされ、ブロックサイズ決定部408においてBS=15とされる。そのため、実ラインUについては、注目点から左側に12画素離れた画素(実ラインU上の画素)を中心とする水平方向15画素分の領域が、ブロック1Fとして設定される。実ラインDについては、注目点から右側に12画素離れた画素(実ラインD上の画素)を中心とする水平方向15画素分の領域が、ブロック2Fとして設定される。実ラインD2については、注目点から右側に36画素離れた画素(実ラインD2上の画素)を中心とする水平方向15画素分の領域が、ブロック3Fとして設定される。ブロック1Fは、注目点を中心としてブロック2Fと点対称の位置にある。ブロック3Fの中心は、ブロック1Fの中心とブロック2Fの中心とを通る直線(注目点を通る直線)上に位置する。
そして、ブロックマッチング部409において、ブロック1Fの画素値と、ブロック2Fの画素値とが比較されて、upSADが算出される。また、ブロック2Fの画素値と、ブロック3Fの画素値とが比較されて、downSADが算出される。実施例1と同様に、算出されたupSADとdownSADは、BS=5に対応する値に正規化される。
An example in the case of MA = 5 ° will be described in detail with reference to FIG.
In the example of FIG. 15C, each of the real line U, the real line D, and the real line D2 passes through a point of interest (interpolation pixel generation position) located on the interpolation line and is on a straight line that satisfies MA = 5 °. A region corresponding to 5 pixels in the horizontal direction is set as a block centering on this pixel. A block set for the actual line U is referred to as a block 1F, a block set for the actual line D is referred to as a block 2F, and a block set for the actual line D2 is referred to as a block 3F.
Specifically, P = −12 is set in the cutout position determination unit 406, MA = 5 ° is set in the matching angle determination unit 407, and BS = 15 is set in the block size determination unit 408. Therefore, for the actual line U, an area for 15 pixels in the horizontal direction centered on a pixel (pixels on the actual line U) 12 pixels to the left of the point of interest is set as a block 1F. For the real line D, an area for 15 pixels in the horizontal direction centering on a pixel 12 pixels away from the target point on the right side (a pixel on the real line D) is set as a block 2F. For the real line D2, a region for 15 pixels in the horizontal direction centered on a pixel (pixel on the real line D2) that is 36 pixels to the right of the point of interest is set as a block 3F. The block 1F is point-symmetric with the block 2F around the point of interest. The center of the block 3F is located on a straight line passing through the center of the block 1F and the center of the block 2F (a straight line passing through the point of interest).
Then, in the block matching unit 409, the pixel value of the block 1F and the pixel value of the block 2F are compared to calculate upSAD. Further, the pixel value of the block 2F and the pixel value of the block 3F are compared to calculate the downSAD. Similar to the first embodiment, the calculated upSAD and downSAD are normalized to a value corresponding to BS = 5.

以上述べたように、本実施例では、1つの候補方向に対して実施例1より多くのブロックが設定され、設定されたブロックを比較してエッジの方向が判定される。それにより、実施例1よりも高精度にエッジの方向を判定することができる。
なお、本実施例では、注目点の上側に1つのブロックを設定し、注目点の下側に2つのブロックを設定する場合の例を示したが、設定するブロックの位置はこれに限らない。例えば、注目点の上側に2つのブロックを設定し、注目点の下側に1つのブロックが設定されてもよい。注目点の上側と下側の一方に3つのブロックが設定されてもよい。具体的には、補間画素の生成位置の上側に隣接する3つの実ラインのそれぞれにブロックが設定されてもよい。
また、3つより多くのブロックが設定されてもよい。例えば、注目点の上側に2つのブロックを設定し、注目点の下側に2つのブロックが設定されてもよい。
As described above, in the present embodiment, more blocks are set for one candidate direction than in the first embodiment, and the edge direction is determined by comparing the set blocks. Thereby, the edge direction can be determined with higher accuracy than in the first embodiment.
In this embodiment, an example is shown in which one block is set above the attention point and two blocks are set below the attention point. However, the position of the block to be set is not limited to this. For example, two blocks may be set above the attention point, and one block may be set below the attention point. Three blocks may be set on either the upper side or the lower side of the attention point. Specifically, a block may be set for each of three actual lines adjacent to the upper side of the interpolation pixel generation position.
Also, more than three blocks may be set. For example, two blocks may be set above the attention point, and two blocks may be set below the attention point.

<実施例3>
以下、本発明の実施例3に係るエッジ方向判定装置、エッジ方向判定装置の制御方法、及び、画像処理装置について、図面を用いて説明する。本実施例では、ブロックの設定位置である直線上(候補方向の直線上)の位置における、所定方向の位置の変化に対する画素値の変化の勾配に応じて、対応する候補方向に対して設定するn個のブロックのサイズを制御する(補正する)例を説明する。本実施例では、上記所定方向が水平方向である場合の例について説明する。なお、実施例1,2と同様の機能や構成については極力説明を省略する。
本実施例に係る画像処理装置の大まかな構成は実施例1(図1)と同様のため、その説明は省略する。
<Example 3>
Hereinafter, an edge direction determination apparatus, an edge direction determination apparatus control method, and an image processing apparatus according to Embodiment 3 of the present invention will be described with reference to the drawings. In the present embodiment, the corresponding candidate direction is set according to the gradient of the change in the pixel value with respect to the change in the position in the predetermined direction at the position on the straight line (on the straight line in the candidate direction) that is the block setting position. An example of controlling (correcting) the size of n blocks will be described. In this embodiment, an example in which the predetermined direction is the horizontal direction will be described. Note that descriptions of functions and configurations similar to those of the first and second embodiments are omitted as much as possible.
Since the general configuration of the image processing apparatus according to the present embodiment is the same as that of the first embodiment (FIG. 1), description thereof is omitted.

本実施例では、斜め検出部の内部構成が実施例1,2と異なる。具体的には、本実施例に係る斜め検出部は、実施例1,2(図4,12)に示す機能部の他に、勾配算出部501とブロックサイズ補正部502を更に有する。図16は、本実施例に係る斜め検出部の内部構成を示すブロック図である。図16は、実施例1に本実施例の特徴である構成を加えた場合の例を示すが、実施例2に本実施例の特徴である構成が加えられてもよい。
以下、図16を用いて、本実施例に係る斜め検出部について説明する。なお、実施例1と同様の機能部には同じ符号を付し、その説明は省略する。
In the present embodiment, the internal configuration of the oblique detection unit is different from those in the first and second embodiments. Specifically, the oblique detection unit according to the present embodiment further includes a gradient calculation unit 501 and a block size correction unit 502 in addition to the functional units shown in the first and second embodiments (FIGS. 4 and 12). FIG. 16 is a block diagram illustrating an internal configuration of the oblique detection unit according to the present embodiment. FIG. 16 shows an example in which the configuration that is the feature of the present embodiment is added to the first embodiment, but the configuration that is the feature of the present embodiment may be added to the second embodiment.
Hereinafter, the oblique detection unit according to the present embodiment will be described with reference to FIG. In addition, the same code | symbol is attached | subjected to the function part similar to Example 1, and the description is abbreviate | omitted.

勾配算出部501は、候補方向毎に、その候補方向に対して設定するn個のブロックのうちの少なくとも1つのブロックについて、上記勾配を算出する。
本実施例では、勾配算出部501には、各マッチング領域算出部(マッチング領域算出部D301とマッチング領域算出部U302)から出力された画素値が入力される。なお、本実施例では、マッチング領域算出部は、マッチング領域算出部で判断されたブロックよりも大きい領域内の画素値を出力する。例えば、マッチング領域算出部D301は、注目点(補間画素の生成位置)の1つ下のラインの全ての画素値を出力する。マッチング領域算出部U302は、注目点の1つ上のラインの全ての画素値を出力する。
そして、勾配算出部501は、設定するn個(2つ)のブロックのそれぞれについて勾配を算出し、2つのブロックについて算出した2つの勾配の代表値を表すフラグ(勾配フラグF)をブロックサイズ補正部502に出力する。
For each candidate direction, the gradient calculation unit 501 calculates the gradient for at least one block among n blocks set for the candidate direction.
In the present embodiment, the pixel value output from each matching region calculation unit (matching region calculation unit D301 and matching region calculation unit U302) is input to the gradient calculation unit 501. In this embodiment, the matching area calculation unit outputs pixel values in an area larger than the block determined by the matching area calculation unit. For example, the matching area calculation unit D301 outputs all the pixel values of the line immediately below the point of interest (interpolation pixel generation position). The matching area calculation unit U302 outputs all the pixel values of the line immediately above the target point.
Then, the gradient calculation unit 501 calculates the gradient for each of the n (two) blocks to be set, and corrects the block size correction for a flag (gradient flag F) indicating the representative value of the two gradients calculated for the two blocks. Output to the unit 502.

勾配算出部501の動作の具体例について、図17を用いて説明する。図17は、P=3の場合の例である。P=3の場合、画素u(P)を中心とするブロック(実ラインU上の画素からなる領域)と、画素d(−P)を中心とするブロック(実ラインD上の画素からなる領域)とが設定される。   A specific example of the operation of the gradient calculation unit 501 will be described with reference to FIG. FIG. 17 is an example in the case of P = 3. In the case of P = 3, a block centered on the pixel u (P) (region consisting of pixels on the actual line U) and a block centered on the pixel d (-P) (region consisting of pixels on the actual line D) ) And are set.

勾配算出部501は、上記2つのブロックのそれぞれについて、以下の式により勾配を算出する。即ち、本実施例では、第1の差と第2の差が算出される。そして、第1の差と第2の差のうち大きい方の差が、勾配として算出される。第1の差は、ブロックの設定位置における画素値と、当該設定位置から左方向に所定距離離れた位置における画素値との差である。第2の差は、ブロックの設定位置における画素値と、当該設定位置から右方向(左方向の反対方向)に所定距離離れた位置における画素値との差である。なお、以下の式において、u(x),d(x)は、その画素の画素値(例えば輝度や色差)を表す。MAXは、最大値を算出する関数である。
[実ラインU上に設定されたブロックについて]
第1の差hedge_u1=|u(P)−u(P−2)|
第2の差hedge_u2=|u(P)−u(P+2)|
勾配hedge_u=MAX(hedge_u1,hedge_u2)
[実ラインD上に設定されたブロックについて]
第1の差hedge_d1=|d(−P)−d(−P−2)|
第2の差hedge_d2=|d(−P)−d(−P+2)|
勾配hedge_d=MAX(hedge_d1,hedge_d2)
なお、上記例は、上記所定距離が2画素分の距離である場合の例であるが、上記所定距離は2画素分の距離に限らない。例えば、上記所定距離は1,3,5画素分の距離であってもよい。
また、勾配の算出方法は上記方法に限らない。例えば、第1の差または第2の差のいずれか一方が勾配として算出されてもよい。垂直方向の位置が互いに等しい、ブロックの設定位置の画素を含む3つ以上の画素の画素値から、最小二乗法などを用いて勾配が算出されてもよい。
The gradient calculation unit 501 calculates the gradient using the following formula for each of the two blocks. That is, in the present embodiment, the first difference and the second difference are calculated. Then, the larger difference between the first difference and the second difference is calculated as the gradient. The first difference is a difference between the pixel value at the set position of the block and the pixel value at a position away from the set position by a predetermined distance in the left direction. The second difference is a difference between the pixel value at the set position of the block and the pixel value at a position away from the set position in the right direction (the opposite direction to the left) by a predetermined distance. In the following expression, u (x) and d (x) represent pixel values (for example, luminance and color difference) of the pixel. MAX is a function for calculating the maximum value.
[Blocks set on the actual line U]
First difference hedge_u1 = | u (P) −u (P−2) |
Second difference hedge_u2 = | u (P) −u (P + 2) |
Gradient hedge_u = MAX (hedge_u1, hedge_u2)
[Block set on actual line D]
First difference hedge_d1 = | d (−P) −d (−P−2) |
Second difference hedge_d2 = | d (−P) −d (−P + 2) |
Gradient hedge_d = MAX (hedge_d1, hedge_d2)
In addition, although the said example is an example in case the said predetermined distance is a distance for 2 pixels, the said predetermined distance is not restricted to the distance for 2 pixels. For example, the predetermined distance may be a distance of 1, 3, 5 pixels.
The gradient calculation method is not limited to the above method. For example, either the first difference or the second difference may be calculated as the gradient. The gradient may be calculated using a least square method or the like from pixel values of three or more pixels including pixels at the set position of the block whose vertical positions are equal to each other.

そして、勾配算出部501は、以下の条件式を満たす場合に、水平方向に対する角度が
大きいエッジ部分である可能性が高いと判断し、勾配フラグF=0を出力する。また、勾配算出部501は、以下の条件式を満たさない場合に、水平方向に対する角度が小さいエッジ部分である可能性が高いと判断し、勾配フラグF=1を出力する。即ち、本実施例では、2つのブロックについて算出した2つの勾配のうち、値が大きいものが代表値とされる。そして、代表値が所定値以上(閾値以上)の場合に勾配フラグF=0とされ、代表値が所定値未満(閾値未満)の場合に勾配フラグF=1とされる。
(hedge_u≧閾値)または(hedge_d≧閾値)
Then, the gradient calculation unit 501 determines that there is a high possibility that the edge portion has a large angle with respect to the horizontal direction when the following conditional expression is satisfied, and outputs a gradient flag F = 0. Further, when the following conditional expression is not satisfied, the gradient calculating unit 501 determines that there is a high possibility that the edge portion has a small angle with respect to the horizontal direction, and outputs a gradient flag F = 1. In other words, in the present embodiment, of the two gradients calculated for the two blocks, the one having a larger value is used as the representative value. The gradient flag F = 0 when the representative value is equal to or greater than the predetermined value (greater than or equal to the threshold value), and the gradient flag F = 1 when the representative value is less than the predetermined value (less than the threshold value).
(Hedge_u ≧ threshold) or (hedge_d ≧ threshold)

ブロックサイズ補正部502は、勾配が大きいときよりも、勾配が小さいときのほうが、水平方向の長さが長くなるように、対応する候補方向に対して設定するn個のブロックのサイズを制御する(補正する)。そして、ブロックサイズ補正部502は、補正後のブロックサイズBS2(ブロックの水平方向の画素数)をブロックマッチング部307に出力する。
本実施例では、ブロックサイズ補正部502は、2つのブロックについて算出した2つの勾配の代表値に基づいて、設定する2つのブロックのサイズを制御する。具体的には、ブロックサイズ補正部502は、勾配フラグF(P)に応じて、位置Pで表される候補方向に対して設定する2つのブロックのサイズを制御する。
The block size correcting unit 502 controls the size of n blocks set for the corresponding candidate direction so that the length in the horizontal direction becomes longer when the gradient is small than when the gradient is large. (to correct). Then, the block size correction unit 502 outputs the corrected block size BS2 (the number of pixels in the horizontal direction of the block) to the block matching unit 307.
In the present embodiment, the block size correction unit 502 controls the sizes of the two blocks to be set based on the representative values of the two gradients calculated for the two blocks. Specifically, the block size correction unit 502 controls the sizes of the two blocks set for the candidate direction represented by the position P according to the gradient flag F (P).

ブロックサイズ補正部502の動作の具体例について図18のフローチャートを用いて説明する。
まず、S302で、ブロックサイズ補正部502が、補正値α,βを算出する。補正値αは、ブロックサイズBSを第2のサイズに変換する補正値である。補正値βは、ブロックサイズBSを第1のサイズに変換する補正値である。第2のサイズは、第1のサイズよりも大きい。補正値α,βは、ブロックサイズBSの値に応じて決まる。例えば、ブロックサイズがX,Y,Z(X<Y<Z)の3種類の値のいずれかであるものとする。そして、第1のサイズがX、第2のサイズがZであるものとする。この場合、α=Z−BS、β=BS−Xにより、αとβが算出される。例えば、BS=Yのとき、α=Z−Y、β=Y−Xとなる。また、BS=Zのとき、α=Z−Z=0、β=Z−Xとなる。BS=Xのとき、α=Z−X=0、β=X−X=0となる。
A specific example of the operation of the block size correction unit 502 will be described with reference to the flowchart of FIG.
First, in S302, the block size correction unit 502 calculates correction values α and β. The correction value α is a correction value for converting the block size BS to the second size. The correction value β is a correction value for converting the block size BS to the first size. The second size is larger than the first size. The correction values α and β are determined according to the value of the block size BS. For example, it is assumed that the block size is one of three values of X, Y, and Z (X <Y <Z). It is assumed that the first size is X and the second size is Z. In this case, α and β are calculated by α = Z−BS and β = BS−X. For example, when BS = Y, α = Z−Y and β = Y−X. Further, when BS = Z, α = Z−Z = 0 and β = Z−X. When BS = X, α = Z−X = 0 and β = XX = 0.

S303で、ブロックサイズ補正部502が、勾配フラグF(P)=1か否かを判定する。F(P)=1である場合には、S304で、ブロックサイズ補正部502が、ブロックサイズBS2として第2のサイズを設定する。S304では、BSにαを加算することによりBS2が算出される。そのため、BS=X,Yのときには、ブロックサイズがZに大きくされる。BS=Zのときには、ブロックサイズはそのままとされる。F(P)=0である場合には、S305で、ブロックサイズ補正部502が、ブロックサイズBS2として第1のサイズを設定する。S305では、BSからβを減算することによりBS2が算出される。即ち、BS=Y,Zのときには、ブロックサイズがXに小さくされる。BS=Xのときには、ブロックサイズはそのままとされる。   In S303, the block size correction unit 502 determines whether or not the gradient flag F (P) = 1. If F (P) = 1, the block size correcting unit 502 sets the second size as the block size BS2 in S304. In S304, BS2 is calculated by adding α to BS. Therefore, when BS = X, Y, the block size is increased to Z. When BS = Z, the block size is left as it is. If F (P) = 0, the block size correction unit 502 sets the first size as the block size BS2 in S305. In S305, BS2 is calculated by subtracting β from BS. That is, when BS = Y, Z, the block size is reduced to X. When BS = X, the block size is left as it is.

ブロックマッチング部307は、BS2に基づいて、入力された複数の画素値からブロック内の画素値を選択し、ブロックマッチングを行う。具体的には、マッチング領域算出部D301から出力された画素値から、画素d(P)を中心とし、ブロックサイズがBS2であるブロック内の画素値が選択される。また、マッチング領域算出部U302から出力された画素値から、画素u(P)を中心とし、ブロックサイズがBS2であるブロック内の画素値が選択される。ブロックマッチングの方法は実施例1と同様のため、説明は省略する。   Based on BS2, the block matching unit 307 selects a pixel value in the block from a plurality of input pixel values, and performs block matching. Specifically, a pixel value in a block having the pixel d (P) as the center and a block size of BS2 is selected from the pixel values output from the matching region calculation unit D301. Further, from the pixel values output from the matching area calculation unit U302, pixel values in a block having the pixel u (P) as a center and a block size of BS2 are selected. Since the block matching method is the same as that of the first embodiment, description thereof is omitted.

以上述べたように、本実施例によれば、ブロックの設定位置である直線上(候補方向の直線上)の位置における、所定方向の位置の変化に対する画素値の変化の勾配に応じて、
対応する候補方向に対して設定するn個のブロックのサイズが制御される。具体的には、勾配が大きいときよりも、勾配が小さいときのほうが、水平方向の長さが長くなるように、対応する候補方向に対して設定するn個のブロックのサイズが制御される。勾配が大きい場合には水平方向に対する角度が大きいエッジ部分である可能性が高く、勾配が小さい場合には水平方向に対する角度が小さいエッジ部分である可能性が高い。そのため、上記構成により、エッジ方向が上記角度の浅い方向である可能性の度合いと、エッジ方向が上記角度の深い方向である可能性の度合いとの両方をより精度良く算出することができ、エッジの方向をより精度良く判定することができる。
As described above, according to the present embodiment, according to the gradient of the change in the pixel value with respect to the change in the position in the predetermined direction at the position on the straight line (on the straight line in the candidate direction) as the block setting position,
The size of n blocks set for the corresponding candidate direction is controlled. Specifically, the size of n blocks set for the corresponding candidate direction is controlled so that the length in the horizontal direction becomes longer when the gradient is small than when the gradient is large. When the gradient is large, there is a high possibility that the edge portion has a large angle with respect to the horizontal direction, and when the gradient is small, there is a high possibility that the edge portion has a small angle with respect to the horizontal direction. Therefore, with the above configuration, both the degree of possibility that the edge direction is a direction with a shallow angle and the degree of possibility that the edge direction is a direction with a deep angle can be calculated with higher accuracy. Can be determined with higher accuracy.

なお、本実施例では、候補方向毎に、複数のブロックのそれぞれについて勾配を算出し、算出した複数の勾配の代表値に基づいてブロックサイズを制御する構成としたが、この構成に限らない。例えば、候補方向毎に、1つのブロックの勾配を算出し、算出した1つの勾配に基づいてブロックサイズが制御されてもよい。また、本実施例では、1つの候補方向に対して設定する全てのブロック(n個のブロックのそれぞれ)について勾配を算出する構成としたが、この構成に限らない。n個のブロックのうちの一部のブロックについて勾配が算出されてもよい。例えば、実施例2のように1つの候補方向に対して3つのブロックが設定される場合には、3つのブロックのうちの1つまたは2つのブロックについて勾配が算出されてもよい。
なお、本実施例では、複数の勾配の代表値が、当該複数の勾配の最大値である場合の例を示したが、代表値はこれに限らない。例えば、代表値は、複数の勾配の最小値、最頻値、平均値などであってもよい。
なお、本実施例では、勾配に基づいて、ブロックサイズが第1のサイズまたは第2のサイズとされる場合の例を示したが、この構成に限らない。例えば、勾配が小さいほど水平方向の長さが長くなるように、ブロックサイズが連続的または段階的に変更されてもよい。
なお、本実施例では、算出した角度に基づいて決定されたブロックサイズを補正する例を示したが、その構成に限らない。例えば、角度の算出、及び、算出した角度に基づくブロックサイズの決定を行わずに、勾配のみに基づいてブロックサイズが決定されてもよい。
In the present embodiment, the gradient is calculated for each of a plurality of blocks for each candidate direction, and the block size is controlled based on the calculated representative values of the plurality of gradients. However, the present invention is not limited to this configuration. For example, the gradient of one block may be calculated for each candidate direction, and the block size may be controlled based on the calculated one gradient. In the present embodiment, the gradient is calculated for all the blocks set for one candidate direction (each of n blocks), but the present invention is not limited to this configuration. The gradient may be calculated for some of the n blocks. For example, when three blocks are set for one candidate direction as in the second embodiment, the gradient may be calculated for one or two of the three blocks.
In this embodiment, the example in which the representative values of the plurality of gradients are the maximum values of the plurality of gradients has been shown, but the representative value is not limited to this. For example, the representative value may be a minimum value, a mode value, an average value, or the like of a plurality of gradients.
In the present embodiment, an example in which the block size is set to the first size or the second size based on the gradient is shown, but the present invention is not limited to this configuration. For example, the block size may be changed continuously or stepwise such that the smaller the gradient, the longer the horizontal length.
In the present embodiment, an example in which the block size determined based on the calculated angle is corrected has been described, but the configuration is not limited thereto. For example, the block size may be determined based only on the gradient without calculating the angle and determining the block size based on the calculated angle.

<実施例4>
以下、本発明の実施例4に係るエッジ方向判定装置、エッジ方向判定装置の制御方法について、図面を用いて説明する。実施例1〜3では、所定方向(ブロックサイズBSを決定する際に用いる角度を定義するための方向;ブロックの長辺の方向)が水平方向である場合の例を示した。本実施例では、所定方向が垂直方向である場合の例を説明する。また、実施例1〜3では、入力画像信号がインターレース画像信号である場合の例を示した。本実施例では、入力画像信号がプログレッシブ画像信号である場合の例を説明する。
本実施例に係る斜め検出部の構成は他の実施例と同様のため、その説明は省略する。
<Example 4>
Hereinafter, an edge direction determination device and an edge direction determination device control method according to Embodiment 4 of the present invention will be described with reference to the drawings. In the first to third embodiments, an example in which the predetermined direction (the direction for defining the angle used when determining the block size BS; the direction of the long side of the block) is the horizontal direction has been described. In this embodiment, an example in which the predetermined direction is the vertical direction will be described. In the first to third embodiments, an example in which the input image signal is an interlaced image signal has been described. In this embodiment, an example in which the input image signal is a progressive image signal will be described.
Since the configuration of the oblique detection unit according to the present embodiment is the same as that of the other embodiments, the description thereof is omitted.

図19(A),(B)に、マッチング領域算出部で設定されるブロックの一例を示す。本実施例では、複数の候補方向のそれぞれについて、注目点を含むブロック(注目ブロック)と、注目点を含まないブロック(参照ブロック)とが設定され、注目ブロックと参照ブロックの間のブロックマッチングが行われるものとする。そして、候補方向毎のブロックマッチングの結果(SAD値)から、注目点におけるエッジの方向が判定される。
図19(A),(B)において、角度MAはマッチング角度である。本実施例では、マッチング角度MAは、候補方向の垂直方向に対する角度である。即ち、マッチング角度MAは、注目ブロックの中心位置と、参照ブロックの中心位置とを通る直線の、垂直方向に対する角度である。
図19(A)は、マッチング角度MAが大きい場合の例あり、図19(B)は、マッチング角度MAが小さい場合の例である。図19(A),(B)において、破線で囲まれた
領域は画素を示す。図19(A),(B)に示すように、マッチング角度MAが大きいときのほうが、マッチング角度MAが小さいときよりも、ブロックの垂直方向の長さが長くされている。具体的には、図19(A)では、ブロックサイズ(ブロックの垂直方向の長さ)は3画素分の長さとされており、図19(B)では、ブロックサイズは5画素分の長さとされている。なお、ブロックサイズは、他の実施例と同様の方法で決定される。なお、ブロックサイズは、3画素分の長さ、5画素分の長さに限らない。
このように、ブロックサイズを制御することにより、他の実施例と同様に、エッジの方向を精度良く判定することが可能となる。
FIGS. 19A and 19B show examples of blocks set by the matching area calculation unit. In this embodiment, for each of a plurality of candidate directions, a block including a target point (a target block) and a block not including a target point (a reference block) are set, and block matching between the target block and the reference block is performed. Shall be done. Then, the edge direction at the point of interest is determined from the block matching result (SAD value) for each candidate direction.
In FIGS. 19A and 19B, the angle MA is a matching angle. In the present embodiment, the matching angle MA is an angle of the candidate direction with respect to the vertical direction. That is, the matching angle MA is an angle with respect to the vertical direction of a straight line passing through the center position of the target block and the center position of the reference block.
FIG. 19A shows an example when the matching angle MA is large, and FIG. 19B shows an example when the matching angle MA is small. In FIGS. 19A and 19B, a region surrounded by a broken line indicates a pixel. As shown in FIGS. 19A and 19B, the vertical length of the block is longer when the matching angle MA is larger than when the matching angle MA is small. Specifically, in FIG. 19A, the block size (the length in the vertical direction of the block) is a length of 3 pixels, and in FIG. 19B, the block size is a length of 5 pixels. Has been. The block size is determined by the same method as in the other embodiments. The block size is not limited to a length of 3 pixels and a length of 5 pixels.
In this way, by controlling the block size, the edge direction can be accurately determined as in the other embodiments.

以上述べたように、本実施例では、垂直方向に対する角度が大きい候補方向について設定するブロックよりも、垂直方向に対する角度が小さい候補方向について設定するブロックのほうが、垂直方向の長さが長くなるように、ブロックのサイズが制御される。それにより、他の実施例と同様に、エッジの方向を精度良く判定することが可能となる。
なお、実施例1〜4では、所定方向が水平方向の場合と、所定方向が垂直方向である場合とを例示したが、所定方向は斜め方向であってもよい。
As described above, in this embodiment, the length in the vertical direction is longer in the block set for the candidate direction having a small angle with respect to the vertical direction than in the block set for the candidate direction having a large angle with respect to the vertical direction. In addition, the block size is controlled. As a result, the edge direction can be accurately determined as in the other embodiments.
In the first to fourth embodiments, the case where the predetermined direction is the horizontal direction and the case where the predetermined direction is the vertical direction are illustrated, but the predetermined direction may be an oblique direction.

301,403 マッチング領域算出部D
302,404 マッチング領域算出部U
304,406 位置決定部
305,407 マッチング角度決定部
306,408 ブロックサイズ決定部
307,409 ブロックマッチング部
308,410 マッチング角度算出部
402 マッチング領域算出部2D
501 勾配算出部
502 ブロックサイズ補正部
301,403 Matching area calculation unit D
302, 404 Matching area calculation unit U
304,406 Position determining unit 305,407 Matching angle determining unit 306,408 Block size determining unit 307,409 Block matching unit 308,410 Matching angle calculating unit 402 Matching region calculating unit 2D
501 Gradient calculation unit 502 Block size correction unit

Claims (13)

画像の注目点におけるエッジの方向を判定するエッジ方向判定装置であって、
エッジの方向の候補である複数の方向のそれぞれについて、注目点を通るその方向の直線上に、同じサイズの領域であるn個(nは2以上の整数)のブロックを設定する設定手段と、
前記複数の方向のそれぞれについて、前記設定手段で設定されたn個のブロック間の画像の類似度を算出し、類似度が最も高い方向を、前記注目点におけるエッジの方向として判定する判定手段と、
を有し、
前記設定手段は、エッジの方向の候補である前記方向毎に、
その方向に対して設定するn個のブロックのうちの少なくとも1つのブロックについて、そのブロックの設定位置である前記直線上の位置における、所定方向の位置の変化に対する画素値の変化の勾配を算出し、
勾配が大きいときよりも、勾配が小さいときのほうが、前記所定方向の長さが長くなるように、前記設定するn個のブロックのサイズを制御する
ことを特徴とするエッジ方向判定装置。
An edge direction determination device that determines the direction of an edge at a point of interest in an image,
For each of a plurality of directions that are edge direction candidates, setting means for setting n (n is an integer of 2 or more) blocks of the same size on a straight line in that direction passing through the point of interest;
Determination means for calculating the image similarity between the n blocks set by the setting means for each of the plurality of directions and determining the direction having the highest similarity as the edge direction at the point of interest; ,
Have
For each of the directions that are candidates for edge directions, the setting means
For at least one of the n blocks set for that direction, the gradient of the change in pixel value with respect to the change in the position in the predetermined direction at the position on the straight line, which is the set position of that block, is calculated. ,
An edge direction determination device that controls the size of the n blocks to be set so that the length in the predetermined direction is longer when the gradient is smaller than when the gradient is large .
前記設定手段は、勾配が所定値以上の場合に、前記設定するn個のブロックのサイズを第1のサイズとし、勾配が前記所定値未満の場合に、前記設定するn個のブロックのサイズを前記第1のサイズよりも大きい第2のサイズとする
ことを特徴とする請求項に記載のエッジ方向判定装置。
The setting means sets the size of the n blocks to be set as a first size when the gradient is greater than or equal to a predetermined value, and sets the size of the n blocks to be set when the gradient is less than the predetermined value. The edge direction determination apparatus according to claim 1 , wherein the second size is larger than the first size.
前記設定手段は、
前記設定するn個のブロックのうちの複数のブロックのそれぞれについて勾配を算出し、
前記複数のブロックについて算出した複数の勾配の代表値に応じて、前記設定するn個のブロックのサイズを制御する
ことを特徴とする請求項1または2に記載のエッジ方向判定装置。
The setting means includes
A gradient is calculated for each of a plurality of blocks among the n blocks to be set,
3. The edge direction determination device according to claim 1, wherein the size of the n blocks to be set is controlled according to representative values of a plurality of gradients calculated for the plurality of blocks.
前記代表値は、前記複数の勾配の最大値である
ことを特徴とする請求項に記載のエッジ方向判定装置。
The edge direction determination device according to claim 3 , wherein the representative value is a maximum value of the plurality of gradients.
前記勾配は、ブロックの設定位置における画素値と、当該設定位置から前記所定方向に所定距離離れた位置における画素値との差、及び、ブロックの設定位置における画素値と、当該設定位置から前記所定方向の反対方向に所定距離離れた位置における画素値との差のうち、大きい方の値である
ことを特徴とする請求項のいずれか1項に記載のエッジ方向判定装置。
The gradient is a difference between a pixel value at a setting position of a block and a pixel value at a position away from the setting position in the predetermined direction by a predetermined distance, a pixel value at a setting position of the block, and the predetermined value from the setting position. of the difference between the pixel value at the position spaced a predetermined distance in the direction opposite to the direction, the edge direction determination apparatus according to any one of claims 1 to 4, characterized in that a larger value.
前記ブロックは、前記所定方向に沿った長辺を有する矩形状の領域である
ことを特徴とする請求項1〜のいずれか1項に記載のエッジ方向判定装置。
The block edge direction determination apparatus according to any one of claims 1 to 5, characterized in that a rectangular region having a long side along the predetermined direction.
インターレース画像信号を補間によりプログレッシブ画像信号に変換する画像処理装置であって、
請求項1〜のいずれか1項に記載のエッジ方向判定装置と、
前記エッジ方向判定装置で判定されたエッジの方向に基づいて、フィールド内補間による補間画素を生成する補間画素生成手段と、
を有することを特徴とする画像処理装置。
An image processing apparatus that converts an interlaced image signal into a progressive image signal by interpolation,
The edge direction determination device according to any one of claims 1 to 6 ,
Interpolation pixel generation means for generating an interpolation pixel by intra-field interpolation based on the edge direction determined by the edge direction determination device;
An image processing apparatus comprising:
画像の注目点におけるエッジの方向を判定するエッジ方向判定装置の制御方法であって、
エッジの方向の候補である複数の方向のそれぞれについて、注目点を通るその方向の直線上に、同じサイズの領域であるn個(nは2以上の整数)のブロックを設定する設定ステップと、
前記複数の方向のそれぞれについて、前記設定ステップで設定されたn個のブロック間の画像の類似度を算出し、類似度が最も高い方向を、前記注目点におけるエッジの方向として判定する判定ステップと、
を有し、
前記設定ステップでは、エッジの方向の候補である前記方向毎に、
その方向に対して設定するn個のブロックのうちの少なくとも1つのブロックについて、そのブロックの設定位置である前記直線上の位置における、所定方向の位置の変化に対する画素値の変化の勾配が算出され、
勾配が大きいときよりも、勾配が小さいときのほうが、前記所定方向の長さが長くなるように、前記設定するn個のブロックのサイズが制御される
ことを特徴とするエッジ方向判定装置の制御方法。
A control method of an edge direction determination device that determines the direction of an edge at a point of interest in an image,
A setting step of setting n (n is an integer of 2 or more) blocks of the same size on a straight line passing through the point of interest for each of a plurality of directions that are edge direction candidates;
A determination step of calculating an image similarity between the n blocks set in the setting step for each of the plurality of directions, and determining a direction having the highest similarity as an edge direction at the point of interest; ,
Have
In the setting step, for each direction that is a candidate for an edge direction,
For at least one of the n blocks set for that direction, the gradient of the change in pixel value with respect to the change in position in the predetermined direction at the position on the straight line, which is the set position of that block, is calculated. ,
Control of the edge direction determination apparatus, wherein the size of the n blocks to be set is controlled so that the length in the predetermined direction becomes longer when the gradient is small than when the gradient is large Method.
前記設定ステップでは、勾配が所定値以上の場合に、前記設定するn個のブロックのサイズが第1のサイズとされ、勾配が前記所定値未満の場合に、前記設定するn個のブロックのサイズが前記第1のサイズよりも大きい第2のサイズとされるIn the setting step, when the gradient is equal to or larger than a predetermined value, the size of the n blocks to be set is set as a first size, and when the gradient is less than the predetermined value, the size of the n blocks to be set is set Is a second size larger than the first size
ことを特徴とする請求項8に記載のエッジ方向判定装置の制御方法。The control method of the edge direction determination apparatus according to claim 8.
前記設定ステップでは、In the setting step,
前記設定するn個のブロックのうちの複数のブロックのそれぞれについて勾配が算出され、A gradient is calculated for each of a plurality of blocks among the n blocks to be set,
前記複数のブロックについて算出した複数の勾配の代表値に応じて、前記設定するn個のブロックのサイズが制御されるThe size of the n blocks to be set is controlled according to the representative values of the plurality of gradients calculated for the plurality of blocks.
ことを特徴とする請求項8または9に記載のエッジ方向判定装置の制御方法。The control method of the edge direction determination apparatus of Claim 8 or 9 characterized by the above-mentioned.
前記代表値は、前記複数の勾配の最大値であるThe representative value is a maximum value of the plurality of gradients.
ことを特徴とする請求項10に記載のエッジ方向判定装置の制御方法。The control method of the edge direction determination apparatus according to claim 10.
前記勾配は、ブロックの設定位置における画素値と、当該設定位置から前記所定方向に所定距離離れた位置における画素値との差、及び、ブロックの設定位置における画素値と、当該設定位置から前記所定方向の反対方向に所定距離離れた位置における画素値との差のうち、大きい方の値であるThe gradient is a difference between a pixel value at a setting position of a block and a pixel value at a position away from the setting position in the predetermined direction by a predetermined distance, a pixel value at a setting position of the block, and the predetermined value from the setting position. The larger of the differences from the pixel value at a position that is a predetermined distance away in the opposite direction
ことを特徴とする請求項8〜11のいずれか1項に記載のエッジ方向判定装置の制御方法。The control method of the edge direction determination apparatus of any one of Claims 8-11 characterized by the above-mentioned.
前記ブロックは、前記所定方向に沿った長辺を有する矩形状の領域であるThe block is a rectangular region having a long side along the predetermined direction.
ことを特徴とする請求項8〜12のいずれか1項に記載のエッジ方向判定装置の制御方法。The control method of the edge direction determination apparatus of any one of Claims 8-12 characterized by the above-mentioned.
JP2012087468A 2012-04-06 2012-04-06 Edge direction determination device, control method of edge direction determination device, and image processing device Expired - Fee Related JP6012230B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012087468A JP6012230B2 (en) 2012-04-06 2012-04-06 Edge direction determination device, control method of edge direction determination device, and image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012087468A JP6012230B2 (en) 2012-04-06 2012-04-06 Edge direction determination device, control method of edge direction determination device, and image processing device

Publications (3)

Publication Number Publication Date
JP2013219490A JP2013219490A (en) 2013-10-24
JP2013219490A5 JP2013219490A5 (en) 2015-05-28
JP6012230B2 true JP6012230B2 (en) 2016-10-25

Family

ID=49591156

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012087468A Expired - Fee Related JP6012230B2 (en) 2012-04-06 2012-04-06 Edge direction determination device, control method of edge direction determination device, and image processing device

Country Status (1)

Country Link
JP (1) JP6012230B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6654798B2 (en) 2014-11-10 2020-02-26 三星ディスプレイ株式會社Samsung Display Co.,Ltd. Image processing apparatus, image processing method, and program
JP6473608B2 (en) * 2014-11-27 2019-02-20 三星ディスプレイ株式會社Samsung Display Co.,Ltd. Image processing apparatus, image processing method, and program

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008263399A (en) * 2007-04-12 2008-10-30 Sony Corp Interpolation signal generating circuit, interpolation signal generating method, program, and video signal processor
JP2009212851A (en) * 2008-03-04 2009-09-17 Canon Inc Scanning line interpolator and its control method

Also Published As

Publication number Publication date
JP2013219490A (en) 2013-10-24

Similar Documents

Publication Publication Date Title
JP4973542B2 (en) Pixel interpolation device and pixel interpolation method
JP2015019204A (en) Image processing device and image processing method
WO2009119347A1 (en) Image processing system, image processing method, and recording medium containing an image processing program
JP5350501B2 (en) Video processing apparatus and video processing method
JP2000253422A (en) Method for generating three-dimensionall image from two-dimensional image
JP6012230B2 (en) Edge direction determination device, control method of edge direction determination device, and image processing device
JP4385077B1 (en) Motion vector detection device and image processing device
US20060222267A1 (en) Method and apparatus for pixel interpolation
JP2017174311A (en) Edge detection device and edge detection method
US9106926B1 (en) Using double confirmation of motion vectors to determine occluded regions in images
JP2008011476A (en) Frame interpolation apparatus and frame interpolation method
JPWO2011067869A1 (en) Image processing apparatus and image processing method
JP5448983B2 (en) Resolution conversion apparatus and method, scanning line interpolation apparatus and method, and video display apparatus and method
WO2017181721A1 (en) Image data processing method and apparatus, player, electronic device, and storage medium
JP4463171B2 (en) Autocorrelation value calculation method, interpolation pixel generation method, apparatus thereof, and program thereof
JP2001094951A (en) Scanning line interpolation method
JP6288920B2 (en) Image processing apparatus and control method thereof
JP2009212851A (en) Scanning line interpolator and its control method
JP2009038578A (en) Method and apparatus for generating image signal
JP3597107B2 (en) Motion vector detection circuit and motion vector detection method
JP4371907B2 (en) Pixel feature determination device, pixel interpolation device, and video signal processing device
JP2014033357A (en) Video signal processor and video signal processing method
JP5441555B2 (en) Video signal processing apparatus and video signal processing method
JP2007097028A (en) Motion vector detecting method and motion vector detecting circuit
WO2020075649A1 (en) Interpolation frame generation device and method

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150406

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150406

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20151225

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160126

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160323

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160920

R151 Written notification of patent or utility model registration

Ref document number: 6012230

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees