JPH03277910A - Image-size measuring method - Google Patents

Image-size measuring method

Info

Publication number
JPH03277910A
JPH03277910A JP2079510A JP7951090A JPH03277910A JP H03277910 A JPH03277910 A JP H03277910A JP 2079510 A JP2079510 A JP 2079510A JP 7951090 A JP7951090 A JP 7951090A JP H03277910 A JPH03277910 A JP H03277910A
Authority
JP
Japan
Prior art keywords
image
concentrations
average value
concentration
density
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.)
Pending
Application number
JP2079510A
Other languages
Japanese (ja)
Inventor
Michiharu Asai
浅井 道治
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2079510A priority Critical patent/JPH03277910A/en
Publication of JPH03277910A publication Critical patent/JPH03277910A/en
Pending legal-status Critical Current

Links

Landscapes

  • Length Measuring Devices By Optical Means (AREA)
  • Character Input (AREA)
  • Character Discrimination (AREA)

Abstract

PURPOSE:To make it possible to measure an image per picture element highly accurately by obtaining the average value of the concentrations of object images and the average value of the concentrations of a background, obtaining the coordinates of the end of the object image at the concentration within an allowance rage, and performing correction by the concen tration gradient based on the concentration at the outside. CONSTITUTION:At the Yi column, the average value of the concentrations of a work 3, the average value of the concentrations of a background and image data which are stored in a variable-concentration image memory device 11 beforehand are read out and operated in a central processing unit 7. At this time, the average values of concentrations of the work 3 and the background are made to be dw and db. Then a certain allowance range is set for the average value dw. The picture element having the concentrations within the range are obtained in the unit 7. The maximum value and the minimum value of the (x) coordinates of the picture elements are made to be Xmax and Xmin. Then, the concentrations of the coordinate of Xmas + 1 and the coordinate of Xmin-1 are made to be dxmax and dxmin. Then, the total picture-element number num at the Yi column of the work 3 is obtained by the expression. The operation is performed in the unit 7. Thus, linear correction is performed with the coordinates of the end of the object picture element at the concentration within the allowance range, the concentration at the outside of the object image at the concen tration within the allowance rage and the concentration gradient at the end part.

Description

【発明の詳細な説明】 [産業上の利用分野] この発明は、画像処理における画像寸法計測方法に係り
、特に濃淡画像の中にある既知の物体の境界線位置を検
出し、好適な、画像寸法を計測する方法に関するもので
ある。
Detailed Description of the Invention [Industrial Application Field] The present invention relates to an image dimension measurement method in image processing, and in particular detects the boundary line position of a known object in a grayscale image, and It relates to a method of measuring dimensions.

〔従来の技術〕[Conventional technology]

従来、視覚センサにおいて、画像の境界線検出の方法は
、特開昭61−286704号公報に記載のように、画
素間の積和演算をおこない、演算後の値が連続しである
しきい値より大きい範囲について、荷重平均をとり、境
界線上の点を検出する方法、また、点列を求め、近似法
を用いて境界線を方程式の形で表現する方法が知られて
いる。
Conventionally, in a visual sensor, a method for detecting image boundaries is to perform a sum-of-products operation between pixels, as described in Japanese Patent Application Laid-Open No. 61-286704, and to set a threshold value whose value after the operation is continuous. For larger ranges, methods are known in which points on the boundary line are detected by taking a weighted average, and a method in which a sequence of points is determined and the boundary line is expressed in the form of an equation using an approximation method.

第4図、第5図は例えば特開昭61−286’704号
公報に示された従来の画像検出方法を示すものがあり、
第4図は画像の境界線検出方法の原理を示す図、第5図
はエツジ点検出方法の原理を示す図である。
4 and 5 show a conventional image detection method disclosed in, for example, Japanese Patent Laid-Open No. 61-286'704.
FIG. 4 is a diagram showing the principle of the image boundary line detection method, and FIG. 5 is a diagram showing the principle of the edge point detection method.

まず、第4図によって境界線検出方法の原理について説
明する。
First, the principle of the boundary line detection method will be explained with reference to FIG.

入力画像は、第4図(alのように、n画素おきにX軸
に平行なうインを数本走査し、濃度値の変化の大きいエ
ツジ点(境界線上の点)を検出する。
As shown in FIG. 4 (al), the input image is scanned several lines parallel to the X axis every n pixels, and edge points (points on the boundary line) with large changes in density value are detected.

検出したエツジ点から、直線状の境界線を検出するもの
であるため、第4図(b)に示すように直線を形成する
点列を抽出する。そして、第4図(clに示すように1
点列を最小二乗法等の近似法で直線方程式に近似する。
Since a linear boundary line is detected from the detected edge points, a sequence of points forming a straight line is extracted as shown in FIG. 4(b). 1 as shown in Figure 4 (cl.
Approximate the point sequence to a linear equation using an approximation method such as the least squares method.

次に、第5図番こよって工・ソ・ジ点検出方法の原理に
ついて説明する。
Next, the principle of the method for detecting the machining, sock, and jig points will be explained by referring to Figure 5.

入力画像を、第4図fa)のように、X方向をこ走査し
たときに、各々の画素のもつ濃度値をG (x。
When the input image is scanned in the X direction as shown in FIG. 4 fa), the density value of each pixel is G (x.

y)走査するラインをY=Jとした場合、F (X) 
=G (x±1、y)−G (x′+1.y)(符号同
順) を計算するものである。その結果、第5図(a)のよう
な濃度値が、第5図(b)に示すものとなる。
y) If the scanning line is Y=J, then F (X)
=G (x±1, y)-G (x'+1.y) (same order of signs). As a result, the density values as shown in FIG. 5(a) become as shown in FIG. 5(b).

このF (x)が、連続しであるしきい値TH以上であ
る範囲について荷重平均をとる。つまり、X=is−i
eまでの間、F (x)がTH以上であるとすると、次
式を計算するものである。
A weighted average is taken for a range in which F (x) is continuously greater than or equal to a certain threshold value TH. That is, X=is-i
Assuming that F (x) is greater than or equal to TH until e, the following equation is calculated.

Σ”F(x)  ・X H= 父 F  (x) この計算結果と走査ラインの位置とで、(x。Σ”F(x) ・X H= Father F (x) With this calculation result and the position of the scanning line, (x.

y)= (H,J)としてエツジ点位置を求める。Find the edge point position as y) = (H, J).

[発明が解決しようとする課題] 従来の画像寸法計測方法では、注目画素の左右(x+1
とx−1)の濃度差を求めており、物体の境界が1画素
以内に収まっている場合などに、境界点を精度よく求め
るためには、THの値を小さくとり、より多くのT 8
以上である点からの荷重平均をとる必要がある。しかし
、この場合は注目ライン上のノイズの影響を受けやすく
なる。逆に、THの値を大きくすればノイズの影響は少
なくなるものの境界点の精度は悪くなるという問題点が
あった。
[Problem to be solved by the invention] In the conventional image dimension measurement method, the left and right (x+1
and x-1), and in order to accurately determine the boundary point, such as when the boundary of the object is within one pixel, the value of TH should be set small and more T8
It is necessary to take the weighted average from a certain point. However, in this case, it becomes susceptible to the influence of noise on the line of interest. Conversely, if the value of TH is increased, the influence of noise will be reduced, but there is a problem in that the accuracy of boundary points will deteriorate.

この発明は上記のような問題点を解決するためになされ
たもので、ノイズの影響を少な(し、1画素当りの長さ
を精度よ(定義し精度のよい計測を容易に行なうことが
できる画像寸法計測方法を提供することにある。
This invention was made to solve the above-mentioned problems, and it is possible to reduce the influence of noise (and to define the length per pixel with high precision), making it possible to easily perform accurate measurements. An object of the present invention is to provide a method for measuring image dimensions.

[課題を解決するための手段] この発明に係る画像寸法計測方法は、TV左カメラを用
いて対象画像を取り込み、画像の濃度の平均値と背景の
平均値を求める段階と、許容範囲内の濃度の対象画像の
端の座標を求める段階と、許容範囲内の濃度の対象画像
の端の外側の濃度を求める段階と、端部における濃度匂
配によって直線補正を加えることにより、対象画像の画
素数を求める段階と、1画素当りの画像寸法を求める段
階とから成る。
[Means for Solving the Problems] The image size measurement method according to the present invention includes the steps of capturing a target image using a TV left camera, calculating the average value of the density of the image and the average value of the background, and The pixels of the target image are calculated by calculating the coordinates of the edge of the target image for density, calculating the density outside the edge of the target image for density within the allowable range, and applying linear correction based on the density distribution at the edge. It consists of a step of calculating the number and a step of calculating the image size per pixel.

〔作用〕[Effect]

この発明における画像寸法計測方法は、対象画像の濃度
の平均値と背景の濃度の平均値を求め、許容範囲内の濃
度の対象画像の端の座標を求め、その外側の濃度とから
濃度匂配による補正を加え、対象画像の画素数を求め、
1画素当りの画像寸法を求める。
The image dimension measurement method in this invention calculates the average value of the density of the target image and the average value of the density of the background, determines the coordinates of the edge of the target image whose density is within the allowable range, and calculates the density gradient from the outside density. Calculate the number of pixels in the target image by adding correction by
Find the image size per pixel.

[発明の実施例1 以下、この発明の一実施例を図について説明する。[Embodiment 1 of the invention An embodiment of the present invention will be described below with reference to the drawings.

第1図において、(2)は上位コントローラ、(3)は
対象画像となる矩形の対象ワーク、(4)は被対象物で
ある対象ワーク(3)の像を、取り込むカメラ、(5)
は画像を表示するモニタ表示器、(6)は上記対象ワー
ク(3)の実測値の人力を行なうキーボード、(7)は
中央処理装置、(8)は中央処理装置(7)で実行すべ
きプログラムやデータ等を格納する記憶回路、(9)は
濃淡画像入力回路、(lO)はランレングスデータを生
成する画像処理回路、(11)は濃淡画像記憶回路、(
12)はモニタインタフェイス回路、(13)はキーボ
ードインタフェイス回路、(14)は上位インタフェイ
ス回路で、中央処理装置(7)、記憶回路(8)、濃淡
画像入力回路(9)、画像処理回路(lO)、濃淡画像
記憶回路(11)、モニタインタフェイス回路(12)
、キーボードインクフェイス回路(13)、上位インタ
フェイス回路(14)とによって視覚センサ制御装置f
l)が構成されている。
In Fig. 1, (2) is the upper controller, (3) is the rectangular target workpiece that is the target image, (4) is the camera that captures the image of the target workpiece (3), and (5) is the target object.
is the monitor display that displays the image, (6) is the keyboard that manually performs the actual measurement of the target workpiece (3), (7) is the central processing unit, and (8) is to be executed by the central processing unit (7). A memory circuit for storing programs, data, etc., (9) a grayscale image input circuit, (lO) an image processing circuit that generates run length data, (11) a grayscale image storage circuit, (
12) is a monitor interface circuit, (13) is a keyboard interface circuit, and (14) is a host interface circuit, which includes a central processing unit (7), a memory circuit (8), a grayscale image input circuit (9), and an image processing circuit. circuit (lO), gray scale image storage circuit (11), monitor interface circuit (12)
, a keyboard ink face circuit (13), and a host interface circuit (14).
l) is configured.

次に、上記構成による装置の動作について説明する。Next, the operation of the apparatus with the above configuration will be explained.

第2図、第3図において、カメラ(4)によって矩形の
対象ワーク(3)の画像を読み取り後、ビデオ信号に変
換して濃淡画像入力回路(9)に供給する。濃淡画像入
力回路(9)ではアナログのビデオ信号を8bit、2
56階調のデジタル信号に変換を行ない、出力画像を濃
淡画像記憶回路(11)に供給する。そしてモニタ表示
器(5)には、濃淡画像入力回路(9)から出力される
原画像あるいは、256階調の濃淡画像等が画像選択さ
れ、モニタインタフェイス回路(12)を介して表示さ
れる。一方、オペレータはキーボード(6)より矩形の
対象ワーク(3)の実測値の入力を行なう。
In FIGS. 2 and 3, after an image of a rectangular target workpiece (3) is read by a camera (4), it is converted into a video signal and supplied to a grayscale image input circuit (9). The grayscale image input circuit (9) receives an 8-bit, 2-bit analog video signal.
It is converted into a 56-gradation digital signal and the output image is supplied to a grayscale image storage circuit (11). Then, the original image output from the grayscale image input circuit (9) or a grayscale image with 256 gradations is selected and displayed on the monitor display (5) via the monitor interface circuit (12). . On the other hand, the operator inputs actual measured values of the rectangular target workpiece (3) using the keyboard (6).

次に、中央処理装置(7)は濃淡画像記憶回路fil)
の画像データより以下の方法で1画素当りの画像寸法を
算出する。第3図(a)−に示す画像の場合、各画素は
それぞれ濃度をもっている。ここでYi行目において、
矩形ワーク(3)の濃度の平均値と背景の濃度の平均値
とを先に濃淡画像記憶回路(11)に記憶されている画
像データを呼び出し、中央処理装置(7)にて演算処理
する。(第2図に示すステップ5IOI)。矩形ワーク
(3)、背景の濃度の平均値をそれぞれdw、dbとす
る。次に矩形ワーク(3)の濃度の平均値dwに対して
、ある許容範囲を設定し、その許容範囲内の濃度の画素
を中央処理袋M(7)にて求め、また、それらの画素の
X座標の最大値、最小値をそれぞれXmax、X m 
i nとする。(第2図に示すステ・ツブ5102)。
Next, the central processing unit (7) is a grayscale image storage circuit (fil)
The image size per pixel is calculated from the image data using the following method. In the case of the image shown in FIG. 3(a), each pixel has its own density. Here, in the Yi line,
The image data stored in the gradation image storage circuit (11) is first read from the average value of the density of the rectangular workpiece (3) and the average value of the density of the background, and arithmetic processing is performed by the central processing unit (7). (Step 5IOI shown in FIG. 2). Let dw and db be the average values of the density of the rectangular work (3) and the background, respectively. Next, a certain tolerance range is set for the average value dw of the density of the rectangular workpiece (3), and pixels with a density within the tolerance range are determined using the central processing bag M (7). The maximum value and minimum value of the X coordinate are Xmax and X m, respectively.
Let it be in. (Step 5102 shown in FIG. 2).

次にX m a x + 1の座標と、X m i n
 −1の座標の画素の濃度をdxmax、dxmi n
とすると、矩形ワーク(3)のYi行目における全画素
数numを次式によって求める。この演算処理は中央処
理装置(7)にて行なわれる。(第2図に示すステップ
5103.5104)。
Next, the coordinates of X m a x + 1 and X m i n
-1 coordinate pixel density is dxmax, dxmin
Then, the total number of pixels num in the Yi-th row of the rectangular work (3) is determined by the following equation. This arithmetic processing is performed by the central processing unit (7). (Steps 5103 and 5104 shown in FIG. 2).

n u m = (X m a x −X m i n
 + 1 ) +上記、式lより明らかな通り、許容範
囲内の濃度の対象画像の端の座標、許容範囲内の濃度の
対象画像の外側の濃度、および端部における濃度匂配に
よって直線補正を加えることとなる。次に既にオペレー
タにより入力された矩形ワーク(3)の実測値をLen
gthとすると1画素当りの画像寸法(長さ5fact
)は、 となり、上記演算処理は、中央処理装置(7)にて吏行
処理される。(第2図に示すステ・ツブ5105)この
ような手順で求められた1画素当りの画像寸法は、デー
タをモニタ表示器(5)に表示し、記憶回路(8)に記
憶される。(第2図に示すステ・ツブ5IQ6) 。
n u m = (X m a x - X m i n
+ 1) +As is clear from the above equation 1, linear correction is performed using the coordinates of the edges of the target image whose density is within the allowable range, the density outside the target image whose density is within the allowable range, and the density gradient at the edges. I will add it. Next, Len
If gth is the image size per pixel (length 5fact
) becomes, and the above calculation process is performed by the central processing unit (7). (Step 5105 shown in FIG. 2) The image size per pixel obtained through such a procedure is displayed on the monitor display (5) and stored in the storage circuit (8). (Step 5IQ6 shown in Figure 2).

このデータは、例えば長さ、位置などの特微量を求める
際、画素単位をmmあるいはcmなとの単位変換のため
の基準値として用いられる。
This data is used as a reference value for converting the pixel unit into mm or cm when determining characteristic quantities such as length and position.

なお、上述した実施例においては、あるX座標について
1画素当りの水平方向の長さについて求めたが、同様に
垂直方向についても求めることができ、また、処理を数
行について行ない、その平均値を求めてもよい。
In addition, in the above-mentioned example, the length in the horizontal direction per pixel was determined for a certain X coordinate, but it is also possible to determine the length in the vertical direction in the same way. You may also ask for

また、濃淡画像入力回路(9)では、8bit、256
階調のデジタル信号に変換する例を示したが、たとえば
、6bit、7bitなど他の階調であってもよく、上
記実施例と同様の効果を奏する。
In addition, in the grayscale image input circuit (9), 8 bits, 256
Although an example of converting to a digital signal with gradations has been shown, other gradations such as 6 bits or 7 bits may be used, and the same effects as in the above embodiments can be achieved.

[発明の効果] 以上のように、この発明によれば対象画像の濃度の平均
値と背景の濃度の平均値を求め、許容範囲内の濃度の対
象画像の端の座標を求め、その外側の濃度とから、濃度
匂配による補正を加え、対象画像の画素数を求め、1画
素当りの両座寸法を求めるように構成したので、ノイズ
の影響が少なく1画素当りの画像寸法を容易に精度よく
定義することができ、また、長さ、位置などの特微量を
求 める際にも精度よく計測できるという効果がある。
[Effects of the Invention] As described above, according to the present invention, the average value of the density of the target image and the average value of the background density are determined, the coordinates of the edge of the target image with the density within the allowable range are determined, and the coordinates of the edge of the target image with the density within the allowable range are determined. The structure is configured to calculate the number of pixels of the target image by adding correction based on the density gradient, and calculate the two-sided dimension per pixel, so the image size per pixel can be easily and accurately determined with less influence of noise. It has the advantage of being able to be well defined and being able to measure accurately when determining characteristic quantities such as length and position.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図〜第3図はこの発明の一実施例に係り、第1図は
視覚センサーによる画像寸法計測方法の装置のブロック
図、第2図は制御動作のフローチャート、第3図は濃淡
画像の説明図、第4図、第5図は従来の画像寸法計測方
法に係り、第4図は画像の境界線検出方法の原理を示す
図、第5図はエツジ点検出方法の原理を示す図である。 図において、fl)は視覚センサ制御装置、(2)は上
位コントローラ、(3)はワーク、(4)はカメラ、(
5)はモニタ表示器、(6)はキーボード、(7)は中
央処理装置、(8)は記憶回路、(9)は濃淡画像入力
回路、(lO)は画像処理回路、(ll)はall両画
像記憶回路(12)はモニタインタフェイス回路、(1
3)はキーボードインタフェイス回路、(14)は上位
インタフェイス回路である。 なお、図中、同一符号は同一 または相当部分を示す。
1 to 3 relate to one embodiment of the present invention, in which FIG. 1 is a block diagram of an apparatus for an image size measurement method using a visual sensor, FIG. 2 is a flowchart of control operation, and FIG. The explanatory diagrams, FIGS. 4 and 5, relate to the conventional image dimension measurement method, with FIG. 4 showing the principle of the image boundary line detection method, and FIG. 5 showing the principle of the edge point detection method. be. In the figure, fl) is a visual sensor control device, (2) is a host controller, (3) is a workpiece, (4) is a camera, (
5) is a monitor display, (6) is a keyboard, (7) is a central processing unit, (8) is a memory circuit, (9) is a grayscale image input circuit, (lO) is an image processing circuit, (ll) is all Both image storage circuits (12) are connected to a monitor interface circuit (12).
3) is a keyboard interface circuit, and (14) is a high-level interface circuit. In addition, the same symbols in the figures indicate the same or equivalent parts.

Claims (1)

【特許請求の範囲】[Claims] TVカメラ等を用いて対象画像を取り込み、画像の濃度
の平均値と背景の濃度の平均値を求める段階と、許容範
囲内の濃度の対象画像の端の座標を求める段階と、許容
範囲内の濃度の対象画像の端の外側の濃度を求める段階
と、端部におる濃度匂配によって直線補正を加えること
により、対象画像の画素数を求める段階と、1画素当り
の画像寸法を求める段階とから成る画像寸法計測方法。
A step in which a target image is captured using a TV camera, etc., and the average value of the density of the image and the average value of the background density are determined; a step of determining the coordinates of the edge of the target image with a density within the tolerance range; A step of calculating the density outside the edge of the target image, a step of calculating the number of pixels of the target image by applying linear correction according to the density gradient at the edge, and a step of calculating the image size per pixel. An image dimension measurement method consisting of:
JP2079510A 1990-03-28 1990-03-28 Image-size measuring method Pending JPH03277910A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2079510A JPH03277910A (en) 1990-03-28 1990-03-28 Image-size measuring method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2079510A JPH03277910A (en) 1990-03-28 1990-03-28 Image-size measuring method

Publications (1)

Publication Number Publication Date
JPH03277910A true JPH03277910A (en) 1991-12-09

Family

ID=13691955

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2079510A Pending JPH03277910A (en) 1990-03-28 1990-03-28 Image-size measuring method

Country Status (1)

Country Link
JP (1) JPH03277910A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009300138A (en) * 2008-06-11 2009-12-24 Meidensha Corp Line sensor focal distance measuring apparatus using image processing
JP2010019651A (en) * 2008-07-10 2010-01-28 True Soltec Kk Wire terminal inspecting device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009300138A (en) * 2008-06-11 2009-12-24 Meidensha Corp Line sensor focal distance measuring apparatus using image processing
JP2010019651A (en) * 2008-07-10 2010-01-28 True Soltec Kk Wire terminal inspecting device

Similar Documents

Publication Publication Date Title
CN101459765B (en) Method and circuit for correcting dead pixel in video signal
CN111967345A (en) Method for judging shielding state of camera in real time
JP3924796B2 (en) Pattern position measuring method and measuring apparatus
CN113160223A (en) Contour determination method, contour determination device, detection device and storage medium
JPH03277910A (en) Image-size measuring method
US4984075A (en) Contour detecting apparatus
JP3127598B2 (en) Method for extracting density-varying constituent pixels in image and method for determining density-fluctuation block
JP2961140B2 (en) Image processing method
JP4560969B2 (en) Defect inspection method
JPH0560539A (en) Size measurement device
JP2569543B2 (en) Hardness tester
JP2733958B2 (en) Long sheet defect inspection equipment
JPH01315884A (en) Pattern tracking method
JPH0310107A (en) Inspecting method utilizing gradation pattern matching
JPH05108800A (en) Picture defect discrimination processor
CN116608816B (en) Calibration method and device for calibrating device of small-angle measuring instrument
RU2351091C2 (en) Method of automatic detection and correction of radial distortion on digital images
JP2969779B2 (en) Shading image processing device
JPH03158710A (en) Image data generating device
JP2000121337A (en) Method and device for image correction
JPH0540014A (en) System for detecting position of object to be measured
JP2513528Y2 (en) Gray image processor
JPS61255484A (en) Detection of crack by picture processing
KR100190702B1 (en) Method for detecting bezel of monitor
Kim et al. Gamma curve determination for each individual pixel on high-resolution flat panel display