JP4975861B2 - Edge direction detection apparatus or method - Google Patents

Edge direction detection apparatus or method Download PDF

Info

Publication number
JP4975861B2
JP4975861B2 JP2010271812A JP2010271812A JP4975861B2 JP 4975861 B2 JP4975861 B2 JP 4975861B2 JP 2010271812 A JP2010271812 A JP 2010271812A JP 2010271812 A JP2010271812 A JP 2010271812A JP 4975861 B2 JP4975861 B2 JP 4975861B2
Authority
JP
Japan
Prior art keywords
pixel
value
edge direction
edge
difference
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2010271812A
Other languages
Japanese (ja)
Other versions
JP2012123479A (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.)
Eizo Nanao Corp
Original Assignee
Eizo Nanao Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Eizo Nanao Corp filed Critical Eizo Nanao Corp
Priority to JP2010271812A priority Critical patent/JP4975861B2/en
Priority to PCT/JP2011/070567 priority patent/WO2012077394A1/en
Publication of JP2012123479A publication Critical patent/JP2012123479A/en
Application granted granted Critical
Publication of JP4975861B2 publication Critical patent/JP4975861B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection

Description

この発明は、エッジ方向検出装置に関し、特に精度の高いエッジ検出が可能なエッジ方向検出に関する。   The present invention relates to an edge direction detection device, and more particularly to edge direction detection capable of highly accurate edge detection.

図1に、画面上に輪郭が存在する場合の各画素のRGB値を示す。超解像、拡大表示における画像補間などの画像処理に用いるために、このような画像における精度の良いエッジ検出が求められている。ここで、「エッジ」とは、画素の輝度値、濃度値、色、模様などの特徴が類似している部分を一つの領域としたとき、上記の特徴が急激に変化している領域と領域との境界をいう。   FIG. 1 shows the RGB values of each pixel when there is a contour on the screen. For use in image processing such as image interpolation in super-resolution and enlarged display, edge detection with high accuracy in such an image is required. Here, “edge” refers to a region and a region in which the above characteristics change suddenly when a region having similar features such as luminance value, density value, color, and pattern of pixels is defined as one region. And the boundary.

特許文献1には、精度向上のために、18画素(2*9)のウインドウの中央に仮想画素を設定し、上下の対応する画素の差分の総計から相関測定値を求めてエッジ検出を行うエッジ検出手法が開示されている。   In Patent Document 1, in order to improve accuracy, a virtual pixel is set at the center of a window of 18 pixels (2 * 9), and edge detection is performed by obtaining a correlation measurement value from the sum of differences between upper and lower corresponding pixels. An edge detection technique is disclosed.

具体的には、図2に示すように、18画素(2*9)のウインドウの中央に仮想画素(i,j)を設定する。垂直方向の相関測定値DIFF_MID は下記式(1)で定義できる。式(1)では、K=-7〜7までの総和を求めているので、前記(2*9)のウインドウをそれぞれ左右に7つずつずらした15の組み合わせの総和が得られる。   Specifically, as shown in FIG. 2, a virtual pixel (i, j) is set in the center of an 18 pixel (2 * 9) window. The correlation measurement value DIFF_MID in the vertical direction can be defined by the following equation (1). In equation (1), the sum total of K = −7 to 7 is obtained, so the sum total of 15 combinations obtained by shifting the window of (2 * 9) by 7 to the left and right is obtained.

ここで、L(y,x)は、画素(y,x)の画素値である。 Here, L (y, x) is a pixel value of the pixel (y, x).

同様にして、斜めの画素の組み合わせについても、図3に示すようにDIFF_L2〜DIFF_L9およびDIFF_R2〜DIFF_R9を求める。   Similarly, DIFF_L2 to DIFF_L9 and DIFF_R2 to DIFF_R9 are obtained for diagonal pixel combinations as shown in FIG.

例えば、DIFF_R7およびDIFF_L7は、式(2)、式(3)で求められる。   For example, DIFF_R7 and DIFF_L7 are obtained by Expression (2) and Expression (3).

かかる相関測定値に基づいて、エッジ検出を行う。   Edge detection is performed based on the correlation measurement value.

また、特許文献2には、12方向においてエッジ検出が可能な手法が開示されている。具体的には、図4に示すように6*6の矩形ウインドウの一部を除去して、24個の画素で構成された略菱形のウインドウについて、仮想の補間画素G0〜G4を設定し、補間画素G0を通る仮想分割線Lを12.5度ピッチで複数本、設定する。具体的には、12方向の分割線が設定される。これらの分割線で分けられた両側の画素の総計を12方向それぞれ求め、総計の差の絶対値に係数をかけた値が、最大となる分割線の方向をエッジ方向であると判断する。   Patent Document 2 discloses a technique capable of edge detection in 12 directions. Specifically, as shown in FIG. 4, a part of a 6 * 6 rectangular window is removed, and virtual interpolation pixels G0 to G4 are set for a substantially diamond-shaped window composed of 24 pixels, A plurality of virtual dividing lines L passing through the interpolation pixel G0 are set at a pitch of 12.5 degrees. Specifically, 12 dividing lines are set. The total of the pixels on both sides divided by these dividing lines is obtained in each of 12 directions, and it is determined that the direction of the dividing line where the value obtained by multiplying the absolute value of the total difference by the coefficient is the edge direction.

特開2004-201308号公報JP 2004-201308 JP 特開2009-94862号公報JP 2009-94862 A

上記特許文献に開示されたエッジ検出方法においては以下のような問題があった。   The edge detection method disclosed in the above patent document has the following problems.

特許文献1では、測定値の算出式によってエッジ検出をしているので、実際には9+2*7=23画素の2ライン分の演算が必要であるだけでなく、垂直近辺(45 度〜135 度の間)について同等の精度でエッジ検出するためには、同等のライン数のメモリが必要であり、またそのための演算処理が必要である。   In Patent Document 1, since the edge detection is performed by the calculation formula of the measurement value, not only the calculation for two lines of 9 + 2 * 7 = 23 pixels is actually required, but also the vicinity of the vertical (from 45 degrees to 45 degrees) In order to detect an edge with the same accuracy for between 135 degrees, a memory having the same number of lines is required, and an arithmetic process for that is required.

特許文献2では、仮想のエッジで別れた側の画素の値の総和の絶対差で判断しているので、必要な画素エリアが広い上、特に複雑な部分、市松模様などではエッジ検出が安定しない。   In Patent Document 2, since the determination is based on the absolute difference of the sum of the values of the pixels separated by the virtual edge, the necessary pixel area is wide and the edge detection is not stable particularly in a complicated portion or checkered pattern. .

この発明は、上記問題を解決し、エッジ方向にとらわれずかつ精度の良いエッジ検出が可能なエッジ検出装置またはその方法を提供することを目的とする。   SUMMARY OF THE INVENTION An object of the present invention is to provide an edge detection apparatus or method that solves the above-described problems and that can detect edges with high accuracy without being bound by the edge direction.

(1)本発明にかかるエッジ方向検出装置は、M画素*N画素の矩形領域における所定のエッジ方向候補についてエッジ検出信頼度を演算し、前記エッジ検出信頼度に基づいて前記矩形領域におけるエッジ方向を検出するエッジ方向検出装置であって、A)一方の画素が前記矩形領域の中央画素に隣接する隣接画素であり、他方の画素が前記隣接画素と線分を結んだ場合に当該エッジ方向と当該線分が平行関係となる組み合わせを、前記各エッジ方向について少なくともそれぞれ複数記憶する組み合わせ画素記憶手段、B)指定された矩形領域について、前記組み合わせ画素記憶手段における組み合わせ画素の差分の絶対値を、各エッジ方向について総計した差分総計値をエッジ方向毎に演算する差分総計値演算手段、C)前記組み合わせ画素のうち、前記矩形領域の中央画素に隣接する隣接画素の画素値に基づいて、前記各エッジ方向における代表画素値を演算する中央近傍画素値演算手段、D)前記指定された矩形領域を構成する各画素の値から当該矩形領域における代表画素値を演算する代表画素値演算手段、E)前記各エッジ方向について、中央近傍画素値と前記代表画素値との差分を、中央近傍画素差分値として演算する中央近傍画素差分値演算手段、F)前記各エッジ方向について、各エッジ方向について、前記差分総計値に第1の係数を乗じた値と、前記中央近傍画素差分値に第2の係数を乗じた値の総和が小さいほど高いエッジ検出信頼度を演算するエッジ検出信頼度演算手段、G)前記エッジ検出信頼度が高いエッジ方向が前記矩形領域におけるエッジ方向であると決定する決定手段を備えている。
(1) An edge direction detection apparatus according to the present invention calculates edge detection reliability for a predetermined edge direction candidate in a rectangular area of M pixels * N pixels, and based on the edge detection reliability, the edge direction in the rectangular area A) an edge direction detecting device for detecting A, wherein one pixel is an adjacent pixel adjacent to a central pixel of the rectangular region, and the other pixel forms a line segment with the adjacent pixel. Combination pixel storage means for storing at least a plurality of combinations in which the line segments are in parallel with respect to each edge direction, and B) for the designated rectangular area, the absolute value of the difference between the combination pixels in the combination pixel storage means, A difference total value calculation means for calculating a difference total value totaled for each edge direction for each edge direction; C) the combination pixel , A central neighborhood pixel value calculating means for calculating a representative pixel value in each edge direction based on a pixel value of an adjacent pixel adjacent to the central pixel of the rectangular area, and D) each pixel constituting the designated rectangular area E) a representative pixel value calculating means for calculating a representative pixel value in the rectangular area from the value of E, a center for calculating a difference between the central neighboring pixel value and the representative pixel value as a central neighboring pixel difference value for each edge direction Neighboring pixel difference value calculation means, F) For each edge direction, for each edge direction, a value obtained by multiplying the difference total value by a first coefficient, and a value obtained by multiplying the center neighboring pixel difference value by a second coefficient. G) edge detection reliability calculation means for calculating a higher edge detection reliability as the sum of the two is smaller , and G) determining that the edge direction having the higher edge detection reliability is the edge direction in the rectangular area. Determining means to perform.

このように、前記各エッジ方向について、中央近傍画素値と前記代表画素値との差分を、中央近傍画素差分値として演算し、前記各エッジ方向について、、前記差分総計値に第1の係数を乗じた値と、前記中央近傍画素差分値に第2の係数を乗じた値の総和が小さいほど高いエッジ検出信頼度を演算することにより、信頼度の高いエッジ検出が可能となる。
Thus, for each edge direction, the difference between the central neighborhood pixel value and the representative pixel value is calculated as a central neighborhood pixel difference value, and for each edge direction , the first coefficient is added to the difference total value. By calculating a higher edge detection reliability as the sum of the multiplied value and the value obtained by multiplying the second neighboring coefficient by the center neighboring pixel difference value is smaller, edge detection with higher reliability becomes possible.

(2)本発明にかかるエッジ方向検出装置においては、前記第1、第2の係数は、1である。
(3)本発明にかかるエッジ方向検出装置は、前記組み合わせ画素記憶手段に記憶されるエッジ方向は、前記矩形領域における実在画素を結ぶ線分に平行で且つ、矩形の中央画素を通過する方向である。したがって、実在画素単位を越える補間仮想画素におけるエッジ方向の検出が可能となる。

(2) In the edge direction detection apparatus according to the present invention, the first and second coefficients are 1.
(3) In the edge direction detection apparatus according to the present invention, the edge direction stored in the combination pixel storage unit is a direction parallel to a line segment that connects the existing pixels in the rectangular region and passes through a rectangular central pixel. is there. Accordingly, it is possible to detect the edge direction in the interpolation virtual pixel exceeding the actual pixel unit.

(4)本発明にかかるエッジ方向検出装置は、各エッジ方向における画素の組み合わせは、少なくとも3であり、その中央の重み付け係数を高くしている。したがって、複数の画素の組み合わせを用いるともに、中央近傍の画素に基づいたエッジが検出される。
( 4 ) In the edge direction detection apparatus according to the present invention, the number of combinations of pixels in each edge direction is at least 3, and the weighting coefficient at the center is increased. Accordingly, a combination of a plurality of pixels is used, and an edge based on a pixel near the center is detected.

(5)本発明にかかるエッジ方向検出装置は、M画素*N画素の矩形領域における所定のエッジ方向候補についてエッジ検出信頼度を演算し、前記エッジ検出信頼度に基づいて前記矩形領域におけるエッジ方向を検出するエッジ方向検出装置であって、A)一方の画素が前記矩形領域の中央画素に隣接する隣接画素であり、他方の画素が前記隣接画素と線分を結んだ場合に当該エッジ方向と当該線分が平行関係となる組み合わせを、前記各エッジ方向について少なくともそれぞれ複数記憶する組み合わせ画素記憶手段、B)指定された矩形領域について、前記組み合わせ画素記憶手段における組み合わせ画素の差分の絶対値を、各エッジ方向について総計した差分総計値をエッジ方向毎に演算する差分総計値演算手段、C)前記各エッジ方向について、前記差分総計値が小さいほど高いエッジ検出信頼度を演算するエッジ検出信頼度演算手段、D)前記エッジ検出信頼度が高いエッジ方向が前記矩形領域におけるエッジ方向であると決定する決定手段を備え、E)前記組み合わせ画素記憶手段に記憶された各エッジ方向における画素の組み合わせは、少なくとも3であり、総計する際に、その中央の重み付け係数を高くしている。
( 5 ) The edge direction detection device according to the present invention calculates edge detection reliability for a predetermined edge direction candidate in a rectangular area of M pixels * N pixels, and based on the edge detection reliability, the edge direction in the rectangular area A) an edge direction detecting device for detecting A, wherein one pixel is an adjacent pixel adjacent to a central pixel of the rectangular region, and the other pixel forms a line segment with the adjacent pixel. Combination pixel storage means for storing at least a plurality of combinations in which the line segments are in parallel with respect to each edge direction, and B) for the designated rectangular area, the absolute value of the difference between the combination pixels in the combination pixel storage means, Difference total value calculation means for calculating the difference total value totaled for each edge direction for each edge direction ; C) for each edge direction Edge detection reliability calculation means for calculating a higher edge detection reliability as the difference total value is smaller , and D) a determination means for determining that the edge direction having the higher edge detection reliability is the edge direction in the rectangular area. E) The number of combinations of pixels in each edge direction stored in the combination pixel storage means is at least 3, and the total weighting coefficient is increased when totaling.

このように、複数の画素の組み合わせを用いるともに、中央近傍の画素に基づいたエッジが検出される。   In this way, an edge based on a pixel near the center is detected while using a combination of a plurality of pixels.

(6)本発明にかかるエッジ方向検出装置は、前記矩形領域における水平方向の差分と垂直方向の差分をそれぞれ求めて、水平方向の最小値が閾値よりも小さい場合には垂直方向でないと、垂直方向の最小値が閾値よりも大きい場合には水平方向でないと判断する。したがって、垂直方向または水平方向を構成する画素の組みあわせによる誤検出を防止できる。
( 6 ) The edge direction detection device according to the present invention obtains a horizontal difference and a vertical difference in the rectangular area, respectively, and if the horizontal minimum value is smaller than a threshold value, the vertical direction is not vertical. When the minimum value of the direction is larger than the threshold value, it is determined that the direction is not horizontal. Therefore, it is possible to prevent erroneous detection due to a combination of pixels constituting the vertical direction or the horizontal direction.

(7)本発明にかかるエッジ方向検出装置は、前記矩形領域における第1象限と第3象限を結ぶ正方向、または第2象限と第4象限を結ぶ負方向に隣接する画素の組み合わせについて、差分の総計を正方向および負方向について求め、総計の大きな方向に属するエッジ方向ではないと判断する。したがって、誤検出を防止できる。
(7) The edge direction detection device according to the present invention provides a difference between a combination of adjacent pixels in the positive direction connecting the first quadrant and the third quadrant or the negative direction connecting the second quadrant and the fourth quadrant in the rectangular area. Are obtained in the positive direction and the negative direction, and are determined not to be edge directions belonging to the larger direction. Therefore, erroneous detection can be prevented.

(8)本発明にかかるエッジ方向検出装置においては、前記矩形領域は正方形であり、記組み合わせ画素記憶手段は、前記エッジ方向が、前記正方形の対角線と平行である場合には、前記正方形の縦辺側に位置する組み合わせ、および横辺に位置する組み合わせの双方向を前記組み合わせとして記憶しており、前記差分総計値演算手段は、前記縦辺側に位置する組み合わせ、および横辺に位置する組み合わせの双方の総和を前記差分総計値として演算する。このように、前記組み合わせとして、前記双方向の組み合わせが存在する様な場合でも、正確な検出が可能となる。
(8) In the edge direction detection device according to the present invention, the rectangular area is a square, and the combination pixel storage unit is configured so that, when the edge direction is parallel to the diagonal of the square, A combination located on the side and a combination located on the side are stored as the combination, and the difference total value calculation means is a combination located on the side and a side located on the side. Is calculated as the difference total value. Thus, even when the bidirectional combination exists as the combination, accurate detection is possible.

(9)本発明にかかるエッジ方向検出方法は、M画素*N画素の矩形領域における所定のエッジ方向候補についてエッジ検出信頼度を演算し、前記エッジ検出信頼度に基づいて前記矩形領域におけるエッジ方向を検出するエッジ方向検出方法であって、一方の画素が前記矩形領域の中央画素に隣接する隣接画素であり、他方の画素が前記隣接画素と線分を結んだ場合に当該エッジ方向と当該線分が平行関係となる組み合わせを、前記各エッジ方向について少なくともそれぞれ複数記憶しておき、指定された矩形領域について、前記記憶した組み合わせ画素の差分の絶対値を、各エッジ方向について総計した差分総計値をエッジ方向毎に演算し、前記組み合わせ画素のうち、前記矩形領域の中央画素に隣接する隣接画素の画素値に基づいて、前記各エッジ方向における代表画素値と、前記指定された矩形領域を構成する各画素の値から当該矩形領域における代表画素値との差分を代表画素差分として、各エッジ方向について演算し、各エッジ方向について、前記差分総計値に第1の係数を乗じた値と、前記中央近傍画素差分値に第2の係数を乗じた値の総和が小さいほど高いエッジ検出信頼度を演算する。

(9) In the edge direction detection method according to the present invention, an edge detection reliability is calculated for a predetermined edge direction candidate in a rectangular area of M pixels * N pixels, and an edge direction in the rectangular area is calculated based on the edge detection reliability. The edge direction is detected when one pixel is an adjacent pixel adjacent to the central pixel of the rectangular area and the other pixel forms a line segment with the adjacent pixel. At least a plurality of combinations in which the minutes are in parallel relation are stored in each edge direction, and for the designated rectangular area, the absolute value of the difference between the stored combination pixels is summed up for each edge direction. For each edge direction, and each of the combined pixels is based on the pixel value of an adjacent pixel adjacent to the central pixel of the rectangular area. A representative pixel value in the di-direction, a difference between the representative pixel value in the rectangular area from the value of each pixel constituting the specified rectangular area as a representative pixel difference, calculated for each edge direction for each edge direction, wherein a value obtained by multiplying the first coefficient to the difference sum value, calculates a second higher edge detection signal Yoriyukido sum small value obtained by multiplying a coefficient to the central vicinity pixel difference values.

このように、前記各エッジ方向について、中央近傍画素値と前記代表画素値との差分を、中央近傍画素差分値として演算し、前記各エッジ方向について、前記差分総計値に第1の係数を乗じた値と、前記中央近傍画素差分値に第2の係数を乗じた値の総和が小さいほど高いエッジ検出信頼度の高いエッジ検出が可能となる。
In this way, for each edge direction, the difference between the central neighborhood pixel value and the representative pixel value is calculated as the central neighborhood pixel difference value, and for each edge direction, the difference sum is multiplied by the first coefficient. the value was, the high edge detection first about two sum of values obtained by multiplying the coefficient is less high edge detection signal Yoriyukido made possible the central vicinity pixel difference values.

(11)本発明にかかるエッジ方向判定方法は、1画面の所定領域における所定のエッジ方向候補についてエッジ検出信頼度を演算し、前記エッジ検出信頼度に基づいて前記所定領域におけるエッジ方向を判定するエッジ方向判定方法であって、一方の画素が前記矩形領域の中央画素に隣接する隣接画素であり、他方の画素が前記隣接画素と線分を結んだ場合に当該エッジ方向と当該線分が平行関係となる組み合わせを、前記各エッジ方向について少なくともそれぞれ複数記憶しておき、指定された所定領域について、前記記憶した組み合わせ画素の差分の絶対値を、各エッジ方向について総計した差分総計値をエッジ方向毎に演算し、前記組み合わせ画素のうち、前記所定領域の中央画素に隣接する隣接画素の画素値に基づいて、前記各エッジ方向における代表画素値と、前記指定された所定領域を構成する各画素の値から当該所定領域における代表画素値との差分を代表画素差分として、各エッジ方向について演算し、前記差分総計値に第1の係数を乗じた値と、前記中央近傍画素差分値に第2の係数を乗じた値の総和が小さいエッジ方向を、求めるエッジ方向として判定する。
(11) In the edge direction determination method according to the present invention, edge detection reliability is calculated for a predetermined edge direction candidate in a predetermined area of one screen, and the edge direction in the predetermined area is determined based on the edge detection reliability. In this edge direction determination method, when one pixel is an adjacent pixel adjacent to the central pixel of the rectangular area and the other pixel forms a line segment with the adjacent pixel, the edge direction and the line segment are parallel to each other. At least a plurality of combinations to be related are stored for each edge direction, and the absolute value of the difference of the stored combination pixels is summed for each edge direction with respect to the specified predetermined area. Each edge direction is calculated based on a pixel value of an adjacent pixel adjacent to a central pixel of the predetermined region among the combination pixels. The difference between the representative pixel value in the predetermined direction and the value of each pixel constituting the specified predetermined area is calculated as the representative pixel difference for each edge direction, and the difference total value is An edge direction having a small sum of a value obtained by multiplying a coefficient of 1 and a value obtained by multiplying the center neighboring pixel difference value by a second coefficient is determined as an edge direction to be obtained .

このように、前記各エッジ方向について、中央近傍画素値と前記代表画素値との差分を、中央近傍画素差分値として演算し、前記差分総計値に第1の係数を乗じた値と、前記中央近傍画素差分値に第2の係数を乗じた値の総和が小さいエッジ方向を、求めるエッジ方向として判定することにより、信頼度の高いエッジ検出が可能となる。
Thus, for each edge direction, the difference between the central neighborhood pixel value and the representative pixel value is calculated as the central neighborhood pixel difference value, and the difference total value is multiplied by the first coefficient, and the center By determining an edge direction having a small sum of values obtained by multiplying the neighboring pixel difference value by the second coefficient as an edge direction to be obtained, edge detection with high reliability can be performed.

(12)本発明にかかるエッジ方向判定プログラムは、コンピュータを下記手段として機能させるためのプログラムである。一方の画素が前記矩形領域の中央画素に隣接する隣接画素であり、他方の画素が前記隣接画素と線分を結んだ場合に当該エッジ方向と当該線分が平行関係となる組み合わせを、前記各エッジ方向について少なくともそれぞれ複数記憶する手段、指定された矩形領域について、前記記憶した組み合わせ画素の差分の絶対値を、各エッジ方向について総計した差分総計値をエッジ方向毎に演算する手段、前記組み合わせ画素のうち、前記矩形領域の中央画素に隣接する隣接画素の画素値に基づいて、前記各エッジ方向における代表画素値と、前記指定された矩形領域を構成する各画素の値から当該矩形領域における代表画素値との差分を代表画素差分として、各エッジ方向について演算する手段、前記差分総計値に第1の係数を乗じた値と、前記中央近傍画素差分値に第2の係数を乗じた値の総和が小さいエッジ方向を、求めるエッジ方向として判定する手段。
( 12 ) The edge direction determination program according to the present invention is a program for causing a computer to function as the following means. When each pixel is an adjacent pixel adjacent to the central pixel of the rectangular area, and the other pixel connects the adjacent pixel and the line segment, a combination in which the edge direction and the line segment are in a parallel relationship, Means for storing at least a plurality of edge directions, means for calculating, for each edge direction, an absolute difference value of the stored combination pixels for a specified rectangular area, and calculating a difference total value for each edge direction; Based on the pixel value of the adjacent pixel adjacent to the central pixel of the rectangular area, the representative pixel value in each edge direction and the representative value in the rectangular area from the value of each pixel constituting the designated rectangular area representative pixel difference the difference between the pixel values, means for computing for each edge direction, and a value obtained by multiplying the first coefficient to the difference sum value, wherein Means for determining the sum is small edge direction of the second value obtained by multiplying the coefficients, as the edge direction determined in central vicinity pixel difference values.

このように、前記各エッジ方向について、中央近傍画素値と前記代表画素値との差分を、中央近傍画素差分値として演算し、前記差分総計値に第1の係数を乗じた値と、前記中央近傍画素差分値に第2の係数を乗じた値の総和が小さいエッジ方向を、求めるエッジ方向として判定することにより、信頼度の高いエッジ検出が可能となる。
Thus, for each edge direction, the difference between the central neighborhood pixel value and the representative pixel value is calculated as the central neighborhood pixel difference value, and the difference total value is multiplied by the first coefficient, and the center By determining an edge direction having a small sum of values obtained by multiplying the neighboring pixel difference value by the second coefficient as an edge direction to be obtained, edge detection with high reliability can be performed.

なお、本明細書において「エッジ」とは、画素の輝度値、濃度値、色、模様などの特徴が類似している部分を一つの領域としたとき、上記の特徴が急激に変化している、領域と領域との境界をいう。「エッジ方向検出」とは、このエッジの方向を検出することをいう。また、「組み合わせ画素記憶手段」は実施形態ではエッジ方向検出プログラム26p内における12のエッジ方向についての演算を行う場合にどの画素を用いるのかを特定している部分が該当する。   In this specification, the term “edge” means that the above-mentioned features change abruptly when a region having similar features such as the luminance value, density value, color, and pattern of a pixel is defined as one region. , Refers to the boundary between regions. “Edge direction detection” means detecting the direction of this edge. In the embodiment, the “combined pixel storage unit” corresponds to a part that specifies which pixel is used when performing calculations for 12 edge directions in the edge direction detection program 26p.

画面の一部における画素のRGB値を示す図である。It is a figure which shows the RGB value of the pixel in a part of screen. 特許文献1におけるエッジ検出のウインドウを示す図である。It is a figure which shows the window of edge detection in patent document 1. FIG. 特許文献1におけるエッジ検出方法を説明する為の図である。It is a figure for demonstrating the edge detection method in patent document 1. FIG. 特許文献2におけるエッジ検出方法を説明する為の図である。It is a figure for demonstrating the edge detection method in patent document 2. FIG. エッジ方向検出装置1の機能ブロック図である。2 is a functional block diagram of the edge direction detection device 1. FIG. エッジ方向検出装置1のハード構成図である。It is a hardware block diagram of the edge direction detection apparatus. エッジ方向検出フローチャートである。It is an edge direction detection flowchart. エッジ方向検出装置1にて採用したエッジ方向候補を説明する図である。It is a figure explaining the edge direction candidate employ | adopted with the edge direction detection apparatus 1. FIG. エッジ方向検出装置1にて採用したエッジ方向候補の角度を説明する図である。It is a figure explaining the angle of the edge direction candidate employ | adopted with the edge direction detection apparatus 1. FIG. エッジ方向検出装置1にて採用した4*4のウインドウの画素配置を示す図である。It is a figure which shows the pixel arrangement | positioning of the 4 * 4 window employ | adopted with the edge direction detection apparatus 1. FIG. エッジ方向1、7の場合に演算に用いる画素を示す図である。It is a figure which shows the pixel used for a calculation in the case of the edge directions 1 and 7. FIG. エッジ方向2、6、8、12の場合に演算に用いる画素を示す図である。It is a figure which shows the pixel used for a calculation in the case of edge directions 2, 6, 8, and 12. エッジ方向4,10の場合に演算に用いる画素を示す図である。It is a figure which shows the pixel used for a calculation in the case of the edge directions 4 and 10. FIG. エッジ方向3,5,9,11の場合に演算に用いる画素を示す図である。It is a figure which shows the pixel used for a calculation in edge direction 3,5,9,11. 水平および垂直方向の誤差に対応する場合に演算に用いる画素を示す図である。It is a figure which shows the pixel used for a calculation when respond | corresponding to the error of a horizontal direction and a perpendicular direction. 正負グループを説明ための図である。It is a figure for demonstrating a positive / negative group. 正グループにおける演算に用いる画素を示す図である。It is a figure which shows the pixel used for the calculation in a primary group. 負グループにおける演算に用いる画素を示す図である。It is a figure which shows the pixel used for the calculation in a negative group. 画素配置の一例である。It is an example of pixel arrangement. 画素配置の一例である。It is an example of pixel arrangement. 画素配置の一例である。It is an example of pixel arrangement.

以下、本発明における実施形態について、図面を参照して説明する。   Embodiments of the present invention will be described below with reference to the drawings.

(1.第1実施形態)
(1.1 機能ブロック)
図5に、本発明の1実施形態にかかるエッジ方向検出装置1の機能ブロック図を示す。
(1. First embodiment)
(1.1 Function block)
FIG. 5 is a functional block diagram of the edge direction detection device 1 according to the embodiment of the present invention.

エッジ方向検出装置1は、M画素*N画素の矩形領域における所定のエッジ方向候補についてエッジ検出信頼度を演算し、前記エッジ検出信頼度に基づいて前記矩形領域におけるエッジ方向を検出するエッジ方向検出装置であって、組み合わせ画素記憶手段3、差分総計値演算手段5、中央近傍画素値演算手段7、代表画素値演算手段9、中央近傍画素差分値演算手段11、エッジ検出信頼度演算手段13、および決定手段15を備えている。   The edge direction detection device 1 calculates edge detection reliability for a predetermined edge direction candidate in a rectangular area of M pixels * N pixels, and detects an edge direction in the rectangular area based on the edge detection reliability. A combined pixel storage means 3, a difference total value calculation means 5, a central neighborhood pixel value calculation means 7, a representative pixel value calculation means 9, a central neighborhood pixel difference value calculation means 11, an edge detection reliability calculation means 13, And determining means 15.

組み合わせ画素記憶手段3は、一方の画素が前記矩形領域の中央画素に隣接する隣接画素であり、他方の画素が前記隣接画素と線分を結んだ場合に当該エッジ方向と当該線分が平行関係となる組み合わせを、前記各エッジ方向について少なくともそれぞれ複数記憶する。   The combination pixel storage means 3 is such that when one pixel is an adjacent pixel adjacent to the central pixel of the rectangular area and the other pixel forms a line segment with the adjacent pixel, the edge direction and the line segment are in a parallel relationship. Are stored for each of the edge directions.

差分総計値演算手段5は、指定された矩形領域について、組み合わせ画素記憶手段3における組み合わせ画素の差分の絶対値を、各エッジ方向について総計した差分総計値をエッジ方向毎に演算する。中央近傍画素値演算手段7は、前記組み合わせ画素のうち、前記矩形領域の中央画素に隣接する隣接画素の画素値に基づいて、前記各エッジ方向における代表画素値を演算する。代表画素値演算手段9は、前記指定された矩形領域を構成する各画素の値から当該矩形領域における代表画素値を演算する。中央近傍画素差分値演算手段11は、前記各エッジ方向について、中央近傍画素値と前記代表画素値との差分を、中央近傍画素差分値として演算する。   The difference total value calculation means 5 calculates, for each edge direction, the difference total value obtained by totaling the absolute values of the difference between the combination pixels in the combination pixel storage means 3 in each edge direction for the designated rectangular area. The center neighborhood pixel value calculation means 7 calculates the representative pixel value in each edge direction based on the pixel value of the adjacent pixel adjacent to the center pixel of the rectangular area among the combination pixels. The representative pixel value calculation means 9 calculates the representative pixel value in the rectangular area from the value of each pixel constituting the designated rectangular area. The center neighborhood pixel difference value calculation means 11 calculates the difference between the center neighborhood pixel value and the representative pixel value as the center neighborhood pixel difference value for each edge direction.

エッジ検出信頼度演算手段13は、前記各エッジ方向について、前記中央近傍画素差分値および前記差分総計値に基づいて、エッジ検出信頼度を演算する。   The edge detection reliability calculation means 13 calculates an edge detection reliability for each edge direction based on the central neighborhood pixel difference value and the difference total value.

決定手段15は前記エッジ検出信頼度が高いエッジ方向が前記矩形領域におけるエッジ方向であると決定する。 The determining unit 15 determines that the edge direction having the high edge detection reliability is the edge direction in the rectangular region.

このように、前記各エッジ方向について、中央近傍画素値と代表画素値との差分を、中央近傍画素差分値として演算し、前記各エッジ方向について、前記中央近傍画素差分値および前記差分総計値に基づいて、エッジ検出信頼度を演算することにより、信頼度の高いエッジ検出が可能となる。   Thus, for each edge direction, the difference between the central neighborhood pixel value and the representative pixel value is calculated as the central neighborhood pixel difference value, and for each edge direction, the center neighborhood pixel difference value and the difference total value are calculated. Based on the calculation of the edge detection reliability, edge detection with high reliability can be performed.

(1.2 ハードウェア構成)
図6にエッジ検出装置1のハードウェア構成の一例を示す。エッジ検出装置1は、CPU23、フレームメモリ27、RAM25、フラッシュメモリ26を備えている。フラッシュメモリ26には、エッジ方向検出プログラム26pが記憶されている。エッジ方向検出プログラム26pには、12のエッジ方向について、演算に用いる画素の組み合わせおよびその演算手法が記憶されている。詳細は後述する。
(1.2 Hardware configuration)
FIG. 6 shows an example of the hardware configuration of the edge detection apparatus 1. The edge detection apparatus 1 includes a CPU 23, a frame memory 27, a RAM 25, and a flash memory 26. The flash memory 26 stores an edge direction detection program 26p. The edge direction detection program 26p stores combinations of pixels used for calculation and calculation methods for 12 edge directions. Details will be described later.

RAM25は演算結果等を記憶する。フレームメモリ27は1画面の画像データを保持する。   The RAM 25 stores calculation results and the like. The frame memory 27 holds image data for one screen.

CPU23は、エッジ方向検出プログラム26Pに従い、フレームメモリ27に記憶された画像データに対し、所定の4*4画素のウインドウを設定し、設定した画素についての画素データ(輝度)を読み出し、後述するようなエッジ検出信頼度を求め、結果をRAM26に記憶する。   The CPU 23 sets a predetermined 4 * 4 pixel window for the image data stored in the frame memory 27 in accordance with the edge direction detection program 26P, reads pixel data (luminance) for the set pixel, and will be described later. The edge detection reliability is obtained, and the result is stored in the RAM 26.

なお、本実施形態においては、1つのウインドウにおけるエッジ検出処理についてのみ説明するが、実際は、1画素分ウインドウをずらし、エッジ検出処理が繰り返し行なわれる。   In the present embodiment, only the edge detection process in one window will be described, but actually, the edge detection process is repeatedly performed by shifting the window by one pixel.

(1.3 フローチャートの説明)
図7にフラッシュメモリ25に記憶されたプログラムのフローチャートを示す。CPU23は、演算対象のウインドウが決定されると、当該ウインドウについての値PXを演算する(図7ステップS1)。本実施形態においては4*4画素のウインドウにLPF フィルタを用いて、妥当性検証用の画素の値PXを算出した。具体的には値PXを式(4)で求めた。式(4)のようなフィルタを用いて算出された画素は、平均的な注目位置の画素値を示す。値PXを利用することで、各エッジに沿って生成した仮の補間画素との差によって検出されたエッジの信頼性が判別できる。
(1.3 Explanation of flowchart)
FIG. 7 shows a flowchart of the program stored in the flash memory 25. When the calculation target window is determined, the CPU 23 calculates a value PX for the window (step S1 in FIG. 7). In the present embodiment, the pixel value PX for validity verification is calculated using an LPF filter in a 4 * 4 pixel window. Specifically, the value PX was determined by equation (4). A pixel calculated using a filter such as Expression (4) indicates a pixel value of an average target position. By using the value PX, it is possible to determine the reliability of the detected edge by the difference from the provisional interpolation pixel generated along each edge.

PX=A*WND4* AT ・・・式(4) ?
ここで、行列Aは平行化行列であり、行列ATは行列Aの転置行列である
つぎに、CPU23は、12のエッジ方向についてエッジ検出信頼性基準値SDIF(t)(以下、値SDIF(t)という)を演算する(図7ステップS3)。
PX = A * WND4 * A T・ ・ ・ Formula (4)?
Here, the matrix A is a parallelization matrix, and the matrix AT is a transposed matrix of the matrix A. Next, the CPU 23 performs edge detection reliability reference value SDIF (t) (hereinafter referred to as value SDIF ( t)) (step S3 in FIG. 7).

(1.3.1 エッジ方向)
以下、値SDIF(t)を演算するにあたって必要なエッジ方向について説明する。本実施形態においては、図8A、Bに示すように12のエッジ方向を採用した。
(1.3.1 Edge direction)
Hereinafter, an edge direction necessary for calculating the value SDIF (t) will be described. In this embodiment, twelve edge directions are adopted as shown in FIGS.

図8Aにおいて、4*4画素の中央に仮想画素G1が定義される。なお、同図においてハッチング画素は補間画素を示している。仮想画素G1の周辺には、実画素C2〜C4が存在するので、これらの内側において、半画素の関係となる補間画素G2〜G5を定義する。さらに、実画素C2〜C4の外側にも半画素の関係となる補間画素G12〜G19を定義する。   In FIG. 8A, a virtual pixel G1 is defined at the center of 4 * 4 pixels. In the figure, hatched pixels indicate interpolation pixels. Since there are real pixels C2 to C4 around the virtual pixel G1, interpolation pixels G2 to G5 having a half-pixel relationship are defined inside these pixels. Furthermore, interpolation pixels G12 to G19 having a half-pixel relationship are defined outside the actual pixels C2 to C4.

このようにして定義した補間画素および実画素を用いることにより、仮想画素G1を通るほぼ均等な12方向が定義される。具体的には、図8Aに示すように、補間画素G2と補間画素G4を結ぶ方向1、実画素C12と実画素C16を結ぶ方向2、補間画素G12と補間画素G16を結ぶ方向3、実画素C2と実画素C4を結ぶ方向4、補間画素G13と補間画素G17を結ぶ方向5、実画素C13と実画素C17を結ぶ方向6である。以下同様にして、図8Bに示すように、方向7〜12を定義する。これにより図9に示すように、方向1〜12についての角度が90度、108.4度・・・と定義される。図9に示すように、これらの角度構成は完全に均等ではないがほぼ12等分される。   By using the interpolation pixel and the real pixel defined in this way, approximately equal 12 directions passing through the virtual pixel G1 are defined. Specifically, as shown in FIG. 8A, a direction 1 connecting the interpolation pixel G2 and the interpolation pixel G4, a direction 2 connecting the real pixel C12 and the real pixel C16, a direction 3 connecting the interpolation pixel G12 and the interpolation pixel G16, and the real pixel The direction 4 connects C2 and the real pixel C4, the direction 5 connects the interpolation pixel G13 and the interpolation pixel G17, and the direction 6 connects the real pixel C13 and the real pixel C17. Similarly, directions 7 to 12 are defined as shown in FIG. 8B. As a result, as shown in FIG. 9, the angles with respect to directions 1 to 12 are defined as 90 degrees, 108.4 degrees, and so on. As shown in FIG. 9, these angular configurations are not completely equal, but are divided into approximately 12 equal parts.

前記12方向は、演算する処理としては、エッジ種類1〜4の4種類に分類可能である。エッジ方向1とエッジ方向7は、垂直、水平方向であり、エッジ種類1とする。演算処理の画素が90度配置が異なるだけで同様に求めることができるからである。エッジ方向2、エッジ方向6、エッジ方向8、エッジ方向12は整数精度方向であり、エッジ種類2とする。これらも演算処理としては同様に求めることができる。エッジ方向4、エッジ方向10は整数精度方向であり、エッジ種類3とする。エッジ方向3、エッジ方向5、エッジ方向9、エッジ方向11は半画素精度であり、エッジ種類4とする。これらも水平・垂直の差はあるが同様に求めることができるからである。   The 12 directions can be classified into four types of edge types 1 to 4 as processing to be calculated. Edge direction 1 and edge direction 7 are vertical and horizontal directions, and are of edge type 1. This is because the calculation processing pixels can be obtained in the same manner only by being different by 90 degrees. Edge direction 2, edge direction 6, edge direction 8, and edge direction 12 are integer precision directions and are of edge type 2. These can be obtained in the same manner as the arithmetic processing. Edge direction 4 and edge direction 10 are integer precision directions, and are edge type 3. Edge direction 3, edge direction 5, edge direction 9, and edge direction 11 have half-pixel accuracy and are of edge type 4. This is because these can also be obtained in the same manner, although there is a difference between horizontal and vertical.

各エッジ方向における値SDIF(t)の演算手法に用いる領域例である領域WND4を図10に示す。領域WND4は仮想画素G1を中心として、4*4の実画素で構成されている。以下、実画素を座標で表す。すなわち、一番左上の画素(1,1)、その右横の画素(1,2)・・・最右下の画素(4,4)とする。また、これらの画素値をWND4(1,1)、(1,2)・・・、WND4(4,4)で表す。   FIG. 10 shows a region WND4 that is an example of a region used for the calculation method of the value SDIF (t) in each edge direction. The region WND4 is composed of 4 * 4 real pixels with the virtual pixel G1 as the center. Hereinafter, real pixels are represented by coordinates. That is, the upper left pixel (1, 1), the right pixel (1, 2)... The lower right pixel (4, 4). These pixel values are represented by WND4 (1, 1), (1, 2)..., WND4 (4, 4).

値SDIF(t)は、エッジ方向に沿った画素の差分(SDIF1)と、エッジ方向を用いた注目位置の補間画素および下記PXの差分(SDIF2)との和で求められる。   The value SDIF (t) is obtained by the sum of the pixel difference along the edge direction (SDIF1), the interpolation pixel at the target position using the edge direction, and the difference between the following PX (SDIF2).

(1.3.2 エッジ種類における演算手法)
以下に、上記エッジ種類1〜4における値SDIF(t)の計算方法について詳述する。
(1.3.2 Calculation method for edge types)
Hereinafter, a method of calculating the value SDIF (t) in the edge types 1 to 4 will be described in detail.

(1.3.2.1 エッジ種類1)
図11Aに示すように、エッジ方向1の値SDIF(1)を計算する場合には、画素(1,2)、(2,2)、(3,2)、(4,2)、(1,3)、(2,3)、(3,3)、(4,3)を用いる。
(1.3.2.1 Edge type 1)
As shown in FIG. 11A, when the value SDIF (1) in the edge direction 1 is calculated, the pixels (1, 2), (2, 2), (3, 2), (4, 2), (1 , 3), (2, 3), (3, 3), (4, 3) are used.

上記画素から2列目における差分DIF1(t,2)は、式(4−1)で求められる。   The difference DIF1 (t, 2) in the second column from the pixel is obtained by Expression (4-1).

すなわち、列2における差分DIF1(1,2)は、画素(1,2)の値と画素(2,2)の値の差分の絶対値であり、差分DIF1(2,2)は、画素(2,2)の値と画素(3,2)の値の差分の絶対値であり、差分DIF1(3,2)は、画素(3,2)の値と画素(4,2)の値の差分の絶対値である。   That is, the difference DIF1 (1, 2) in column 2 is the absolute value of the difference between the value of the pixel (1, 2) and the value of the pixel (2, 2), and the difference DIF1 (2, 2) is the pixel ( 2, 2) and the absolute value of the difference between the pixel (3, 2) value, and the difference DIF1 (3, 2) is the difference between the value of the pixel (3, 2) and the value of the pixel (4, 2). The absolute value of the difference.

同様に3列目における差分DIF2(t,3)は、式(4−2)で求められる。   Similarly, the difference DIF2 (t, 3) in the third column is obtained by Expression (4-2).

これらの差分の絶対値の値SDIF1(1)は、式(4−3)で求められる。このように、本実施形態においては、そのまま差分を加算するのではなく、t=2 の際、係数wtを他の場合の2倍としている。これは、注目画素に一番隣接している画素の組み合わせの重みを高くするためであるが、かかる重み付けについてはこれに限定されない。   The absolute value SDIF1 (1) of these differences is obtained by Expression (4-3). Thus, in the present embodiment, the difference is not added as it is, but the coefficient wt is doubled in the other cases at t = 2. This is for increasing the weight of the combination of the pixels closest to the target pixel, but the weight is not limited to this.

つぎに、方向に沿って算出した補間画素参考値VAL(t)を式(5−1)により算出する。   Next, the interpolated pixel reference value VAL (t) calculated along the direction is calculated by Expression (5-1).

具体的には、補間画素参考値VAL(2)として、画素(2,2)と画素(3,2)の平均値が、補間画素参考値VAL(3)として、画素(2,3)と画素(3,3)の平均値が求められる。   Specifically, the average value of the pixel (2, 2) and the pixel (3, 2) is used as the interpolation pixel reference value VAL (2), and the pixel (2, 3) is used as the interpolation pixel reference value VAL (3). An average value of the pixels (3, 3) is obtained.

つぎに、補間画素参考値VAL(2)とPXの差、補間画素参考値VAL(3)と値PXの差の平均値SDIF2を式(6)により算出する。   Next, the difference between the interpolation pixel reference values VAL (2) and PX and the average value SDIF2 of the difference between the interpolation pixel reference value VAL (3) and the value PX are calculated by the equation (6).

もしエッジ方向が正しければ補間画素参考値VAL(t)と値PXの差は小さくなる。   If the edge direction is correct, the difference between the interpolated pixel reference value VAL (t) and the value PX becomes small.

総和SDIF1と平均値SDIF2の和がエッジ方向1の場合の値SDIF(1)となる。   The sum of the sum SDIF1 and the average value SDIF2 is the value SDIF (1) when the edge direction is 1.

SDIF=SDIF1+SDIF2・・・式(7−0)
エッジ方向7の場合は、エッジ方向1の場合と比べて、使用する画素位置がちょうど90度回転した状態であり、図8Bに示すように、エッジ方向7の値SDIF(7)を計算する場合には、画素(2,1)、(2,2)、(2,3)、(2,4)、(3,1)、(3,2)、(3,3)、(3,4)を用いて、同様に演算すればよい。
SDIF = SDIF1 + SDIF2 ... Formula (7-0)
In the case of the edge direction 7, compared to the case of the edge direction 1, the pixel position to be used is just 90 degrees rotated. As shown in FIG. 8B, the value SDIF (7) of the edge direction 7 is calculated. Includes pixels (2,1), (2,2), (2,3), (2,4), (3,1), (3,2), (3,3), (3,4) ) To calculate in the same manner.

他のエッジ方向についても、基本的な考え方は同じであるが、用いる画素が異なり、SDIF(t)の演算手法が具体的に異なるので、以下説明する。   The basic concept is the same for the other edge directions, but the pixel used is different and the SDIF (t) calculation method is specifically different.

(1.3.2.2 エッジ種類2)
図12Aに示すように、エッジ方向2の値SDIF(2)を計算する場合には、画素(1,1)、(4,2)、(1,2)、(4,3)、(1,3)、(4,4)を用いる。
(1.3.2.2 Edge type 2)
As shown in FIG. 12A, when the value SDIF (2) in the edge direction 2 is calculated, the pixels (1, 1), (4, 2), (1, 2), (4, 3), (1 , 3) and (4, 4) are used.

上記画素から差分DIF(t)は、式(7−1)で求められる。   The difference DIF (t) from the pixel is obtained by Expression (7-1).

すなわち、差分DIF(1)は、画素(1,1)の値と画素(4,2)の値の差分の絶対値であり、差分DIF(2)は、画素(1,2)の値と画素(4,3)の値の差分の絶対値であり、差分DIF(3)は、画素(1,3)の値と画素(4,4)の値の差分の絶対値である。   That is, the difference DIF (1) is the absolute value of the difference between the value of the pixel (1, 1) and the value of the pixel (4, 2), and the difference DIF (2) is the value of the pixel (1, 2). The absolute value of the difference between the values of the pixel (4, 3), and the difference DIF (3) is the absolute value of the difference between the value of the pixel (1, 3) and the value of the pixel (4, 4).

これらの差分の絶対値の総和SDIF1は、式(7−2)で求められる。エッジ方向2についても、エッジ方向1と同様の理由で、そのまま差分を加算するのではなく、t=2 の際、係数wtを他の場合の2倍としている。   The sum SDIF1 of the absolute values of these differences is obtained by Expression (7-2). For the edge direction 2 as well, the difference is not added as it is for the same reason as in the edge direction 1, but the coefficient wt is doubled compared to the other cases at t = 2.

つぎに、CPU23は、方向に沿って算出した補間画素参考値VAL(t)を式(8−1)により算出する。   Next, the CPU 23 calculates the interpolated pixel reference value VAL (t) calculated along the direction by the equation (8-1).

具体的には、補間画素参考値VALとして、画素(1,2)と画素(4,3)の平均値が求められる。   Specifically, an average value of the pixel (1, 2) and the pixel (4, 3) is obtained as the interpolation pixel reference value VAL.

つぎに、CPU23は式(8−2)により、補間画素参考値VALとPXの差をSDIF2として算出する。   Next, the CPU 23 calculates the difference between the interpolated pixel reference values VAL and PX as SDIF2 by Expression (8-2).

総和SDIF1と平均値SDIF2の和がエッジ方向2の場合の算出値SDIF(2)となる。   The sum of the sum SDIF1 and the average value SDIF2 is the calculated value SDIF (2) when the edge direction is 2.

SDIF=SDIF1+SDIF2・・・式(7−0)
エッジ方向6、エッジ方向8、エッジ方向12の場合は、図12B〜Dに示すように、エッジ方向2の場合と比べて、使用する画素位置がちょうど90度ずつ回転した状態であり、同様にして算出値SDIFを求めることができる。
SDIF = SDIF1 + SDIF2 ... Formula (7-0)
In the case of the edge direction 6, the edge direction 8, and the edge direction 12, as shown in FIGS. 12B to 12D, compared to the case of the edge direction 2, the pixel position to be used is rotated by 90 degrees. Thus, the calculated value SDIF can be obtained.

(1.3.2.3 エッジ種類4)
エッジ方向4の値SDIF(4)を計算する場合には、水平方向および垂直方向のそれぞれが考えられる。したがって、エッジ連続判定のロバスト性を考慮して、図13Aに示すように、画素(2,1)、(3,2)、(2,2)、(3,3)、(2,3)、(3,4)と、図13Bに示ように、画素(1,2)、(2,3)、(2,2)、(3,3)、(3,2)、(4,3)を用いる。
(1.3.2.3 Edge type 4)
When calculating the value SDIF (4) of the edge direction 4, each of the horizontal direction and the vertical direction can be considered. Therefore, considering the robustness of edge continuity determination, as shown in FIG. 13A, pixels (2,1), (3,2), (2,2), (3,3), (2,3) , (3, 4) and pixels (1, 2), (2, 3), (2, 2), (3, 3), (3, 2), (4, 3) as shown in FIG. ) Is used.

上記画素から水平方向における差分DIFh(t)は、式(9−1)で求められる。 The difference DIF h (t) in the horizontal direction from the pixel is obtained by Expression (9-1).

すなわち、差分DIFh(1)は、画素(2,1)と画素(3,2)の値の差分の絶対値であり、差分DIFh(2)は、画素(2,2)の値と画素(3,3)の値の差分の絶対値であり、差分DIFh(3)は、画素(2,3)の値と画素(3,4)の値の差分の絶対値である。 That is, the difference DIF h (1) is the absolute value of the difference between the pixel (2, 1) and the pixel (3, 2), and the difference DIF h (2) is the value of the pixel (2, 2). The absolute value of the difference between the values of the pixel (3, 3), and the difference DIF h (3) is the absolute value of the difference between the value of the pixel (2, 3) and the value of the pixel (3, 4).

同様に垂直方向における差分DIFV(t)は、式(9−2)で求められる。 Similarly, the difference DIF V (t) in the vertical direction is obtained by Expression (9-2).

水平方向における、差分の絶対値の総和SDIF1hは、式(9−3)で求められる。エッジ方向4についても、エッジ方向1と同様の理由で、そのまま差分を加算するのではなく、t=2 の際、係数wtを他の場合の2倍としている。 The sum SDIF1 h of the absolute values of the differences in the horizontal direction is obtained by Expression (9-3). For the edge direction 4 as well, the difference is not added as it is for the same reason as in the edge direction 1, but the coefficient wt is doubled compared to the other cases at t = 2.

同様に、垂直方向における、差分の絶対値の総和SDIF1vは、式(9−4)で求められる。 Similarly, the sum SDIF1 v of the absolute values of the differences in the vertical direction is obtained by Expression (9-4).

総和SDIF1hと総和SDIF1vの最小値をSDIF1とする(式10−1参照) The minimum value of the sum SDIF1 h and sum SDIF1 v is SDIF1 (see Equation 10-1).

つぎに、方向に沿って算出した補間画素参考値VAL(t)を式(10−2)により算出する。   Next, the interpolated pixel reference value VAL (t) calculated along the direction is calculated by Expression (10-2).

具体的には、補間画素参考値VALとして、画素(2,2)と画素(3,3)の平均値が求めれる。   Specifically, an average value of the pixel (2, 2) and the pixel (3, 3) is obtained as the interpolation pixel reference value VAL.

つぎに、補間画素参考値VALとPXの差の絶対値SDIF2を算出する。   Next, the absolute value SDIF2 of the difference between the interpolation pixel reference values VAL and PX is calculated.

同様に、総和SDIF1と平均値SDIF2の和がエッジ方向1の場合の算出値SDIFとなる。   Similarly, the sum of the sum SDIF1 and the average value SDIF2 is the calculated value SDIF in the case of the edge direction 1.

SDIF=SDIF1+SDIF2・・・式(7−0)
エッジ方向10の場合は、エッジ方向4の場合と比べて、使用する画素位置がちょうど90度回転した状態であり、図13Cに示すように、画素(3,1)、(2,2)、(3,2)、(2,3)、(3,3)、(2,4)と、図13Dに示すように、画素(2,2)、(1,3)、(3,2)、(2,3)、(4,2)、(3,3)を用いて同様に演算すればよい。
SDIF = SDIF1 + SDIF2 ... Formula (7-0)
In the case of the edge direction 10, the pixel position to be used is just 90 degrees rotated as compared with the case of the edge direction 4, and as shown in FIG. 13C, the pixels (3, 1), (2, 2), (3,2), (2,3), (3,3), (2,4) and pixels (2,2), (1,3), (3,2) as shown in FIG. 13D , (2, 3), (4, 2), (3, 3) may be used in the same manner.

(1.3.2.4 エッジ種類3)
図14Aに示すように、エッジ方向3の値SDIF(3)を計算する場合には、画素(2,1)、(4,2)、(1,1)、(3,2)、(2,2)、(4,3)、(1,2)、(3,3)(2,3)、(4,4)、(1,3)、(3,4)を用いる。
(1.3.2.4 Edge type 3)
As shown in FIG. 14A, when the value SDIF (3) in the edge direction 3 is calculated, the pixels (2, 1), (4, 2), (1, 1), (3, 2), (2 , 2), (4, 3), (1, 2), (3, 3) (2, 3), (4, 4), (1, 3), (3,4).

差分DIF1(t)は、式(11−1)で求められる。   The difference DIF1 (t) is obtained by Expression (11-1).

すなわち、差分DIF1(1)は、画素(1,1)の値と画素(3,2)の値の差分の絶対値であり、差分DIF1(2)は、画素(1,2)の値と画素(3,3)の値の差分の絶対値であり、差分DIF1(3)は、画素(1,3)の値と画素(3,4)の値の差分の絶対値である。   That is, the difference DIF1 (1) is the absolute value of the difference between the value of the pixel (1,1) and the value of the pixel (3,2), and the difference DIF1 (2) is the value of the pixel (1,2). The absolute value of the difference between the values of the pixel (3, 3), and the difference DIF1 (3) is the absolute value of the difference between the value of the pixel (1, 3) and the value of the pixel (3, 4).

同様に差分DIF2(t)は、式(11−2)で求められる。   Similarly, the difference DIF2 (t) is obtained by Expression (11-2).

これらの差分の絶対値の総和SDIF1は、式(11−3)で求められる。エッジ方向3についても、エッジ方向1と同様の理由で、そのまま差分を加算するのではなく、t=2 の際、係数wtを他の場合の2倍としている。また、重みをt=2の場合に「1」としているのは、(DIF1+DIF2)とした為である。   The sum SDIF1 of the absolute values of these differences is obtained by Expression (11-3). For the edge direction 3 as well, the difference is not added as it is for the same reason as in the edge direction 1, but the coefficient wt is doubled in other cases at t = 2. The reason why the weight is set to “1” when t = 2 is because (DIF1 + DIF2).

つぎに、方向に沿って算出した補間画素参考値VAL(t)を式(12−1)により算出する。   Next, the interpolated pixel reference value VAL (t) calculated along the direction is calculated by Expression (12-1).

具体的には、補間画素参考値VAL(1)として、画素(1,2)と画素(3,3)の平均値が、補間画素参考値VAL(2)として、画素(2,2)と画素(4,3)の平均値が求められる。   Specifically, the average value of the pixel (1, 2) and the pixel (3, 3) is used as the interpolation pixel reference value VAL (1), and the pixel (2, 2) is used as the interpolation pixel reference value VAL (2). An average value of the pixels (4, 3) is obtained.

つぎに、補間画素参考値VAL(1)とPXの差、補間画素参考値VAL(2)と値PXの差の平均値SDIF2を式(12−2)から算出する。   Next, the difference between the interpolation pixel reference values VAL (1) and PX and the average value SDIF2 of the difference between the interpolation pixel reference value VAL (2) and the value PX are calculated from the equation (12-2).

総和SDIF1と平均値SDIF2の和がエッジ方向1の場合の算出値SDIFとなる。   The sum of the sum SDIF1 and the average value SDIF2 is the calculated value SDIF when the edge direction is 1.

SDIF=SDIF1+SDIF2・・・式(7−0)
なお、エッジ方向5,9,11の場合は、エッジ方向3の場合と比べて、使用する画素位置がちょうど90度回転した状態であり、図14B〜Dに示すように、値SDIFを計算することができる。
SDIF = SDIF1 + SDIF2 ... Formula (7-0)
In the edge directions 5, 9, and 11, the pixel position to be used is just 90 degrees rotated as compared with the edge direction 3, and the value SDIF is calculated as shown in FIGS. be able to.

なお、このエッジ種類については、6の画素組み合わせを採用したが、3以上であればこれに限定されない。または簡易演算をするのであれば、2つであってもよい。すなわち、画素(2,2)と画素(4,3)、画素(1,2)と画素(3,3)の組み合わせから演算するようにしてもよい。   In addition, about this edge type, although the pixel combination of 6 was employ | adopted, if it is 3 or more, it will not be limited to this. Alternatively, two may be used if simple calculation is performed. That is, the calculation may be performed from the combination of the pixel (2, 2) and the pixel (4, 3), and the pixel (1, 2) and the pixel (3, 3).

(1.3.3 正グループPG,負グループNGに属するエッジ方向の決定)
図7ステップS5における判定値HOR、値VERを用いた正グループPG,負グループNGの決定手法について説明する。まず、判定値HOR、値VERの演算手法について説明する。水平方向の値HDIF(y)を式(13−1)から求める。
(1.3.3 Determination of edge directions belonging to positive group PG and negative group NG)
A method for determining the positive group PG and the negative group NG using the determination value HOR and the value VER in step S5 in FIG. 7 will be described. First, a method for calculating the determination value HOR and the value VER will be described. The horizontal value HDIF (y) is obtained from Equation (13-1).

例えば、水平方向の値HDIF(1)は、図15の画素(1,2)と画素(1,3)の差分の絶対値となる。同様にして求めた値HDIF(2)〜値HDIF(4)から、値HDIF(1)〜値HDIF(4)の最大値と最小値を求める。同様にして、垂直方向の値VDIF(x)を式(13−2)から求め、値VDIF(1)〜値VDIF(4)の最大値と最小値を求める。   For example, the horizontal value HDIF (1) is the absolute value of the difference between the pixel (1, 2) and the pixel (1, 3) in FIG. Similarly, the maximum value and the minimum value of the values HDIF (1) to HDIF (4) are obtained from the values HDIF (2) to HDIF (4) obtained in the same manner. Similarly, the value VDIF (x) in the vertical direction is obtained from Expression (13-2), and the maximum value and the minimum value of the values VDIF (1) to VDIF (4) are obtained.

水平および垂直方向の判定値HOR、値VERを式(13−3)、(13−4)から求める。かかる値HOR、値VERは、後述するように、水平および垂直でない場合を判定するのに用いられる。値HORは、垂直方向の値VDIF(x)の最小値が、水平方向の値HDIF(y)の最大値を2倍した値、または、予め定めた閾値TH1を越える場合には、値HOR=1となるが、それ以外は、値HOR=0となる。値VERについても同様である。   The determination value HOR and the value VER in the horizontal and vertical directions are obtained from the equations (13-3) and (13-4). The value HOR and the value VER are used to determine a case where the value is not horizontal or vertical, as will be described later. The value HOR is the value HOR = if the minimum value of the vertical value VDIF (x) exceeds the maximum value of the horizontal value HDIF (y) by two times or exceeds a predetermined threshold TH1. 1 otherwise, the value HOR = 0. The same applies to the value VER.

かかる値HOR、VERを用いて、正グループPGに属するエッジ方向,負グループNGに属するエッジ方向およびそれぞれにおける順位を決定する。具体的には、図16に示すように、エッジ方向の角度が0〜90度の間に属する正エッジグループPGと、エッジ方向の角度が90〜180度の間に属する負グループNGに分けられる。すなわち、正エッジグループPGには、エッジ方向8〜11が、負グループNGには、エッジ方向2〜6が属する。また、水平方向であるエッジ方向1については、値HOR=0の場合は、いずれのグループにも属さない。また、垂直方向であるエッジ方向7についても値VER=0の場合は、いずれのグループにも属さない。 なお、正・負グループ内において、複数のエッジ方向についての値SDIFが同じ場合がある。この場合には、45度又は135度方向に近い方を選択するようにすればよい。45度又は135度エッジの判断用画素が注目画素に近いので遠い画素ペアより信頼性が高いからである。   Using the values HOR and VER, the edge direction belonging to the positive group PG, the edge direction belonging to the negative group NG, and the rank in each are determined. Specifically, as shown in FIG. 16, the edge direction angle is divided into a positive edge group PG belonging to an angle of 0 to 90 degrees and an edge direction angle of 90 to 180 degrees, and a negative group NG belonging to the angle group. . That is, the edge directions 8 to 11 belong to the positive edge group PG, and the edge directions 2 to 6 belong to the negative group NG. Further, the edge direction 1 which is the horizontal direction does not belong to any group when the value HOR = 0. Also, the edge direction 7, which is the vertical direction, does not belong to any group if the value VER = 0. In the positive / negative group, the value SDIF for a plurality of edge directions may be the same. In this case, a direction closer to 45 degrees or 135 degrees may be selected. This is because the 45-degree or 135-degree edge determination pixel is close to the pixel of interest and is therefore more reliable than a distant pixel pair.

(1.3.4 エッジグループ決定)
図7ステップS7におけるエッジグループの決定処理について説明する。
(1.3.4 Edge group determination)
The edge group determination process in step S7 of FIG. 7 will be described.

まず、図17に示すように、45度方向に隣接する画素間の差分PDIF(1)〜(9)を演算する。   First, as shown in FIG. 17, the differences PDIF (1) to (9) between pixels adjacent in the 45 degree direction are calculated.

かかる差分PDIF(1)〜(9)の総計値PSUMを演算する。同様に、差分NDIF(1)〜(9)およびその総計値NSUMを演算する。   The total value PSUM of the differences PDIF (1) to (9) is calculated. Similarly, the differences NDIF (1) to (9) and the total value NSUM are calculated.

つぎに、エッジ方向決定について説明する。本実施形態においては、総計値PSUMと閾値TH3の和が、総計値NSUMより小さいか等しい場合は「GRP=正」と、総計値NSUMと閾値TH3の和が、総計値PSUMより小さいか等しい場合は「GRP=負」といずれでもない場合は、「GRP=0(エッジなし)と判断するようにした。   Next, edge direction determination will be described. In the present embodiment, when the sum of the total value PSUM and the threshold value TH3 is less than or equal to the total value NSUM, “GRP = positive”, and when the sum of the total value NSUM and the threshold value TH3 is less than or equal to the total value PSUM When “GRP = negative” is neither, it is determined that “GRP = 0 (no edge)”.

なお、正負グループを決定するためであれば、総計値PSUMと総計値NSUMを比較して、グループを決定すればよい。ただ、閾値TH3を適切な値に決定することにより、エッジがないような場合(たとえば市松模様)を適切に判断することができる。   In order to determine a positive / negative group, the total value PSUM and the total value NSUM may be compared to determine the group. However, by determining the threshold value TH3 to an appropriate value, it is possible to appropriately determine a case where there is no edge (for example, a checkered pattern).

(1.3.5 エッジ方向決定)
図7ステップS9におけるエッジ方向決定処理について説明する。具体的には、値GRPが正である場合には、正グループで最小値を有するエッジ方向が選択される。値GRPが負である場合には、負グループで最小値を有するエッジ方向が選択される。
(1.3.5 Edge direction determination)
The edge direction determination process in step S9 in FIG. 7 will be described. Specifically, when the value GRP is positive, the edge direction having the minimum value in the positive group is selected. If the value GRP is negative, the edge direction having the minimum value in the negative group is selected.

(1.4 具体例について)
以下、具体的に4*4画素の値を用いて、図7のフローチャートに基づき説明する。例えば、図19に示す矩形データが与えられた場合、CPU23は、値PXを演算する(図7ステップS1)。この場合、PX=74となる。
(1.4 About specific examples)
Hereinafter, a specific description will be given based on the flowchart of FIG. 7 using 4 * 4 pixel values. For example, when the rectangular data shown in FIG. 19 is given, the CPU 23 calculates the value PX (step S1 in FIG. 7). In this case, PX = 74.

つぎに、CPU23は値SDIF(t)を演算する(図7ステップS3)。この場合、SDIF(1)=181;SDIF(2)=400;SDIF(3)=299;SDIF(4)=131;SDIF(5)=59;SDIF(6)=53;SDIF(7)=114;SDIF(8)=324;SDIF(9)=276;SDIF(10)=229;SDIF(11)=372;SDIF(12)=400;となる。   Next, the CPU 23 calculates a value SDIF (t) (step S3 in FIG. 7). In this case, SDIF (1) = 181; SDIF (2) = 400; SDIF (3) = 299; SDIF (4) = 131; SDIF (5) = 59; SDIF (6) = 53; SDIF (7) = 114; SDIF (8) = 324; SDIF (9) = 276; SDIF (10) = 229; SDIF (11) = 372; SDIF (12) = 400.

つぎに、CPU23は値HOR、VERを演算するとともに、値HOR、VERを用いた正グループPG,負グループNGの決定を行う(図7ステップS5)。図19に示す矩形データの場合、値HOR=0;値VER=0;となる。   Next, the CPU 23 calculates values HOR and VER and determines a positive group PG and a negative group NG using the values HOR and VER (step S5 in FIG. 7). In the case of the rectangular data shown in FIG. 19, the value HOR = 0; the value VER = 0;

したがって、この場合、正グループPGは、エッジ方向「10」,「9」,「11」,「8」,「12」であり、負グループNGはエッジ方向「4」,「5」,「3」,「6」,「2」となる。   Therefore, in this case, the positive group PG is the edge directions “10”, “9”, “11”, “8”, “12”, and the negative group NG is the edge directions “4”, “5”, “3”. ”,“ 6 ”,“ 2 ”.

つぎに、CPU23はPSUM、NSUMに基づき、正グループPG、負グループNGのいずれを選択するのかを判断する(図7ステップS7)。図19に示す矩形データの場合、値PSUM=174;値NSUM=414;となるので、値GRPは「負」となる。   Next, the CPU 23 determines which of the positive group PG and the negative group NG is selected based on PSUM and NSUM (step S7 in FIG. 7). In the case of the rectangular data shown in FIG. 19, since the value PSUM = 174; the value NSUM = 414 ;, the value GRP is “negative”.

つぎに、CPU23は決定した負グループNGから、最小値である値SDIF(6)=53をエッジ方向として決定する(ステップS9)。   Next, the CPU 23 determines the minimum value SDIF (6) = 53 as the edge direction from the determined negative group NG (step S9).

このようにして正しいエッジ方向が特定される。   In this way, the correct edge direction is specified.

(1.5 平均値SDIF2の意義について)
本実施形態においては、総和SDIF1に、平均値SDIF2を考慮して値SDIFを決定している。かかる意義について説明する。
(1.5 Significance of mean value SDIF2)
In the present embodiment, the value SDIF is determined for the sum SDIF1 in consideration of the average value SDIF2. Such significance will be described.

図19に示す4*4ウインドウについて、値SDIF1、値SDIF2、値SDIFを演算すると、以下のようになる。   For the 4 * 4 window shown in FIG. 19, the values SDIF1, SDIF2, and SDIF are calculated as follows.

PX=74;
SDIF1(4)=122;SDIF1(5)=39;SDIF1(3)=289;SDIF1(6)=44;SDIF1(2)=392;
SDIF2(4)=9;SDIF2(5)=20;SDIF2(3)=10;SDIF2(6)=9;SDIF2(2)=8;
SDIF(4)=131;SDIF(5)=59;SDIF(3)=299;SDIF(6)=53;SDIF(2)=400;
かかる状況で、もし、値SDIF1だけで、選択すると、値SDIF1(5)が最小値となり、エッジ方向5が選択されてしまう。しかし、この場合、エッジ方向5は誤りであり、正しいのはエッジ方向6である。
PX = 74;
SDIF1 (4) = 122; SDIF1 (5) = 39; SDIF1 (3) = 289; SDIF1 (6) = 44; SDIF1 (2) = 392;
SDIF2 (4) = 9; SDIF2 (5) = 20; SDIF2 (3) = 10; SDIF2 (6) = 9; SDIF2 (2) = 8;
SDIF (4) = 131; SDIF (5) = 59; SDIF (3) = 299; SDIF (6) = 53; SDIF (2) = 400;
In such a situation, if only the value SDIF1 is selected, the value SDIF1 (5) becomes the minimum value, and the edge direction 5 is selected. In this case, however, the edge direction 5 is incorrect, and the edge direction 6 is correct.

これに対して、平均値SDIF2を採用することにより、以下に説明するように、正しいエッジ方向が選択される。この場合、図7ステップS1で算出された値PXは「74」である。エッジ方向5であれば、エッジに沿った補間値は、VAL(1)=(94+112)/2=103;VAL(2)=(54+72)/2=63である。したがって、エッジ方向5の場合、SDIF2=(ABS(103-74)+ABS(63-74))/2=20となる。   On the other hand, by using the average value SDIF2, the correct edge direction is selected as described below. In this case, the value PX calculated in step S1 in FIG. 7 is “74”. If the edge direction is 5, the interpolation value along the edge is VAL (1) = (94 + 112) / 2 = 103; VAL (2) = (54 + 72) / 2 = 63. Therefore, in the case of the edge direction 5, SDIF2 = (ABS (103-74) + ABS (63-74)) / 2 = 20.

一方、エッジ方向6であれば、エッジに沿った補間値は、VAL=(94+72)/2=83であり、SDIF2=ABS(83-74)=9となる。   On the other hand, if the edge direction is 6, the interpolation value along the edge is VAL = (94 + 72) / 2 = 83, and SDIF2 = ABS (83-74) = 9.

このように、平均値SDIF2を採用することにより、より誤りの少ない検出が可能となる。   In this manner, by using the average value SDIF2, detection with fewer errors can be performed.

なお、平均値SDIF2の採用については、必須ではない。   Note that the adoption of the average value SDIF2 is not essential.

また、本実施形態においては、値SDIF1と値SDIF2を単純に加算するようにしたが、係数を用いて、重み付けをするようにしてもよい。   Further, in the present embodiment, the value SDIF1 and the value SDIF2 are simply added, but weighting may be performed using a coefficient.

(1.6 水平及び垂直方向判定の意義)
本実施形態においては、既に説明したように、値HOR、値VERを用いて、これらが「1」でない場合には、水平及び垂直方向ではないと判断する。かかる意義について説明する。
(1.6 Significance of horizontal and vertical judgment)
In the present embodiment, as described above, using the value HOR and the value VER, if these are not “1”, it is determined that the directions are not in the horizontal and vertical directions. Such significance will be described.

図21に示す4*4ウインドウについて、値SDIFを演算すると、SDIF(1) = 135;SDIF(2) = 420;SDIF(3) = 259;SDIF(4) = 98;SDIF(5) = 92;SDIF(6) = 68;SDIF(7) = 49;SDIF(8) = 205;SDIF(9) = 179;SDIF(10) = 154;SDIF(11) = 288;SDIF(12) = 420;となる。   When the value SDIF is calculated for the 4 * 4 window shown in FIG. 21, SDIF (1) = 135; SDIF (2) = 420; SDIF (3) = 259; SDIF (4) = 98; SDIF (5) = 92 SDIF (6) = 68; SDIF (7) = 49; SDIF (8) = 205; SDIF (9) = 179; SDIF (10) = 154; SDIF (11) = 288; SDIF (12) = 420; It becomes.

したがって、このままだと、SDIF(7)であるエッジ方向7が選択される。しかし、正しいのはエッジ方向6である。かかる誤選択が起こるのは以下のような理由による。   Therefore, the edge direction 7 which is SDIF (7) is selected as it is. However, edge direction 6 is correct. Such erroneous selection occurs for the following reason.

水平方向においては、値SDIF(7)の計算には、画素(2,1)〜(2,4)と、画素(3,1)〜(3,4)が用いられる。図21においては画素(3,1)〜(3,4)は、全ての画素値が「115」で同じであるので、SDIFが小さくなってしまう。これに対して、正解であるエッジ方向6の場合は、画素(1,1)と画素(2,4)の組み合わせ、画素(2,1)と画素(3,4)の組み合わせで算出される。この場合、画素(1,1)と画素(2,4)の差分が大きいので、エッジ方向6の値SDIF(6)はエッジ方向7の値SDIF(7)よりも、大きな値となってしまう場合がある。   In the horizontal direction, pixels (2, 1) to (2, 4) and pixels (3, 1) to (3,4) are used to calculate the value SDIF (7). In FIG. 21, since all the pixel values of the pixels (3, 1) to (3,4) are the same as “115”, the SDIF becomes small. On the other hand, in the case of the edge direction 6 which is a correct answer, the calculation is performed by a combination of the pixel (1, 1) and the pixel (2, 4), and a combination of the pixel (2, 1) and the pixel (3,4). . In this case, since the difference between the pixel (1, 1) and the pixel (2, 4) is large, the value SDIF (6) in the edge direction 6 is larger than the value SDIF (7) in the edge direction 7. There is a case.

そこで本実施形態においては、値SDIFとは異なる演算式にて、水平または垂直となる場合を抽出し、かかる条件を満たさない場合には、水平および垂直のエッジ方向を後の判定ステップにて、候補対象外とするようにした。
Therefore, in the present embodiment, the case of being horizontal or vertical is extracted with an arithmetic expression different from the value SDIF, and when the condition is not satisfied, the horizontal and vertical edge directions are determined in a later determination step. The candidate was excluded.

なお、値HOR、値VERを用いた判定処理については、これを補う為に説明したが、値SDIFで判断する場合に限定されるわけではない。   Note that the determination process using the value HOR and the value VER has been described in order to compensate for this, but is not limited to the determination based on the value SDIF.

(1.7 正負グループ判定の意義)
正負グループの判定の意義について説明する。かりに値SDIFだけで、エッジ方向を特定した場合には、当該ウインドウにおけるエッジの幅が小さい場合、エッジの両側の画素値はほぼ同じであるので、誤判定するおそれがある。
(1.7 Significance of positive / negative group judgment)
The significance of positive / negative group determination will be described. If the edge direction is specified only by the value SDIF, if the edge width in the window is small, the pixel values on both sides of the edge are almost the same, so there is a risk of erroneous determination.

例えば、図20に示す4*4ウインドウについて、値SDIFを演算すると、SDIF(1) = 769;SDIF(2) = 124;SDIF(3) = 379;SDIF(4) = 634;SDIF(5) = 379;SDIF(6) = 124;SDIF(7) = 769;SDIF(8) = 634;SDIF(9) = 769;SDIF(10) = 131;SDIF(11) = 769;SDIF(12) = 634となる。また、PX=131;HOR=0;VER=0である。したがって、正負グループ判断をしなければ、エッジ方向2又はエッジ方向6が選択されることとなる。   For example, when the value SDIF is calculated for the 4 * 4 window shown in FIG. 20, SDIF (1) = 769; SDIF (2) = 124; SDIF (3) = 379; SDIF (4) = 634; SDIF (5) = 379; SDIF (6) = 124; SDIF (7) = 769; SDIF (8) = 634; SDIF (9) = 769; SDIF (10) = 131; SDIF (11) = 769; SDIF (12) = 634. Further, PX = 131; HOR = 0; VER = 0. Therefore, if the positive / negative group judgment is not made, the edge direction 2 or the edge direction 6 is selected.

これに対して、図7ステップS7の処理をすることにより、以下のように正しいエッジ方向10が選択される。   On the other hand, by performing the process of step S7 in FIG. 7, the correct edge direction 10 is selected as follows.

この場合、負グループのSDIF(4)、SDIF(5)、SDIF(3)、SDIF(6)、SDIF(2)の中は優先順で最も小さいSDIFはエッジ6である。一方、正グループのSDIF(10)、SDIF(9)、SDIF(11)、SDIF(8)、SDIF(12)の中で、優先順で最も小さいSDIFはエッジ10である。この場合、値PSUM=0;値NSUM=1020;となるのでより値GRPは「正」となる。これにより、SDIF(10)が選択される。   In this case, edge 6 is the smallest SDIF in the priority order among SDIF (4), SDIF (5), SDIF (3), SDIF (6), and SDIF (2) in the negative group. On the other hand, among the SDIF (10), SDIF (9), SDIF (11), SDIF (8), and SDIF (12) of the primary group, the smallest SDIF in the priority order is the edge 10. In this case, the value PSUM = 0; the value NSUM = 1020; thus, the value GRP becomes “positive”. As a result, SDIF (10) is selected.

なお、かかる正負グループの判定処理については、必須ではなく、また、本実施形態においては、上記の値SDIFを採用した場合にこれを補う為に説明したが、値SDIFで判断する場合に限定されるわけではない。   Note that the positive / negative group determination process is not essential, and in the present embodiment, the above-described value SDIF has been described in order to compensate for this. However, the determination process is limited to the value SDIF determination. I don't mean.

(2.他の実施形態)
上記実施形態においては、矩形ウインドウとして4*4である場合について説明したが、これ以外のM*N画素のウインドウについて適用可能である。この場合、構成するウインドウの画素構成に応じて、エッジ方向の候補を適宜採用すればよい。M*N画素のウインドウについては(2(M-1)+2(N-1))個のエッジ方向を定義することが可能である。ただし、全て採用する必要はない。
(2. Other embodiments)
In the above-described embodiment, the case where the rectangular window is 4 * 4 has been described. However, the present invention can be applied to windows of other M * N pixels. In this case, a candidate for the edge direction may be appropriately adopted according to the pixel configuration of the window to be configured. For a window of M * N pixels, it is possible to define (2 (M-1) +2 (N-1)) edge directions. However, it is not necessary to adopt all of them.

本実施形態においては、画素値として輝度を採用した場合について説明したが、エッジ検出するための画素値であればどのようなものであってもよく、例えばRGB値を採用してもよい。   In the present embodiment, the case of using luminance as the pixel value has been described. However, any pixel value may be used as long as the pixel value is used for edge detection. For example, an RGB value may be used.

また、本実施形態においては、画素の値の差分から値SDIF (1)を求めるようにしたが、画素値が、複数のパラメータを用いた特性で表される場合(例えば、RGB値、または、輝度および色彩成分U,V値)には、差分ベクトルまたはベクトルの距離(例えば、色の場合はΔEという距離指標など)を値SDIF (1)としてもよい。値SDIF (2)についても同様である。本実施形態においては、矩形ウインドウとして4*4である場合について説明したので、4*4の中央に仮想画素G1を定義した。しかし、かかる仮想画素は、実画素と重なる位置に定義してもよい。 Further, in the present embodiment, the value SDIF (1) is obtained from the difference between the pixel values. However, when the pixel value is represented by characteristics using a plurality of parameters (for example, RGB values or For the luminance and color components U and V values), a difference vector or a vector distance (for example, a distance index such as ΔE in the case of color) may be the value SDIF (1). The same applies to the value SDIF (2). In the present embodiment, since the case where the rectangular window is 4 * 4 has been described, the virtual pixel G1 is defined in the center of 4 * 4. However, such a virtual pixel may be defined at a position overlapping the actual pixel.

さらに、矩形ウインドウではない所定形状のウインドウであってもよい。   Further, it may be a window having a predetermined shape that is not a rectangular window.

また、上記実施形態においては、中央近傍の画素値を他の2倍とするようにしたが、かかる重み付けについては任意である。   In the above embodiment, the pixel value in the vicinity of the center is doubled, but such weighting is arbitrary.

上記実施形態においては、図5に示す機能を実現するために、CPU23を用い、ソフトウェアによってこれを実現している。しかし、その一部もしくは全てを、ロジック回路などのハードウェアによって実現してもよい。なお、プログラムの一部の処理を、オペレーティングシステム(OS)にさせるようにしてもよい。 In the above embodiment, the CPU 23 is used to realize the function shown in FIG. 5, and this is realized by software. However, some or all of them may be realized by hardware such as a logic circuit. In addition, you may make it make an operating system (OS) process a part of program.

(3.他の発明としての開示)
本件明細書に開示した装置または方法の一部を、下記に述べる装置または方法として把握することもできる。
(3. Disclosure as other inventions)
A part of the apparatus or method disclosed in this specification can be understood as the apparatus or method described below.

(3−1)
所定領域を構成する画素について、複数のエッジ方向候補を記憶しておき、このエッジ方向に位置する画素値に基づいてエッジ方向を検出するエッジ方向検出装置において、
前記エッジ方向は、前記所定領域における実在画素を結ぶ線分に平行で且つ、矩形の中央画素を通過する方向であること、
を特徴とするエッジ方向検出装置。
(3-1)
In an edge direction detection device that stores a plurality of edge direction candidates for pixels constituting a predetermined area and detects the edge direction based on pixel values located in the edge direction,
The edge direction is a direction parallel to a line segment connecting real pixels in the predetermined region and passing through a rectangular central pixel;
An edge direction detection device characterized by the above.

(3−2)
所定領域を構成する画素について、複数のエッジ方向候補を記憶しておき、このエッジ方向に位置する画素値に基づいてエッジ方向を検出するエッジ方向検出装置において、
前記所定領域における水平方向の差分と垂直方向の差分をそれぞれ求めて、
水平方向の最小値が閾値よりも小さい場合には垂直方向でないと、
垂直方向の最小値が閾値よりも大きい場合には水平方向でないと、
判断すること、
を特徴とするエッジ方向検出装置。
(3-2)
In an edge direction detection device that stores a plurality of edge direction candidates for pixels constituting a predetermined area and detects the edge direction based on pixel values located in the edge direction,
Obtain the horizontal difference and the vertical difference in the predetermined area,
If the minimum value in the horizontal direction is smaller than the threshold value,
If the minimum value in the vertical direction is greater than the threshold value,
To judge,
An edge direction detection device characterized by the above.

(3−3)
所定領域を構成する画素について、複数のエッジ方向候補を記憶しておき、このエッジ方向に位置する画素値に基づいてエッジ方向を検出するエッジ方向検出装置において、
前記所定領域における第1象限と第3象限を結ぶ正方向、または第2象限と第4象限を結ぶ負方向に隣接する画素の組み合わせについて、差分の総計を正方向および負方向について求め、総計の大きな方向に属するエッジ方向ではないと判断すること、
を特徴とするエッジ方向検出装置。
(3-3)
In an edge direction detection device that stores a plurality of edge direction candidates for pixels constituting a predetermined area and detects the edge direction based on pixel values located in the edge direction,
For a combination of pixels adjacent in the positive direction connecting the first quadrant and the third quadrant or the negative direction connecting the second quadrant and the fourth quadrant in the predetermined area, a total difference is obtained for the positive direction and the negative direction. Judging that it is not an edge direction belonging to a large direction,
An edge direction detection device characterized by the above.

Claims (11)

M画素*N画素の矩形領域における所定のエッジ方向候補についてエッジ検出信頼度を演算し、前記エッジ検出信頼度に基づいて前記矩形領域におけるエッジ方向を検出するエッジ方向検出装置であって、
一方の画素が前記矩形領域の中央画素に隣接する隣接画素であり、他方の画素が前記隣接画素と線分を結んだ場合に当該エッジ方向と当該線分が平行関係となる組み合わせを、前記各エッジ方向について少なくともそれぞれ複数記憶する組み合わせ画素記憶手段、
指定された矩形領域について、前記組み合わせ画素記憶手段における組み合わせ画素の差分の絶対値を、各エッジ方向について総計した差分総計値をエッジ方向毎に演算する差分総計値演算手段、
前記組み合わせ画素のうち、前記矩形領域の中央画素に隣接する隣接画素の画素値に基づいて、前記各エッジ方向における代表画素値を演算する中央近傍画素値演算手段、
前記指定された矩形領域を構成する各画素の値から当該矩形領域における代表画素値を演算する代表画素値演算手段、
前記各エッジ方向について、中央近傍画素値と前記代表画素値との差分を、中央近傍画素差分値として演算する中央近傍画素差分値演算手段、
前記各エッジ方向について、前記差分総計値に第1の係数を乗じた値と、前記中央近傍画素差分値に第2の係数を乗じた値の総和が小さいほど高いエッジ検出信頼度を演算するエッジ検出信頼度演算手段、
前記エッジ検出信頼度が高いエッジ方向が前記矩形領域におけるエッジ方向であると決定する決定手段、
を備えたエッジ方向検出装置。
An edge direction detection device that calculates edge detection reliability for a predetermined edge direction candidate in a rectangular area of M pixels * N pixels, and detects an edge direction in the rectangular area based on the edge detection reliability,
When each pixel is an adjacent pixel adjacent to the central pixel of the rectangular area, and the other pixel connects the adjacent pixel and the line segment, a combination in which the edge direction and the line segment are in a parallel relationship, Combination pixel storage means for storing at least a plurality of edge directions,
For the specified rectangular area, the difference total value calculation means for calculating the difference total value obtained by summing up the absolute value of the difference between the combination pixels in the combination pixel storage means for each edge direction for each edge direction,
A central neighborhood pixel value calculating means for calculating a representative pixel value in each edge direction based on a pixel value of an adjacent pixel adjacent to a central pixel of the rectangular region among the combined pixels,
Representative pixel value calculating means for calculating a representative pixel value in the rectangular area from the values of the pixels constituting the designated rectangular area;
For each edge direction, a central neighborhood pixel difference value calculating means for calculating a difference between the center neighborhood pixel value and the representative pixel value as a center neighborhood pixel difference value;
For each edge direction, an edge for calculating a higher edge detection reliability as a sum of a value obtained by multiplying the total difference value by a first coefficient and a value obtained by multiplying the center neighboring pixel difference value by a second coefficient is smaller. Detection reliability calculation means,
Determining means for determining that an edge direction having a high edge detection reliability is an edge direction in the rectangular region;
An edge direction detection device comprising:
請求項1のエッジ方向検出装置において、
前記第1、第2の係数は、1であること、
を特徴とするエッジ方向検出装置。
In the edge direction detection apparatus of Claim 1,
The first and second coefficients are 1;
An edge direction detection device characterized by the above.
請求項1または請求項2のエッジ方向検出装置において、
前記組み合わせ画素記憶手段に記憶されるエッジ方向は、前記矩形領域における実在画素を結ぶ線分に平行で且つ、矩形の中央画素を通過する方向であること、
を特徴とするエッジ方向検出装置。
In the edge direction detection device according to claim 1 or 2,
The edge direction stored in the combination pixel storage means is a direction that is parallel to a line segment that connects real pixels in the rectangular region and passes through a rectangular central pixel;
An edge direction detection device characterized by the above.
請求項1〜請求項3のいずれかのエッジ方向検出装置において、
各エッジ方向における画素の組み合わせは、少なくとも3であり、その中央の重み付け係数を高くしたこと、
を特徴とするエッジ方向検出装置。
In the edge direction detection apparatus in any one of Claims 1-3,
The combination of pixels in each edge direction is at least 3, and the weighting coefficient in the center is increased,
An edge direction detection device characterized by the above.
M画素*N画素の矩形領域における所定のエッジ方向候補についてエッジ検出信頼度を演算し、前記エッジ検出信頼度に基づいて前記矩形領域におけるエッジ方向を検出するエッジ方向検出装置であって、
一方の画素が前記矩形領域の中央画素に隣接する隣接画素であり、他方の画素が前記隣接画素と線分を結んだ場合に当該エッジ方向と当該線分が平行関係となる組み合わせを、前記各エッジ方向について少なくともそれぞれ複数記憶する組み合わせ画素記憶手段、
指定された矩形領域について、前記組み合わせ画素記憶手段における組み合わせ画素の差分の絶対値を、各エッジ方向について総計した差分総計値をエッジ方向毎に演算する差分総計値演算手段、
前記各エッジ方向について、前記差分総計値が小さいほど高いエッジ検出信頼度を演算するエッジ検出信頼度演算手段、
前記エッジ検出信頼度が高いエッジ方向が前記矩形領域におけるエッジ方向であると決定する決定手段、
を備え、
前記組み合わせ画素記憶手段に記憶された各エッジ方向における画素の組み合わせは、少なくとも3であり、総計する際に、その中央の重み付け係数を高くしたこと、
を特徴とするエッジ方向検出装置。
An edge direction detection device that calculates edge detection reliability for a predetermined edge direction candidate in a rectangular area of M pixels * N pixels, and detects an edge direction in the rectangular area based on the edge detection reliability,
When each pixel is an adjacent pixel adjacent to the central pixel of the rectangular area, and the other pixel connects the adjacent pixel and the line segment, a combination in which the edge direction and the line segment are in a parallel relationship, Combination pixel storage means for storing at least a plurality of edge directions,
For the specified rectangular area, the difference total value calculation means for calculating the difference total value obtained by summing up the absolute value of the difference between the combination pixels in the combination pixel storage means for each edge direction for each edge direction,
For each edge direction, an edge detection reliability calculation means for calculating a higher edge detection reliability as the difference total value is smaller,
Determining means for determining that an edge direction having a high edge detection reliability is an edge direction in the rectangular region;
With
The combination of pixels in each edge direction stored in the combined pixel storage means is at least 3, and when summing up, the weighting coefficient at the center was increased,
An edge direction detection device characterized by the above.
請求項1〜請求項5のいずれかのエッジ方向検出装置において、
前記矩形領域における水平方向の差分と垂直方向の差分をそれぞれ求めて、
水平方向の最小値が閾値よりも小さい場合には垂直方向でないと、
垂直方向の最小値が閾値よりも大きい場合には水平方向でないと、
判断すること、
を特徴とするエッジ方向検出装置。
In the edge direction detection apparatus in any one of Claims 1-5,
Find the horizontal difference and vertical difference in the rectangular area,
If the minimum value in the horizontal direction is smaller than the threshold value,
If the minimum value in the vertical direction is greater than the threshold value,
To judge,
An edge direction detection device characterized by the above.
請求項1〜請求項6のいずれかのエッジ方向検出装置において、
前記矩形領域における第1象限と第3象限を結ぶ正方向、または第2象限と第4象限を結ぶ負方向に隣接する画素の組み合わせについて、差分の総計を正方向および負方向について求め、総計の大きな方向に属するエッジ方向ではないと判断すること、
を特徴とするエッジ方向検出装置。
In the edge direction detection apparatus in any one of Claims 1-6,
For the combination of pixels adjacent to the positive direction connecting the first quadrant and the third quadrant or the negative direction connecting the second quadrant and the fourth quadrant in the rectangular region, a total difference is obtained for the positive direction and the negative direction. Judging that it is not an edge direction belonging to a large direction,
An edge direction detection device characterized by the above.
請求項1〜請求項7のいずれかのエッジ方向検出装置において、
前記矩形領域は正方形であり、
前記組み合わせ画素記憶手段は、前記エッジ方向が、前記正方形の対角線と平行である場合には、前記正方形の縦辺側に位置する組み合わせ、および横辺に位置する組み合わせの双方向を前記組み合わせとして記憶しており、
前記差分総計値演算手段は、前記縦辺側に位置する組み合わせ、および横辺に位置する組み合わせの双方の総和を前記差分総計値として演算すること、
を特徴とするエッジ方向検出装置。
In the edge direction detection apparatus in any one of Claims 1-7,
The rectangular region is a square;
When the edge direction is parallel to the diagonal of the square, the combination pixel storage unit stores, as the combination, the combination of the combination located on the vertical side of the square and the combination located on the horizontal side. And
The difference total value calculation means calculates the sum of both the combination located on the vertical side and the combination located on the horizontal side as the difference total value;
An edge direction detection device characterized by the above.
M画素*N画素の矩形領域における所定のエッジ方向候補についてエッジ検出信頼度を演算し、前記エッジ検出信頼度に基づいて前記矩形領域におけるエッジ方向を検出するエッジ方向検出方法であって、
一方の画素が前記矩形領域の中央画素に隣接する隣接画素であり、他方の画素が前記隣接画素と線分を結んだ場合に当該エッジ方向と当該線分が平行関係となる組み合わせを、前記各エッジ方向について少なくともそれぞれ複数記憶しておき、
指定された矩形領域について、前記記憶した組み合わせ画素の差分の絶対値を、各エッジ方向について総計した差分総計値をエッジ方向毎に演算し、
前記組み合わせ画素のうち、前記矩形領域の中央画素に隣接する隣接画素の画素値に基づいて、前記各エッジ方向における代表画素値と、前記指定された矩形領域を構成する各画素の値から当該矩形領域における代表画素値との差分を代表画素差分として、各エッジ方向について演算し、
前記各エッジ方向について、中央近傍画素値と前記代表画素値との差分を、中央近傍画素差分値として演算し、
各エッジ方向について、前記差分総計値に第1の係数を乗じた値と、前記中央近傍画素差分値に第2の係数を乗じた値の総和が小さいほど高いエッジ検出信頼度を演算すること、
を備えたエッジ検出信頼度演算方法。
An edge direction detection method for calculating edge detection reliability for a predetermined edge direction candidate in a rectangular area of M pixels * N pixels, and detecting an edge direction in the rectangular area based on the edge detection reliability,
When each pixel is an adjacent pixel adjacent to the central pixel of the rectangular area, and the other pixel connects the adjacent pixel and the line segment, a combination in which the edge direction and the line segment are in a parallel relationship, Store at least multiple edge directions,
For the specified rectangular area, the absolute value of the difference between the stored combination pixels is calculated for each edge direction, and a total difference value obtained by summing up the values for each edge direction is calculated.
Based on the pixel value of an adjacent pixel adjacent to the central pixel of the rectangular area among the combined pixels, the representative pixel value in each edge direction and the value of each pixel constituting the designated rectangular area The difference from the representative pixel value in the region is calculated as the representative pixel difference for each edge direction,
For each edge direction, the difference between the central neighborhood pixel value and the representative pixel value is calculated as the central neighborhood pixel difference value,
For each edge direction, calculating a higher edge detection reliability as the sum of a value obtained by multiplying the difference total value by a first coefficient and a value obtained by multiplying the center neighboring pixel difference value by a second coefficient is smaller;
An edge detection reliability calculation method comprising:
1画面の所定領域における所定のエッジ方向候補についてエッジ検出信頼度を演算し、前記エッジ検出信頼度に基づいて前記所定領域におけるエッジ方向を判定するエッジ方向判定方法であって、
一方の画素が前記矩形領域の中央画素に隣接する隣接画素であり、他方の画素が前記隣接画素と線分を結んだ場合に当該エッジ方向と当該線分が平行関係となる組み合わせを、前記各エッジ方向について少なくともそれぞれ複数記憶しておき、
指定された所定領域について、前記記憶した組み合わせ画素の差分の絶対値を、各エッジ方向について総計した差分総計値をエッジ方向毎に演算し、
前記組み合わせ画素のうち、前記所定領域の中央画素に隣接する隣接画素の画素値に基づいて、前記各エッジ方向における代表画素値と、前記指定された所定領域を構成する各画素の値から当該所定領域における代表画素値との差分を代表画素差分として、各エッジ方向について演算し、
前記各エッジ方向について、中央近傍画素値と前記代表画素値との差分を、中央近傍画素差分値として演算し、
前記差分総計値に第1の係数を乗じた値と、前記中央近傍画素差分値に第2の係数を乗じた値の総和が小さいエッジ方向を、求めるエッジ方向として判定すること、
を備えたエッジ方向判定方法。
An edge direction determination method for calculating edge detection reliability for a predetermined edge direction candidate in a predetermined area of one screen and determining an edge direction in the predetermined area based on the edge detection reliability,
When each pixel is an adjacent pixel adjacent to the central pixel of the rectangular area, and the other pixel connects the adjacent pixel and the line segment, a combination in which the edge direction and the line segment are in a parallel relationship, Store at least multiple edge directions,
For the specified area, the absolute value of the difference between the stored combination pixels is calculated for each edge direction, and the total difference value calculated for each edge direction is calculated for each edge direction.
Based on the pixel value of an adjacent pixel adjacent to the central pixel of the predetermined region among the combination pixels, the predetermined pixel value is determined from the representative pixel value in each edge direction and the value of each pixel constituting the specified predetermined region. The difference from the representative pixel value in the region is calculated as the representative pixel difference for each edge direction,
For each edge direction, the difference between the central neighborhood pixel value and the representative pixel value is calculated as the central neighborhood pixel difference value,
Determining an edge direction having a small sum of a value obtained by multiplying the difference total value by a first coefficient and a value obtained by multiplying the center neighboring pixel difference value by a second coefficient as an edge direction to be obtained;
Edge direction determination method comprising:
コンピュータを、下記手段として機能させるためのエッジ方向判定プログラム。
一方の画素がM画素*N画素の矩形領域の中央画素に隣接する隣接画素であり、他方の画素が前記隣接画素と線分を結んだ場合に当該エッジ方向と当該線分が平行関係となる組み合わせを、前記各エッジ方向について少なくともそれぞれ複数記憶する手段、
指定された矩形領域について、前記記憶した組み合わせ画素の差分の絶対値を、各エッジ方向について総計した差分総計値をエッジ方向毎に演算する手段、
前記組み合わせ画素のうち、前記矩形領域の中央画素に隣接する隣接画素の画素値に基づいて、前記各エッジ方向における代表画素値と、前記指定された矩形領域を構成する各画素の値から当該矩形領域における代表画素値との差分を代表画素差分として、各エッジ方向について演算する手段、
前記各エッジ方向について、中央近傍画素値と前記代表画素値との差分を、中央近傍画素差分値として演算する手段、
前記差分総計値に第1の係数を乗じた値と、前記中央近傍画素差分値に第2の係数を乗じた値の総和が小さいエッジ方向を、求めるエッジ方向として判定する手段。
An edge direction determination program for causing a computer to function as the following means.
When one pixel is an adjacent pixel adjacent to the central pixel of the rectangular area of M pixels * N pixels, and the other pixel forms a line segment with the adjacent pixel, the edge direction and the line segment are in a parallel relationship. Means for storing at least a plurality of combinations for each edge direction;
Means for calculating, for each edge direction, a difference total value obtained by summing up the absolute values of the differences of the stored combination pixels with respect to each edge direction for the designated rectangular area;
Based on the pixel value of an adjacent pixel adjacent to the central pixel of the rectangular area among the combined pixels, the representative pixel value in each edge direction and the value of each pixel constituting the designated rectangular area Means for calculating the difference between the representative pixel value in the region as the representative pixel difference for each edge direction;
Means for calculating a difference between a central neighborhood pixel value and the representative pixel value as a central neighborhood pixel difference value for each edge direction;
Means for determining an edge direction having a small sum of a value obtained by multiplying the difference total value by a first coefficient and a value obtained by multiplying the center neighboring pixel difference value by a second coefficient as an edge direction to be obtained.
JP2010271812A 2010-12-06 2010-12-06 Edge direction detection apparatus or method Active JP4975861B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2010271812A JP4975861B2 (en) 2010-12-06 2010-12-06 Edge direction detection apparatus or method
PCT/JP2011/070567 WO2012077394A1 (en) 2010-12-06 2011-09-09 Edge direction detection device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010271812A JP4975861B2 (en) 2010-12-06 2010-12-06 Edge direction detection apparatus or method

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2011269188A Division JP5373881B2 (en) 2011-12-08 2011-12-08 Edge direction detection apparatus or method

Publications (2)

Publication Number Publication Date
JP2012123479A JP2012123479A (en) 2012-06-28
JP4975861B2 true JP4975861B2 (en) 2012-07-11

Family

ID=46206899

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010271812A Active JP4975861B2 (en) 2010-12-06 2010-12-06 Edge direction detection apparatus or method

Country Status (2)

Country Link
JP (1) JP4975861B2 (en)
WO (1) WO2012077394A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020051750A1 (en) * 2018-09-10 2020-03-19 深圳配天智能技术研究院有限公司 Image processing method, edge extracting method, processing device, and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7242819B2 (en) * 2002-12-13 2007-07-10 Trident Microsystems, Inc. Method and system for advanced edge-adaptive interpolation for interlace-to-progressive conversion
JP4487179B2 (en) * 2004-03-16 2010-06-23 ソニー株式会社 Image processing apparatus and method, recording medium, and program
JP4710635B2 (en) * 2006-02-07 2011-06-29 ソニー株式会社 Image processing apparatus and method, recording medium, and program
JP4868249B2 (en) * 2007-10-10 2012-02-01 株式会社Jvcケンウッド Video signal processing device

Also Published As

Publication number Publication date
WO2012077394A1 (en) 2012-06-14
JP2012123479A (en) 2012-06-28

Similar Documents

Publication Publication Date Title
US10268901B2 (en) Quasi-parametric optical flow estimation
CN108596975B (en) Stereo matching algorithm for weak texture region
TWI536318B (en) Depth measurement quality enhancement
CN107133914B (en) Apparatus for generating three-dimensional color image and method for generating three-dimensional color image
JP2012073942A5 (en)
CN107451976B (en) A kind of image processing method and device
NL2016660B1 (en) Image stitching method and device.
US10142613B2 (en) Image processing apparatus, image processing system, and image processing method
JP5878598B2 (en) Method, apparatus, program, and recording medium for improving accuracy of peripheral coordinates of projected capacitive touch panel
JP2008185375A (en) 3d shape calculation device of sar image, and distortion correction device of sar image
CN112700433A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
JPWO2015040657A1 (en) Image processing apparatus, image processing method, and image processing program
WO2003009232A2 (en) Method and apparatus for sub-pixel edge detection
JP2012068772A (en) Camera tracking device and program therefor
JP2011141710A (en) Device, method and program for estimating depth
JP4975861B2 (en) Edge direction detection apparatus or method
JP5373881B2 (en) Edge direction detection apparatus or method
WO2017096384A1 (en) Quasi-parametric optical flow estimation
US8582922B2 (en) Image processing device and method
TWI429274B (en) Image processing system having scaling and sharpness device and method thereof
JP4850965B1 (en) Edge interpolation apparatus or method thereof
CN114359050A (en) Image processing method, image processing apparatus, computer device, storage medium, and program product
JP6962450B2 (en) Image processing equipment, image processing methods, and programs
TWI775774B (en) Methods, devices and computer-based electronic system for reducing structure noise
JP2005346393A (en) Stereo image recognition device and its method

Legal Events

Date Code Title Description
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: 20120409

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120411

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 4975861

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150420

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150420

Year of fee payment: 3

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250