JP6225722B2 - Image processing method and image processing apparatus - Google Patents

Image processing method and image processing apparatus Download PDF

Info

Publication number
JP6225722B2
JP6225722B2 JP2014012232A JP2014012232A JP6225722B2 JP 6225722 B2 JP6225722 B2 JP 6225722B2 JP 2014012232 A JP2014012232 A JP 2014012232A JP 2014012232 A JP2014012232 A JP 2014012232A JP 6225722 B2 JP6225722 B2 JP 6225722B2
Authority
JP
Japan
Prior art keywords
image
image processing
pixel
processing method
principal component
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2014012232A
Other languages
Japanese (ja)
Other versions
JP2015141440A (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.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP2014012232A priority Critical patent/JP6225722B2/en
Publication of JP2015141440A publication Critical patent/JP2015141440A/en
Application granted granted Critical
Publication of JP6225722B2 publication Critical patent/JP6225722B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、カラーまたはモノクロ階調画像から、その画像中に支配的な直線部分の角度を検出する画像処理方法、画像処理装置に関する。   The present invention relates to an image processing method and an image processing apparatus for detecting an angle of a dominant straight line portion in a color or monochrome gradation image.

たとえば、工業製品の製造工程や検査工程において、前後の工程間での中間製品の受け渡しのため、又は、予め記録した良品画像と比較して欠陥の有無を検査する場合に、(中間)製品をカメラで撮像した画像からその画像に支配的な直線部分の角度を短時間に一定以上の精度で求めなければならないことがよくある。また、文書や図表をスキャナで取り込んで得られる画像の傾きを直すことや、航空写真から道路や鉄道の角度を検出するといった場合にも、性能の良い画像処理アルゴリズムが求められている。     For example, in the manufacturing process and inspection process of industrial products, for the delivery of intermediate products between the previous and subsequent processes, or when inspecting the presence or absence of defects compared with a pre-recorded good product image, In many cases, it is necessary to obtain the angle of a straight line portion dominant in an image captured by a camera with a certain level of accuracy in a short time. There is also a need for a high-performance image processing algorithm for correcting the inclination of an image obtained by scanning a document or chart with a scanner, or for detecting the angle of a road or railway from an aerial photograph.

特許文献1に記載の線分の角度検出用画像処理装置では、ハフ変換を2段階で行うことにより角度検出を行っている。特許文献2記載の画像処理方法は、エッジ方向のヒストグラムを作成してこのヒストグラム上の最大ピーク値に対応する角度を対象物の角度とする。特許文献3では、画像の着目画素におけるエッジ強度および、エッジ方向を算出し、エッジ強度が一定のしきい値以上であればその着目画素が直線上にあると判定し、直線上にあると判定された画像について、エッジ方向ヒストグラムを作成し、度数が最大となる角度を抽出する角度検出手法が開示されている。   In the angle detection image processing apparatus described in Patent Document 1, angle detection is performed by performing Hough transform in two stages. In the image processing method described in Patent Document 2, a histogram in the edge direction is created, and an angle corresponding to the maximum peak value on the histogram is set as the angle of the object. In Patent Document 3, the edge strength and edge direction of a target pixel of an image are calculated, and if the edge strength is equal to or greater than a certain threshold value, the target pixel is determined to be on a straight line, and determined to be on a straight line. An angle detection method is disclosed in which an edge direction histogram is created for the image thus obtained, and an angle at which the frequency is maximized is extracted.

特開平6−119447号公報JP-A-6-119447 特開平11−96372号公報JP 11-96372 A 特許第4327654号公報Japanese Patent No. 4327654

しかしながら、特許文献2や3に開示された角度ヒストグラムを用いる手法においては、その刻み幅よりも細かい精度で度数最大角度を求めることはできないという問題点があり、その刻み幅を大きくとれば精度が低下し、小さくとればひとつひとつのセグメントに落ちる度数が少なくなるために信頼性が低下するというジレンマがある。また、エッジ強度が一定のしきい値以上である画素に対しても、エッジ強度の相対的な大小のばらつきがあり、エッジ強度が相対的に小さい画素は、ノイズの影響を受けている可能性があるため、本来は重視したくない。ところが、角度ヒストグラムをとる方法を用いると、エッジ強度が高いために角度の信頼性の高い画素についても、エッジ強度が低いためにノイズの影響を受けている可能性のある画素についても、同様の重みでカウントされるという問題点がある。この問題点もまた、検出された角度の精度を低下させる要因となる。   However, the methods using the angle histograms disclosed in Patent Documents 2 and 3 have a problem that the maximum frequency angle cannot be obtained with an accuracy finer than the step size. If the step size is increased, the accuracy is improved. There is a dilemma that if it is reduced, the reliability decreases because the frequency of falling into each segment decreases. Also, even for pixels whose edge strength is above a certain threshold, there is a relative variation in edge strength, and pixels with relatively low edge strength may be affected by noise. I don't want to focus on it. However, when using the method of taking an angle histogram, the same applies to pixels that are highly reliable in angle because of high edge strength and pixels that may be affected by noise because of low edge strength. There is a problem that it is counted by weight. This problem also causes a decrease in the accuracy of the detected angle.

実際、特許文献3では、角度ヒストグラムの最頻値として得られた角度を「第1角度」とし、それに基づいて、仮直線を決定し、仮直線に基づいて回帰直線を求め、その傾きを最終的な出力角度としている。つまり、第1角度は精度が十分ではないために、第2のステップを必要とすることが記載されている。また、得られた角度に対して、信頼性の度合いを自己診断するための方法が提示されていないということも指摘できる。   In fact, in Patent Document 3, the angle obtained as the mode value of the angle histogram is set as the “first angle”, and a provisional line is determined based on the angle, and a regression line is obtained based on the provisional line, and the inclination is finally determined. Output angle. That is, it is described that the first angle requires the second step because the accuracy is not sufficient. It can also be pointed out that no method for self-diagnosis of the degree of reliability is presented for the obtained angle.

本発明は、このような問題点に鑑みてなされたものであって、角度の刻みによる精度低下とエッジ強度情報を利用しないことによる精度低下の2つの要因を排除し、一回の統計処理で精度のよい角度を算出する画像処理方法、画像処理装置を提供することを課題とする。   The present invention has been made in view of such problems, and eliminates two factors of accuracy degradation due to angle increments and accuracy degradation due to not using edge strength information, and allows a single statistical process. It is an object of the present invention to provide an image processing method and an image processing apparatus for calculating a highly accurate angle.

課題を解決するための第1の発明は、対象画像に支配的な直線の角度を検出するための画像処理方法であって、画像の各画素の画素値に関するグラジェントベクトルを求める段階、前記グラジェントベクトルの集まりに関する原点まわりの共分散行列を算出する段階、前記共分散行列に基づいて主成分分析を施し、第1主成分に直交する方向を求めることにより対象画像に支配的な直線の角度を決定する段階からなることを特徴とする画像処理方法である。   A first invention for solving the problem is an image processing method for detecting an angle of a straight line dominant in a target image, wherein a gradient vector relating to a pixel value of each pixel of the image is obtained, Calculating a covariance matrix around the origin for a set of gent vectors, performing principal component analysis based on the covariance matrix, and obtaining a direction orthogonal to the first principal component to determine a straight line angle dominant in the target image It is an image processing method characterized by comprising the step of determining.

ここでいう「原点まわりの」共分散行列とは、次のようなものである。いま、数1のように2変数の組(xi,yi)で表示されるn個のデータが与えられているとする。iは何番目のデータであるかを表す添え字である。便宜上xiを第1成分、yiを第2成分と呼ぶことにする。第1成分、第2成分の平均値は数2で表される。

Here, the “covariance matrix around the origin” is as follows. Now, assume that n pieces of data represented by a set of two variables (x i , y i ) are given as in Equation 1. i is a subscript indicating the number of data. For convenience, x i will be referred to as a first component and y i as a second component. The average value of the first component and the second component is expressed by Equation 2.

これを用いて、通常の共分散行列Cは数3で表すことができる。
Using this, the normal covariance matrix C can be expressed by Equation 3.

原点まわりの共分散行列とは、数3において第1成分xi、第2成分yiの平均値を0で置き換えたものである。すなわち、原点まわりの共分散行列C’は、数4で表される。
The covariance matrix around the origin is obtained by replacing the average value of the first component x i and the second component y i with 0 in Equation 3. That is, the covariance matrix C ′ around the origin is expressed by Equation 4.

ところで、主成分分析により、第1主成分軸を求めることは、次のような意味がある。
主成分分析により、第1主成分軸を求めることは、第1成分xi、第2成分yiによりx−y平面(空間)にプロットされる与えられたデータに対して、その空間内に引かれた任意の直線Lのうちで、データの分布に最も近いものを求めようとすることに相当する。その際の「近い」の基準としては、各データから直線Lに下ろした垂線の長さ(当該データの直線Lからの距離)を誤差とみなして、誤差の平方和が小さいほど「近い」ものとしている。(図19参照)
主成分分析の実際の計算は、通常は、データに基づいて共分散行列を求め、その固有値・固有ベクトルを求めるものである。最大固有値に対応する固有ベクトルが、第1主成分である。すると、データの平均値を通り、方向ベクトルが、第1主成分方向であるような直線が、求める最良近似直線である。
By the way, obtaining the first principal component axis by principal component analysis has the following meaning.
Obtaining the first principal component axis by principal component analysis is drawn into the space for the given data plotted on the xy plane (space) by the first component xi and the second component yi. This corresponds to finding the closest straight line to the data distribution among the arbitrary straight lines L. As a criterion for “close” at that time, the length of the perpendicular line from each data to the straight line L (distance from the straight line L of the data) is regarded as an error, and the closer the sum of squares of the error, the “closer” It is said. (See Figure 19)
In actual calculation of principal component analysis, a covariance matrix is usually obtained based on data, and its eigenvalue and eigenvector are obtained. The eigenvector corresponding to the maximum eigenvalue is the first principal component. Then, a straight line that passes through the average value of the data and whose direction vector is the first principal component direction is the best approximate straight line to be obtained.

一方、本願では、上記共分散行列に代えて、原点まわりの共分散行列を用いている。これは、データの近似直線を、原点を通るものに限定することに相当する。つまり、原点まわりの共分散行列に対して、最大固有値に対応する固有ベクトルを (原点まわりの) 第1 主成分とみなすことにすると、原点を通り、なおかつ、方向ベクトルが上記 (原点まわりの) 第1主成分であるような直線が、求めるものである。
グラジエントベクトルは、原点を中心とした各ベクトルの方向が画像上のエッジの法線を表わしているので、原点を中心としてみるのが本質的であって、データの平均値を中心として各ベクトルをみた方向には意味がない。それを鑑みて、原点まわりの共分散行列を用いている。
On the other hand, in the present application, a covariance matrix around the origin is used instead of the covariance matrix. This corresponds to limiting the approximate straight line of data to that passing through the origin. In other words, if the eigenvector corresponding to the maximum eigenvalue is regarded as the first principal component (around the origin) with respect to the covariance matrix around the origin, it passes through the origin and the direction vector is A straight line that is one main component is obtained.
In the gradient vector, since the direction of each vector centered on the origin represents the normal of the edge on the image, it is essential to look at the origin, and each vector is centered on the average value of the data. The direction seen is meaningless. In view of this, a covariance matrix around the origin is used.

本発明は、各画素ごとのグラジェントベクトルが求められれば、それを標本値の集合と考えて主成分分析を行うだけのシンプルな方法である。ヒストグラム処理に必須の刻み幅の設定が測定精度の上限を抑えてしまうことや、エッジ強度情報を考慮せずに方向情報を等価に扱うことにより測定結果にノイズの影響が入り込みやすいこと、といった従来技術の欠点を回避し、しかも1回の統計処理で求める結果を得ることができるという優れた特徴を有する。さらに、主成分分析の結果得られる第1主成分の寄与率を対象画像が本発明の処理方法に適した画像であったかどうかを判定する指標として用いてもよい。このような信頼性指標を併せて出力することができるという特徴も従来技術にはない。   The present invention is a simple method in which if a gradient vector for each pixel is obtained, it is considered as a set of sample values and principal component analysis is performed. Conventional steps such as setting the step size required for histogram processing suppresses the upper limit of measurement accuracy, and handling the direction information equivalently without considering edge strength information makes it easier for noise to affect the measurement result. It has an excellent feature that it can avoid the disadvantages of the technology and can obtain the result obtained by a single statistical process. Furthermore, the contribution ratio of the first principal component obtained as a result of the principal component analysis may be used as an index for determining whether the target image is an image suitable for the processing method of the present invention. There is no feature in the prior art that such a reliability index can be output together.

第1の発明において、前記グラジェントベクトルを求める段階は、各画素をそれぞれ順次着目画素とし、着目画素を中心とする所定の近傍領域を定め、近傍領域において重回帰分析を施し、得られた近似平面を表す数式に基づいてグラジェントベクトルを定めることが好ましい。各着目画素の近傍領域を着目画素に対して適切に定めることにより重回帰分析により得られる平面は着目画素の接平面を十分近似するものとなる。
更に、第1の発明の前記好ましい態様において、前記近傍領域は、着目画素を中心とする一定半径の円内の画素により定められる領域であることがより好ましい。円形の近傍領域をとることにより対象画像に支配的な直線の方向による偏りが生じないのでより好ましい。
In the first aspect of the invention, the step of obtaining the gradient vector includes sequentially setting each pixel as a pixel of interest, defining a predetermined neighborhood region centered on the pixel of interest, performing multiple regression analysis in the neighborhood region, and obtaining an approximation obtained It is preferable to determine the gradient vector based on a mathematical expression representing a plane. A plane obtained by multiple regression analysis by appropriately determining the vicinity region of each pixel of interest is sufficiently approximated to the tangent plane of the pixel of interest.
Furthermore, in the preferable aspect of the first invention, it is more preferable that the neighboring area is an area defined by pixels within a circle having a constant radius centered on the pixel of interest. By taking a circular neighborhood, it is more preferable because the target image is not biased by the dominant straight line direction.

課題を解決する第2の発明は、処理対象画像データ中の支配的な直線の角度を検出する画像処理装置であって、各画素における画素値のグラジェントベクトルを算出する手段と、
全画素のグラジェントベクトルに対して原点まわりの共分散行列を算出する手段と、得られた共分散行列に基づいて主成分分析を施し、第1主成分に直交する方向を求める角度と決定する手段とを備えたことを特徴とする画像処理装置である。
A second invention that solves the problem is an image processing device that detects an angle of a dominant straight line in processing target image data, and calculates a gradient vector of pixel values in each pixel;
A means for calculating a covariance matrix around the origin with respect to the gradient vectors of all pixels, and principal component analysis is performed based on the obtained covariance matrix to determine an angle for obtaining a direction orthogonal to the first principal component. And an image processing apparatus.

課題を解決するための第3の発明は、コンピュータを第2の発明に係る画像処理装置として動作させる一連の命令を記述したコンピュータプログラムである。   A third invention for solving the problem is a computer program describing a series of instructions for causing a computer to operate as the image processing apparatus according to the second invention.

本発明は、従来技術にない画期的斬新な処理アルゴリズムを採用したことにより、計算の煩雑さ、ヒストグラム処理に必須の刻み幅の設定が測定精度の上限を定めてしまうこと、エッジ強度情報を考慮せずに方向情報を等価に扱うことによるノイズの影響を受けやすいこと、といった従来技術の欠点を克服した。さらに、対象画像が本画像処理手法に適した画像であるかどうかの信頼度の目安も与えることができるという顕著な効果を奏する。
The present invention employs a revolutionary and innovative processing algorithm that does not exist in the prior art, so that the complexity of calculation, the setting of the step size essential for histogram processing determines the upper limit of the measurement accuracy, the edge strength information It overcomes the drawbacks of the prior art, such as being susceptible to noise due to equivalent handling of direction information without consideration. Furthermore, there is a remarkable effect that it is possible to give a measure of reliability as to whether or not the target image is an image suitable for the present image processing method.

本発明の処理手順を説明するフローチャートである。It is a flowchart explaining the process sequence of this invention. 注目画素の近傍領域を説明する図である。It is a figure explaining the vicinity area | region of an attention pixel. サンプル画像1Sample image 1 サンプル画像1の正方形近傍による処理結果(近傍半径r=8)Processing result by square neighborhood of sample image 1 (neighbor radius r = 8) サンプル画像1の円形近傍による処理結果(近傍半径r=8)Processing result by circular neighborhood of sample image 1 (neighbor radius r = 8) サンプル画像2Sample image 2 サンプル画像2の正方形近傍による処理結果(近傍半径r=8)Processing result by square neighborhood of sample image 2 (neighbor radius r = 8) サンプル画像2の円形近傍による処理結果(近傍半径r=8)Processing result by circular neighborhood of sample image 2 (neighbor radius r = 8) サンプル画像3Sample image 3 サンプル画像3の正方形近傍による処理結果(近傍半径r=8)Processing result by square neighborhood of sample image 3 (neighbor radius r = 8) サンプル画像3の円形近傍による処理結果(近傍半径r=8)Processing result of sample image 3 by circular neighborhood (neighbor radius r = 8) サンプル画像1の円形近傍による処理結果(近傍半径r=6)Processing result by circular neighborhood of sample image 1 (neighbor radius r = 6) サンプル画像2の円形近傍による処理結果(近傍半径r=6)Processing result of sample image 2 by circular neighborhood (neighbor radius r = 6) サンプル画像3の円形近傍による処理結果(近傍半径r=6)Processing result of sample image 3 by circular neighborhood (neighbor radius r = 6) 近傍のバリエーションを示す図である。It is a figure which shows the near variation. 24通りのバリエーションによるテストの結果を表したグラフである。It is a graph showing the result of the test by 24 variations. (画像3種)×(近傍形状2通り)の6組の夫々について、縦軸に寄与率、横軸に近傍半径(画素)をとってプロットしたグラフである。FIG. 6 is a graph plotted with the vertical axis representing the contribution ratio and the horizontal axis representing the neighborhood radius (pixel) for each of the 6 sets of (3 types of images) × (2 neighborhood shapes). 本願第2の発明の一実施形態に係る画像処理装置100の概要構成図である。It is a schematic block diagram of the image processing apparatus 100 which concerns on one Embodiment of this invention 2nd invention. 主成分分析の意味を説明する図である。It is a figure explaining the meaning of principal component analysis. 正方形近傍ではグラジエントベクトルが 45°方向へと偏る傾向があることを説明する図Diagram explaining that the gradient vector tends to be biased toward 45 ° near the square

ここから、本発明の好適な実施形態の一つとしての画像処理方法を説明する。この画像処理方法は、画像メモリを備える汎用コンピュータまたは工場の製造ラインに設置される画像処理装置上で処理されることを念頭に置いた処理方法である。以下の説明では処理対象画像はすでに与えられている(既に撮像され、または入力され一旦画像メモリに格納されている)ものとして説明する。そして処理対象画像データは、画像処理を行うために汎用コンピュータ又は画像処理装置の中央演算処理装置に読み込まれる。図1は、この画像処理方法を説明するフローチャートである。図1のフローチャートに従って、以下説明する。   From here, the image processing method as one of the suitable embodiment of this invention is demonstrated. This image processing method is a processing method keeping in mind that the image processing is performed on a general-purpose computer having an image memory or an image processing apparatus installed in a factory production line. In the following description, it is assumed that the processing target image has already been given (already captured or input and temporarily stored in the image memory). Then, the processing target image data is read into a general-purpose computer or a central processing unit of the image processing apparatus in order to perform image processing. FIG. 1 is a flowchart for explaining this image processing method. This will be described below with reference to the flowchart of FIG.

画像データは画像を構成する画素Pごとに画素Pの値を記録したものである。画素Pは画像面の4隅の何れかを原点とした座標(x、y)で特定される。したがって画像データは数学的にはf(x、y)、1<=x<=n、1<=y<=mの形の2変数関数とみることができる。以下では、座標(x、y)の画素PをP(x,y)、その画素値をf(x、y)で表す。     The image data is obtained by recording the value of the pixel P for each pixel P constituting the image. The pixel P is specified by coordinates (x, y) with any one of the four corners of the image plane as the origin. Therefore, the image data can be mathematically viewed as a two-variable function in the form of f (x, y), 1 <= x <= n, 1 <= y <= m. Hereinafter, the pixel P at the coordinates (x, y) is represented by P (x, y), and the pixel value thereof is represented by f (x, y).

まず、画像データから最初の(次の)着目画素P(x,y)を設定する。(ステップS110)     First, the first (next) target pixel P (x, y) is set from the image data. (Step S110)

次に、着目画素Pの近傍領域に限定して重回帰分析を行いPにおけるグラジェントベクトル(( ∂f/ ∂x)P, (∂f/ ∂y) P )を決定する(ステップS120)。各着目画素におけるグラジェントベクトルの算出には、Sobel フィルタや Prewitt フィルタを用いることができる。これらはどちらも 3 × 3 画素からなる。しかし、ノイズの多い画像では、3 × 3 よりも広い近傍領域から統計的にグラジェントベクトルを求めたほうが安定する。
そこで本実施形態では、着目画素P(x,y)を中心とする適当な大きさの近傍領域Vを設定して領域V内の画素Pj(xj、yj)の3次元空間中の分布{zj=f(xj、yj)}に最もよくフィットする平面(近似平面)の方程式 z=ax+by+c を、重回帰分析を行うことによって求める。求められた平面の方程式の係数a,bからPにおけるグラジェントベクトルが、( ∂f/ ∂x)P=a,( ∂f/ ∂y)P=bとして決定される。ただしここで、近傍領域Vとは例えば、図2に示すような着目画素Pの8画素近傍矩形領域(a)またはPからの距離が8画素以内の円形近傍領域(b)等である。このステップは、結局着目画素Pにおける接平面(の向き)を決定することとなる。
Next, the multiple regression analysis is performed only in the vicinity region of the target pixel P, and the gradient vectors (((f / ∂x) P , (∂f / ∂y) P ) in P are determined (step S120). A Sobel filter or a Prewitt filter can be used to calculate the gradient vector at each pixel of interest. Both of these consist of 3 x 3 pixels. However, in a noisy image, it is more stable to obtain a gradient vector statistically from a neighboring region wider than 3 × 3.
Therefore, in this embodiment, a neighboring region V having an appropriate size centered on the pixel of interest P (x, y) is set, and the pixel P j (x j , y j ) in the region V in the three-dimensional space is set. A plane (approximate plane) equation z = ax + by + c that best fits the distribution {z j = f (x j , y j )} is obtained by performing multiple regression analysis. The gradient vectors at P are determined as (∂f / グ ラ x) P = a, ((f / ∂y) P = b from the coefficients a and b of the obtained plane equation. However, here, the neighborhood region V is, for example, an 8-pixel neighborhood rectangular region (a) of the pixel of interest P as shown in FIG. 2 or a circular neighborhood region (b) having a distance from P of 8 pixels or less. This step eventually determines the tangent plane (or direction) of the pixel of interest P.

求めたいのは、対象画像に支配的な直線部分の角度である。本画像処理方法では、直接に直線部分を求めてその角度を決定する方法ではなく、対象画像を2変数関数fの像が定める曲面として捉え、各画素に対して決まるグラジェントベクトルの分布を考察する。この場合、例えば画像中の一定面積を占める明るい領域、暗い領域は高い(または低い)台地とイメージでき、対象画像中に現れる直線部分はたいていの場合、高い台地と低い台地の境界に現れる崖領域とイメージできる。グラジエントベクトルの方向は、この崖を最も急峻に登る方向を指しており、それは等高線に直交する。グラジエントベクトルの大きさは、その最も急峻な傾きを示している。この崖部分のグラジェントベクトルの分布が画像中に支配的な直線の角度を決定する。
そこで、求めた偏微分係数( ∂f/ ∂x)P, (∂f/ ∂y) Pを次に示す数5のように積算してゆく(ステップS130)。
What is desired is the angle of the straight line portion that is dominant in the target image. In this image processing method, the straight line portion is not directly obtained and its angle is determined, but the target image is regarded as a curved surface defined by the image of the two-variable function f and the distribution of gradient vectors determined for each pixel is considered. To do. In this case, for example, a bright area and a dark area that occupy a certain area in the image can be imaged as a high (or low) plateau, and a straight line portion that appears in the target image is usually a cliff region that appears at the boundary between the high plateau and the low plateau I can imagine. The direction of the gradient vector points to the steepest climb of this cliff, which is orthogonal to the contour lines. The magnitude of the gradient vector indicates its steepest slope. The gradient vector distribution of the cliff determines the dominant straight angle in the image.
Therefore, the obtained partial differential coefficients (∂f / ∂x) P and (∂f / ∂y) P are integrated as shown in the following equation 5 (step S130).

全画素についてS110からS13010繰り返す。全画素についてのS1,S2,S3の集計が終了したら、次に示す数6により原点まわりの共分散行列C’が決定される(ステップS140)。
Repeat S110 to S13010 for all pixels. When the summation of S1, S2, and S3 for all pixels is completed, the covariance matrix C ′ around the origin is determined by the following equation 6 (step S140).

原点まわりの共分散行列C’に基づく主成分分析を行う。具体的には固有値と固有ベクトルを求め、値の大きいほうの固有値(以下第1固有値)に対応する固有ベクトル(以下第1固有ベクトル)を求める。(ステップS150)この固有ベクトルに基づいて画像の直線方向を決定する。具体的には、この固有ベクトルを (x, y) とするとき、x−y 平面において、このベクトルと直交するベクトル、 すなわち (y, −x) が求める角度を与えるベクトルである(ステップS160)。     Principal component analysis based on the covariance matrix C ′ around the origin is performed. Specifically, an eigenvalue and an eigenvector are obtained, and an eigenvector (hereinafter referred to as the first eigenvector) corresponding to the larger eigenvalue (hereinafter referred to as the first eigenvalue) is obtained. (Step S150) The linear direction of the image is determined based on this eigenvector. Specifically, when this eigenvector is (x, y), a vector orthogonal to this vector in the xy plane, that is, a vector that gives an angle to be obtained (step S160).

尚、説明した図1のフローチャートにおいて、ステップS120は「画像の各画素の画素値に関するグラジェントベクトルを求める段階」に相当する。ステップS110からステップS130のループおよびステップS140は「前記グラジェントベクトルの集まりに関する原点まわりの共分散行列を算出する段階」に相当する。ステップS150、S160は「前記共分散行列に基づいて主成分分析を施し、第1主成分に直交する方向を求めることにより対象画像に支配的な直線の角度を決定する段階」に相当する。
In the flowchart of FIG. 1 described above, step S120 corresponds to “a step of obtaining a gradient vector related to the pixel value of each pixel of the image”. The loop from step S110 to step S130 and step S140 correspond to “a step of calculating a covariance matrix around the origin regarding the collection of gradient vectors”. Steps S150 and S160 correspond to “the step of performing principal component analysis based on the covariance matrix and determining the angle of a straight line dominant in the target image by obtaining a direction orthogonal to the first principal component”.

(効果の検証 実験結果)
図1のフローチャートで示した画像処理方法の効果を検証するための実験結果を以下に示す。実験に使った画像は図3、図6、図9に示した3つのモノクロ階調画像である。図3は斜め線を境界とする2領域からなるサンプル画像1である。図6は斜め線が太さを持った帯状領域となっているサンプル画像2である。図9はいろいろな太さを持った複数の帯状領域から構成されるサンプル画像3である。いずれも斜め方向の直線が走っており、その角度は12.345°である。どの画像にも、全体にぼかしとノイズが施されている。角度が上述の通りであるから、グラジェントベクトルの方向の正解は、それに 90°を加えた 102.345°である。
(Verification of experimental results)
An experimental result for verifying the effect of the image processing method shown in the flowchart of FIG. 1 is shown below. The images used in the experiment are the three monochrome gradation images shown in FIGS. FIG. 3 shows a sample image 1 composed of two regions with a diagonal line as a boundary. FIG. 6 shows a sample image 2 in which a diagonal line is a band-like region having a thickness. FIG. 9 shows a sample image 3 composed of a plurality of band-like regions having various thicknesses. In both cases, an oblique straight line runs and the angle is 12.345 °. Every image is blurred and noisy throughout. Since the angle is as described above, the correct answer in the direction of the gradient vector is 102.345 ° plus 90 °.

(画像 3 種) × (正方形近傍, 円形近傍) ×(近傍半径 = 2, 4, 6, 8画素)
の 24 通りの組合せについて角度を算出するテストを行った。図15は近傍半径の半径の大きさに応じたバリエーションを示した図である。上段に正方形近傍の場合、下段に円形近傍の場合を示している。
(3 types of images) × (Near square, Near circle) × (Near radius = 2, 4, 6, 8 pixels)
A test was conducted to calculate the angles for the 24 combinations. FIG. 15 is a diagram showing variations according to the radius of the neighborhood radius. The upper part shows the case of a square and the lower part shows a case of a circle.

図4は、サンプル画像1に対して、正方形近傍(半径8画素)で処理した結果のグラジェントベクトルの分布をプロットしたグラフである。原点を通る長い線分は、原点まわりの共分散行列から得られた第1固有ベクトルを表す。図5は、サンプル画像1を円形近傍(半径8画素)で処理した結果のグラジェントベクトルの分布をプロットしたグラフである。原点を通る長い線分は、原点まわりの共分散行列から得られた第1固有ベクトルを表す。図5ではグラジェントベクトルの分布はほとんど第1固有ベクトルを表す線分上にプロットされている。   FIG. 4 is a graph plotting the distribution of gradient vectors as a result of processing in the vicinity of a square (radius 8 pixels) with respect to the sample image 1. The long line segment passing through the origin represents the first eigenvector obtained from the covariance matrix around the origin. FIG. 5 is a graph plotting the distribution of the gradient vector as a result of processing the sample image 1 in the vicinity of a circle (radius 8 pixels). The long line segment passing through the origin represents the first eigenvector obtained from the covariance matrix around the origin. In FIG. 5, the gradient vector distribution is almost plotted on the line segment representing the first eigenvector.

図7は、サンプル画像2に対して、正方形近傍(半径8画素)で処理した結果のグラジェントベクトルの分布をプロットしたグラフである。原点を通る長い直線は、原点まわりの共分散行列から得られた第1固有ベクトルを表す。図8は、サンプル画像2を円形近傍(半径8画素)で処理した結果のグラジェントベクトルの分布をプロットしたグラフである。原点を通る長い線分は、原点まわりの共分散行列から得られた第1固有ベクトルを表す。図8ではグラジェントベクトルの分布はほとんど第1固有ベクトルを表す直線上にプロットされている。   FIG. 7 is a graph plotting the distribution of the gradient vector as a result of processing in the vicinity of the square (radius 8 pixels) with respect to the sample image 2. The long straight line passing through the origin represents the first eigenvector obtained from the covariance matrix around the origin. FIG. 8 is a graph plotting the distribution of gradient vectors as a result of processing the sample image 2 in the vicinity of a circle (radius 8 pixels). The long line segment passing through the origin represents the first eigenvector obtained from the covariance matrix around the origin. In FIG. 8, the gradient vector distribution is almost plotted on a straight line representing the first eigenvector.

図10は、サンプル画像3に対して、正方形近傍(半径8画素)で処理した結果のグラジェントベクトルの分布をプロットしたグラフである。サンプル画像3は、帯状領域が複数あり、幅が異なっているため、サンプル画像1および2に関する結果 (図4および図7) と比較して、グラジェントベクトルの分布は、湾曲がいっそう複雑化しているのが見てとれる。図11は、サンプル画像3に対して、円形近傍(半径8画素)で処理した結果のグラジェントベクトルの分布をプロットしたグラフである。帯状領域が複数あるのでグラジェントベクトルの分布は、第1固有ベクトルを表す直線に乗ってはいるが、その揺れの幅はサンプル画像1や2の場合(図5、図8)と比較するとやや大きい。しかしながら主成分分析を行うため、第1固有ベクトルの方向は妥当な方向が得られている。   FIG. 10 is a graph plotting the distribution of the gradient vector as a result of processing in the vicinity of the square (radius 8 pixels) with respect to the sample image 3. Since the sample image 3 has a plurality of band-like regions and has different widths, the distribution of the gradient vector is more complicated in curvature than the results of the sample images 1 and 2 (FIGS. 4 and 7). You can see that. FIG. 11 is a graph plotting the distribution of gradient vectors as a result of processing in the vicinity of a circle (radius 8 pixels) with respect to the sample image 3. Since there are a plurality of band-like regions, the gradient vector distribution is on the straight line representing the first eigenvector, but the amplitude of the fluctuation is slightly larger than in the case of the sample images 1 and 2 (FIGS. 5 and 8). . However, since the principal component analysis is performed, an appropriate direction is obtained as the direction of the first eigenvector.

図4と図5、図7と図8、図10と図11をそれぞれ比較すると、近傍領域の形としては正方形よりも円形の方が性質が良いということがわかる。   4 and 5, FIG. 7 and FIG. 8, and FIG. 10 and FIG.

図12は、図3のサンプル画像1に対して近傍領域のサイズを半径6の円形として図1に示す処理フローで得られたグラジェントベクトルの分布である。近傍領域が小さくなったため、グラジェントベクトルの分布は図5と比べて揺れ幅がやや広がっている。     FIG. 12 shows the distribution of the gradient vector obtained in the processing flow shown in FIG. 1 with the size of the neighboring region being a circle having a radius of 6 with respect to the sample image 1 of FIG. Since the neighborhood region has become smaller, the gradient vector distribution has a slightly larger fluctuation width compared to FIG.

図13は、図6のサンプル画像2に対して近傍領域のサイズを半径6の円形として図1に示す処理フローで得られたグラジェントベクトルの分布である。近傍領域が小さくなったため、グラジェントベクトルの分布は図8と比べて揺れ幅がやや広がっている。   FIG. 13 is a distribution of gradient vectors obtained by the processing flow shown in FIG. 1 in which the size of the neighboring region is a circle having a radius of 6 with respect to the sample image 2 of FIG. Since the neighborhood area has become smaller, the gradient vector distribution has a slightly larger fluctuation width than that in FIG.

図14は、図9のサンプル画像3に対して近傍領域のサイズを半径6の円形として図1に示す処理フローで得られたグラジェントベクトルの分布である。近傍領域が小さくなったため、グラジェントベクトルの分布は図11と比べて揺れ幅がやや広がっている。     FIG. 14 is a distribution of gradient vectors obtained by the processing flow shown in FIG. 1 in which the size of the neighboring region is a circle having a radius of 6 with respect to the sample image 3 of FIG. Since the neighborhood area has become smaller, the gradient vector distribution has a slightly larger fluctuation width than that in FIG.

図16は、24通りのバリエーションによるテストの結果を表したグラフである。縦軸に算出された角度(°)、横軸に近傍半径(画素サイズ)をとり、(画像3種)×(近傍形状2通り)の何れか1つを示す6個の折れ線グラフを示している。その関係は、
gr-s-ta80r2n4: サンプル画像1、正方形近傍
gr-s-tl80w20r2n4: サンプル画像2、正方形近傍
gr-s-tls80r2n4: サンプル画像3、正方形近傍
gr-c-ta80r2n4: サンプル画像1、円形近傍
gr-c-tl80w20r2n4: サンプル画像2、円形近傍
gr-c-tls80r2n4: サンプル画像3、円形近傍

である(図面ではハイフン「-」はアンダーバーで表示)。正解は前記したように102.345°である。各グラフは近傍半径が大きくなるにつれて102.345°を示す水平線上にのらなければならない。gr-c-ta80r2n4、gr-c-tl80w20r2n4は近傍半径6以上でほぼ正解といえる102.3°付近を示している。gr-c-tls80r2n4も前2者と比べるとやや誤差はあるものの近傍半径6以上で102.0°と、正解にかなり近い値を出している。これに対して正方形近傍としたものは近傍半径2画素の時が最も正解に近く、半径が大きくなるにつれて正解からのずれが大きくなっている。gr-s-tls80r2n4でそのずれが顕著であるが、それは、輪郭線が正方形近傍の角にかかることによって、グラジエントの算出値が45°方向に引っ張られる効果が、近傍半径が大きくなるとともに強まっていくからである。これを図20により詳しく説明すると、近傍領域が、その外周近くで急峻な輪郭線にわずかにかかるようなケースにおいて、近傍領域の形状が正方形の場合(図20(A))では、実際の輪郭線の傾きにかかわらず、グラジエントベクトルの算出値 が45°方向へと偏る傾向が生じる。一方、近傍領域の形状が円形の場合(図20(B))では、そのような偏りは生じない。いずれにしても少なくともこの実験で使用した3つのサンプル画像の場合では、円形近傍で近傍半径が5〜8画素程度の場合に精度よく角度を検出できることがわかる。
FIG. 16 is a graph showing the results of tests using 24 variations. The vertical axis represents the calculated angle (°), the horizontal axis represents the radius of the neighborhood (pixel size), and 6 line graphs showing any one of (3 types of images) × (2 neighborhood shapes) are shown. Yes. The relationship is
gr-s-ta80r2n4: Sample image 1, near square
gr-s-tl80w20r2n4: Sample image 2, near square
gr-s-tls80r2n4: Sample image 3, near square
gr-c-ta80r2n4: Sample image 1, circular neighborhood
gr-c-tl80w20r2n4: Sample image 2, near a circle
gr-c-tls80r2n4: Sample image 3, near a circle

(In the drawing, the hyphen "-" is displayed as an underscore). The correct answer is 102.345 ° as described above. Each graph must lie on a horizontal line showing 102.345 ° as the neighborhood radius increases. gr-c-ta80r2n4 and gr-c-tl80w20r2n4 indicate the vicinity of 102.3 ° which can be said to be almost correct when the radius is 6 or more. The gr-c-tls80r2n4 also has a slight error compared to the former two, but with a neighborhood radius of 6 or more and 102.0 °, a value very close to the correct answer. On the other hand, in the case of a square neighborhood, the neighborhood is closest to the correct answer when the radius is 2 pixels, and the deviation from the correct answer increases as the radius increases. The shift is remarkable in gr-s-tls80r2n4, but the effect that the calculated value of the gradient is pulled in the 45 ° direction when the contour line is applied to the corner near the square becomes stronger as the neighborhood radius increases. Because it goes. This will be described in more detail with reference to FIG. 20. In the case where the neighboring area slightly covers a steep outline near the outer periphery thereof, when the shape of the neighboring area is square (FIG. 20A), the actual contour is obtained. Regardless of the slope of the line, the calculated gradient vector tends to deviate in the 45 ° direction. On the other hand, when the shape of the neighborhood region is circular (FIG. 20B), such a bias does not occur. In any case, at least in the case of the three sample images used in this experiment, it can be seen that the angle can be detected accurately when the neighborhood radius is about 5 to 8 pixels in the vicinity of the circle.

図17は、(画像3種)×(近傍形状2通り)の6組の夫々について、縦軸に寄与率(第1主成分の寄与率)、横軸に近傍半径(画素)をとってプロットしたものである。寄与率は、主成分分析によってデータに直線を当てはめる際のフィッティングのよさを表す。図17のグラフを見ると円形近傍を用いた3つの折れ線gr-c-ta80r2n4、gr-c-tl80w20r2n4、gr-c-tls80r2n4は近傍半径4以上で寄与率が99.9%を超えており、本発明の方法に適した画像であるといえる。すなわち、円形近傍の半径4以上の条件で処理した場合に得られる角度の値の信頼度は極めて高いということができる。

FIG. 17 is a plot of the contribution rate (contribution rate of the first principal component) on the vertical axis and the neighborhood radius (pixel) on the horizontal axis for each of the 6 sets of (3 types of images) × (2 types of neighborhood shape). It is a thing. The contribution ratio represents the goodness of fitting when a straight line is applied to data by principal component analysis. As shown in the graph of FIG. 17, the three broken lines gr-c-ta80r2n4, gr-c-tl80w20r2n4, and gr-c-tls80r2n4 using the circular neighborhood have a radius of 4 or more and the contribution ratio exceeds 99.9%. It can be said that the image is suitable for the method of the present invention. That is, it can be said that the reliability of the angle value obtained when processing under the condition of a radius of 4 or more near the circle is extremely high.

出願人の実験によれば、エッジの角度が揃ってなく、支配的な直線角度が不明確な原画像に対しては、寄与率の値は70% を下回ることが多い。したがって、第1主成分の寄与率が70% を下回る場合には、そもそも原画像に一定角度をもった支配的な直線または直線群が存在しないものと推測し、算出された角度の値を採用せずにエラーとする、といった措置を講ずることができる。つまり、第1主成分の寄与率は、結果の信憑性の指標として有用である。   According to the applicant's experiment, the value of the contribution rate is often less than 70% for an original image in which the angles of the edges are not uniform and the dominant straight line angle is unclear. Therefore, when the contribution ratio of the first principal component is less than 70%, it is assumed that there is no dominant straight line or straight line group having a certain angle in the original image, and the calculated angle value is adopted. It is possible to take measures such as making an error without doing so. That is, the contribution ratio of the first principal component is useful as an index of the reliability of the result.

次に、ここまで説明した画像処理方法に基づく角度検出処理機能を搭載した画像処理装置について説明する。図18は本願第2の発明の一実施形態に係る画像処理装置100の概要構成図を示したものである。画像処理装置100は、汎用のコンピュータ本体に表示部120、入力部130、画像入力部140を接続し、角度検出処理を行うプログラムを搭載して実現することができる。表示部120は表示インターフェース102の表示メモリにある表示用データをカラー表示するモニタディスプレイである。入力部130はキーボードおよびまたはマウスである。尚、表示部と入力部が一体となったタッチパネルにより構成してもよい。   Next, an image processing apparatus equipped with an angle detection processing function based on the image processing method described so far will be described. FIG. 18 is a schematic configuration diagram of an image processing apparatus 100 according to an embodiment of the second invention of the present application. The image processing apparatus 100 can be realized by connecting a display unit 120, an input unit 130, and an image input unit 140 to a general-purpose computer main body and mounting a program for performing angle detection processing. The display unit 120 is a monitor display that displays display data in the display memory of the display interface 102 in color. The input unit 130 is a keyboard and / or a mouse. In addition, you may comprise by the touchscreen with which the display part and the input part were united.

画像入力部140は内部に光学レンズ系、イメージセンサ、AD変換回路を有する。画像処理装置100は、中央演算処理部(CPU)101、表示インターフェース102、入力インターフェース103、画像入力インターフェース104、記憶装置106を備える。これらはバス109により接続される。記憶装置106には、画像処理装置100に接続される表示部120や入力部130の基本的機能をユーザに提供するOS(オペレーティングシステム)のコード、処理対象画像の画像データ、画像入力装置に接続される画像入力インターフェース104を制御して画像データを入力する画像取得機能を実現するプログラムコード、画像データから角度検出を行うプログラムコード、画像処理装置100のメインメニューを表示し、操作者の指示を受付けて必要な機能を呼び出す各種制御プログラムコード等が記録される。角度検出を行うプログラムコードはCPU101に呼び出され実行されることにより、各画素におけるグラジェントベクトルを算出する手段、全画素のグラジェントベクトルに対して原点まわりの共分散行列を算出する手段、得られた共分散行列に基づいて主成分分析を施し、第1主成分に直交する方向を求める角度として決定する手段として機能することになる。   The image input unit 140 includes an optical lens system, an image sensor, and an AD conversion circuit. The image processing apparatus 100 includes a central processing unit (CPU) 101, a display interface 102, an input interface 103, an image input interface 104, and a storage device 106. These are connected by a bus 109. The storage device 106 is connected to an OS (operating system) code that provides a user with the basic functions of the display unit 120 and the input unit 130 connected to the image processing apparatus 100, image data of a processing target image, and an image input device. The program code for realizing the image acquisition function for controlling the image input interface 104 to input the image data, the program code for detecting the angle from the image data, the main menu of the image processing apparatus 100 are displayed, and the operator's instruction is displayed. Various control program codes that are received and call necessary functions are recorded. The program code for angle detection is called and executed by the CPU 101 to obtain means for calculating a gradient vector for each pixel, means for calculating a covariance matrix around the origin for the gradient vectors of all pixels. The principal component analysis is performed based on the covariance matrix and functions as a means for determining an angle for obtaining a direction orthogonal to the first principal component.

以上説明したように、本発明の実施形態に係る画像処理方法又はそれをソフトウェアとして搭載した画像処理装置は、各画素ごとのグラジェントベクトルが求められれば、それを標本値の集合と考えて主成分分析を行うだけのシンプルな方法である。ヒストグラム処理に必須の刻み幅の設定が測定精度の上限を抑えてしまうことや、エッジ強度情報を考慮せずに方向情報を等価に扱うことにより測定結果にノイズの影響が入り込みやすいこと、といった従来技術の欠点を回避し、しかも1回の統計処理で求める結果を得ることができるという優れた特徴を有する。さらに、主成分分析の結果得られる第1主成分の寄与率を対象画像が本処理方法に適した画像であったかどうかを判定する指標として用いることもできる。このような信頼性指標を併せて確認可能なことも従来技術にはない本画像処理方法の有利な特徴である。   As described above, when an image processing method according to an embodiment of the present invention or an image processing apparatus in which the image processing method is installed as software is obtained, a gradient vector for each pixel is obtained and considered as a set of sample values. It is a simple method that only performs component analysis. Conventional steps such as setting the step size required for histogram processing suppresses the upper limit of measurement accuracy, and handling the direction information equivalently without considering edge strength information makes it easier for noise to affect the measurement result. It has an excellent feature that it can avoid the disadvantages of the technology and can obtain the result obtained by a single statistical process. Furthermore, the contribution ratio of the first principal component obtained as a result of the principal component analysis can also be used as an index for determining whether the target image is an image suitable for the present processing method. The fact that such a reliability index can be confirmed together is also an advantageous feature of the present image processing method that is not available in the prior art.

以上説明したように本発明の実施形態で説明した画像処理方法およびこのアルゴリズムを搭載した画像処理装置は、工業製品の製造工程や検査工程において、画像読み取り装置の角度補正機能として、航空写真の処理等、様々な産業分野で用いることができる。特に下記のような画像を扱う処理に好適である。
1)明度の高い領域(白領域)と明度の低い領域(黒領域)とからなり、両領域の境界は 斜めの直線状をなす画像
2)白い地の領域に黒い細線又は一定の幅を持った黒帯領域が斜めにひかれているような 画像、またはその反転画像
3)白い地の領域に黒い太さが様々な平行線群が斜めにひかれているような画像、または その反転画像
As described above, the image processing method described in the embodiment of the present invention and the image processing apparatus equipped with this algorithm are used in an aerial photograph process as an angle correction function of an image reading apparatus in an industrial product manufacturing process or inspection process. It can be used in various industrial fields. In particular, it is suitable for processing for handling the following images.
1) It consists of a high brightness area (white area) and a low brightness area (black area), and the boundary between the two areas is an oblique straight line. 2) White area has a black thin line or a certain width. 3) An image in which the black belt region is drawn obliquely or its inverted image 3) An image in which parallel lines with various black thicknesses are obliquely drawn in the white background region, or its inverted image

100 画像処理装置
101 中央演算処理部(CPU)
102 表示インターフェース
103 入力インターフェース
104 画像入力インターフェース
106 記憶装置
120 表示部
130 入力部
140 画像入力部



100 Image processing apparatus 101 Central processing unit (CPU)
DESCRIPTION OF SYMBOLS 102 Display interface 103 Input interface 104 Image input interface 106 Storage apparatus 120 Display part 130 Input part 140 Image input part



Claims (5)

対象画像に支配的な直線の角度を検出するための画像処理方法であって、
画像の各画素の画素値に関するグラジェントベクトルを求める段階、
前記グラジェントベクトルの集合に関する原点まわりの共分散行列を算出する段階、
前記共分散行列に基づいて主成分分析を施し、第1主成分に直交する方向を求めることにより対象画像に支配的な直線の角度を決定する段階
からなることを特徴とする画像処理方法。
An image processing method for detecting an angle of a straight line dominant in a target image,
Obtaining a gradient vector for the pixel value of each pixel of the image;
Calculating a covariance matrix around the origin for the set of gradient vectors;
An image processing method comprising: performing principal component analysis based on the covariance matrix and determining an angle of a straight line dominant in the target image by obtaining a direction orthogonal to the first principal component.
前記グラジェントベクトルを求める段階は、
各画素をそれぞれ順次着目画素とし、
着目画素を中心とする所定の近傍領域を定め、
近傍領域において重回帰分析を施し、
得られた近似平面を表す数式に基づいてグラジェントベクトルを決定する
ことを特徴とする請求項1に記載の画像処理方法。
The step of obtaining the gradient vector includes:
Each pixel is set as a pixel of interest sequentially,
Define a predetermined neighborhood area centered on the pixel of interest,
Perform multiple regression analysis in the neighborhood,
The image processing method according to claim 1, wherein a gradient vector is determined based on a mathematical expression representing the obtained approximate plane.
前記近傍領域は、
着目画素を中心とする一定半径の円内の画素からなることを
特徴とする請求項2に記載の画像処理方法。
The neighborhood region is
The image processing method according to claim 2, wherein the image processing method includes pixels within a circle having a fixed radius centered on the pixel of interest.
対象画像が請求項1から請求項3の何れかに記載の画像処理方法に適した画像であるかどうかを前記共分散行列に基づく主成分分析の結果得られる第1主成分の寄与率により判定する請求項1に記載の画像処理方法。 Whether the target image is an image suitable for the image processing method according to any one of claims 1 to 3 is determined based on a contribution ratio of a first principal component obtained as a result of principal component analysis based on the covariance matrix. The image processing method according to claim 1. 処理対象画像データ中の支配的な直線の角度を検出する画像処理装置であって、
各画素における画素値のグラジェントベクトルを算出する手段と、
全画素のグラジェントベクトルに対して原点まわりの共分散行列を算出する手段と、
得られた共分散行列に基づいて主成分分析を施し、第1主成分に直交する方向を、求める角度と決定する手段と
を備えたことを特徴とする画像処理装置。
An image processing apparatus that detects an angle of a dominant straight line in image data to be processed,
Means for calculating a gradient vector of pixel values in each pixel;
Means for calculating a covariance matrix around the origin with respect to a gradient vector of all pixels;
An image processing apparatus comprising: a component that performs principal component analysis based on the obtained covariance matrix and determines a direction orthogonal to the first principal component and a desired angle.
JP2014012232A 2014-01-27 2014-01-27 Image processing method and image processing apparatus Expired - Fee Related JP6225722B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014012232A JP6225722B2 (en) 2014-01-27 2014-01-27 Image processing method and image processing apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014012232A JP6225722B2 (en) 2014-01-27 2014-01-27 Image processing method and image processing apparatus

Publications (2)

Publication Number Publication Date
JP2015141440A JP2015141440A (en) 2015-08-03
JP6225722B2 true JP6225722B2 (en) 2017-11-08

Family

ID=53771784

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014012232A Expired - Fee Related JP6225722B2 (en) 2014-01-27 2014-01-27 Image processing method and image processing apparatus

Country Status (1)

Country Link
JP (1) JP6225722B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108090929B (en) * 2017-12-04 2021-12-03 国家海洋局第一海洋研究所 Novel method for analyzing and extracting linear abnormity of mining area
CN115330790B (en) * 2022-10-13 2022-12-27 启东惜时智能科技有限公司 Image-based cable strand quality detection method and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0736173A (en) * 1993-07-15 1995-02-07 Dainippon Printing Co Ltd Image clipping method and device
JP4449522B2 (en) * 2004-03-23 2010-04-14 富士ゼロックス株式会社 Image inspection device with tilt detection function

Also Published As

Publication number Publication date
JP2015141440A (en) 2015-08-03

Similar Documents

Publication Publication Date Title
JP5542889B2 (en) Image processing device
EP3306562B1 (en) Image processing method and device
JP4816725B2 (en) Image processing apparatus, image processing program, electronic camera, and image processing method for image analysis of lateral chromatic aberration
US20070127821A1 (en) Image processing apparatus
US9196034B2 (en) Method of fast analysis of the relief elements featuring on the internal surface of a tyre
CN111080661A (en) Image-based line detection method and device and electronic equipment
US20130336597A1 (en) Image stabilization apparatus, image stabilization method, and document
US20110199491A1 (en) Calibration index determination device, calibration device, calibration performance evaluation device, system, method, and program
US10074551B2 (en) Position detection apparatus, position detection method, information processing program, and storage medium
US8594416B2 (en) Image processing apparatus, image processing method, and computer program
EP2226763A2 (en) Image processing method and apparatus for detecting an edge of an object within an image
US11769248B2 (en) Image processing device, image processing method, and image processing non-transitory computer readable medium for verifying detectable range of defect image
KR102242996B1 (en) Method for atypical defects detect in automobile injection products
JP6225722B2 (en) Image processing method and image processing apparatus
KR101583423B1 (en) Method for calibrating distortion of image in camera
JPWO2014013792A1 (en) Noise evaluation method, image processing apparatus, imaging apparatus, and program
EP3014528B1 (en) Determining barcode locations in documents
JP6199799B2 (en) Self-luminous material image processing apparatus and self-luminous material image processing method
JP2008116206A (en) Apparatus, method, and program for pattern size measurement
US8866903B2 (en) Image processing apparatus, image processing method, and computer program
JP2019120644A (en) Surface inspection device and surface inspection method
US10728448B2 (en) Image processing apparatus, image processing method and storage medium to obtain a color difference of an object
KR20220154345A (en) Contour detection device using gaussian-weighted least squares and contour detection method thereof
CN109215068B (en) Image magnification measuring method and device
JP5346304B2 (en) Appearance inspection apparatus, appearance inspection system, and appearance inspection method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20161125

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170925

R150 Certificate of patent or registration of utility model

Ref document number: 6225722

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees