JP2000339458A - Image processor - Google Patents

Image processor

Info

Publication number
JP2000339458A
JP2000339458A JP11145154A JP14515499A JP2000339458A JP 2000339458 A JP2000339458 A JP 2000339458A JP 11145154 A JP11145154 A JP 11145154A JP 14515499 A JP14515499 A JP 14515499A JP 2000339458 A JP2000339458 A JP 2000339458A
Authority
JP
Japan
Prior art keywords
measurement
search area
image
area
resetting
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
JP11145154A
Other languages
Japanese (ja)
Inventor
Toshitaka Masui
敏孝 増井
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.)
Sharp Corp
Sharp Manufacturing Systems Corp
Original Assignee
Sharp Corp
Sharp Manufacturing Systems 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 Sharp Corp, Sharp Manufacturing Systems Corp filed Critical Sharp Corp
Priority to JP11145154A priority Critical patent/JP2000339458A/en
Publication of JP2000339458A publication Critical patent/JP2000339458A/en
Pending legal-status Critical Current

Links

Landscapes

  • Length Measuring Devices By Optical Means (AREA)
  • Image Processing (AREA)
  • Closed-Circuit Television Systems (AREA)
  • Studio Devices (AREA)
  • Image Analysis (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an image processor which can previously check whether the resetting of a search area is appropriate or not at the time of resetting. SOLUTION: A reference position coordinate P in a reference picture detection area for positioning D1 in a reference search area D2 is detected on picture data of a measurement object which is image-picked up and a measurement object position coordinate Q in a measurement object reference picture detection area D3 in a measurement search area D4 is detected. The propriety of an inspection object (position of label picture 70) is judged from the relative position relation of the measurement object position coordinate Q with respect to the reference potion coordinate P. When the reference search area D2 and the measurement search area D4 are reset, the reference search area D2 and the measurement search area D4 after resetting are judged to be within a whole take-in picture data area 100 or not. When they are not, direction arrow marks M and N to which a CCD camera 2 or the measurement objects are to be shifted are displayed.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、欠陥検査用の画像
処理装置、特に生産ライン検査システムに装備されて生
産される半製品または製品の欠陥(例えばラベルの位置
ずれなど)を検出するための画像処理装置にかかわり、
詳しくはサーチ領域の再設定が適正か否かを、その再設
定時においてあらかじめチェックできるようにするため
の技術に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image processing apparatus for defect inspection, and more particularly, to a method for detecting a defect (for example, a displacement of a label) of a semi-finished product or a product manufactured by being provided in a production line inspection system. Involved in image processing equipment,
More particularly, the present invention relates to a technique for enabling a user to check in advance whether resetting of a search area is appropriate or not at the time of resetting.

【0002】[0002]

【従来の技術】図3は、後述する実施の形態でも用いら
れるものであって、計測対象物をCCDカメラで撮像し
てフレームメモリに一時的に格納した取り込み画像デー
タを視覚的に表したものである。ここでは、計測対象物
を容器とし、検査対象を容器に貼り付けられたラベル
(ラベルの二次元的な位置)であるとする。符号の10
0は取り込み画像データ全領域、50は容器画像、51
は容器本体画像、60はキャップ画像、70はラベル画
像、80は背景画像である。ここで、例えばキャップ画
像60というのはキャップの画像データのことであり、
ラベル画像70というのはラベルの画像データのことで
ある。
2. Description of the Related Art FIG. 3 is also used in an embodiment which will be described later, and is a visual representation of captured image data which is captured by a CCD camera and temporarily stored in a frame memory. It is. Here, it is assumed that the measurement object is a container, and the inspection object is a label (two-dimensional position of the label) attached to the container. Sign 10
0 is the whole area of the captured image data, 50 is the container image, 51
Is a container body image, 60 is a cap image, 70 is a label image, and 80 is a background image. Here, for example, the cap image 60 is cap image data,
The label image 70 is label image data.

【0003】ラベル画像70に位置ずれが生じていない
かどうかの判定は次のように行う。まず、基準の位置を
定めておく必要がある。それを例えばキャップ画像60
の例えば左上角部とし、そこに位置決め用基準画像検出
領域D1を設定するとともに、その位置決め用基準画像
検出領域D1の周囲にそれを取り囲むひとまわり大きい
基準サーチ領域D2を設定する。そして、ラベル画像7
0の検出ポイントを例えば右下角部として、そこに計測
対象基準画像検出領域D3を設定するとともに、その計
測対象基準画像検出領域D3の周囲にそれを取り囲むひ
とまわり大きい計測サーチ領域D4を設定する。基準サ
ーチ領域D2は、CCDカメラによる取り込み画像デー
タ全領域100の内部においてキャップ画像60の左上
角部が存在すると想定される位置に設定し、計測サーチ
領域D4は容器本体画像51と背景画像80との境界8
1を含むと想定される位置に設定する。
[0003] The determination as to whether or not the label image 70 is misaligned is performed as follows. First, it is necessary to determine a reference position. For example, the cap image 60
For example, a positioning reference image detection area D1 is set in the upper left corner, and a slightly larger reference search area D2 surrounding the positioning reference image detection area D1 is set around the positioning reference image detection area D1. And label image 7
The detection point of 0 is set to, for example, the lower right corner, and the measurement target reference image detection area D3 is set there, and a larger measurement search area D4 surrounding the measurement target reference image detection area D3 is set around the measurement target reference image detection area D3. The reference search area D2 is set at a position where the upper left corner of the cap image 60 is assumed to be present inside the entire area 100 of the image data captured by the CCD camera. The measurement search area D4 includes the container body image 51 and the background image 80. Border 8
Set to a position assumed to contain 1.

【0004】まず、CCDカメラによる取り込み画像デ
ータ全領域100において基準サーチ領域D2を高速サ
ーチしてキャップ画像60らしきものを見いだし、メモ
リから読み出したキャップ画像左上角部に相当するテン
プレート画像データと画素比較することのパターンマッ
チングに基づいて、位置決め用基準画像検出領域D1を
抽出し、キャップ画像60の左上角部である基準位置座
標P(X0 ,Y0 )を検出する。
First, a reference search area D2 is searched at high speed in the whole area 100 of image data captured by a CCD camera to find a cap image 60, which is compared with template image data corresponding to the upper left corner of the cap image read from the memory. The positioning reference image detection area D1 is extracted based on the pattern matching to be performed, and the reference position coordinates P (X0, Y0) at the upper left corner of the cap image 60 are detected.

【0005】次に、上記で検出した基準位置座標P(X
0 ,Y0 )に基づいて計測サーチ領域D4を画像データ
上に設定する。これは、例えば次のようにして行う。メ
モリにあらかじめ登録されている基準サーチ領域D2と
計測サーチ領域D4との差分に相当する水平方向の変位
量ΔXと垂直方向の変位量ΔYとを演算によって算出
し、基準位置座標P(X0 ,Y0 )から変位量ΔX,Δ
Yの変位を行った座標を計測対象位置座標Q(X1 ,Y
1 )とし、この計測対象位置座標Q(X1 ,Y1)に基
づいて計測サーチ領域D4を設定するのである。ここ
で、 X1 =X0 +ΔX …………………………………………………(1) Y1 =Y0 +ΔY …………………………………………………(2) である。
Next, the reference position coordinates P (X
0, Y0), the measurement search area D4 is set on the image data. This is performed, for example, as follows. A horizontal displacement .DELTA.X and a vertical displacement .DELTA.Y corresponding to the difference between the reference search area D2 and the measurement search area D4 registered in advance in the memory are calculated by calculation, and the reference position coordinates P (X0, Y0) are calculated. ) To the displacement ΔX, Δ
The coordinates at which the displacement of Y has been performed are represented by coordinates Q (X1, Y
The measurement search area D4 is set based on the measurement target position coordinates Q (X1, Y1). Here, X1 = X0 + ΔX (1) Y1 = Y0 + ΔY (1) Y1 = X0 + ΔX (1) Y1 = Y0 + ΔY (1) ... (2)

【0006】そして、計測サーチ領域D4において高速
サーチを行い、容器本体画像51と背景画像80との境
界81を含んでいることを確認した上で、ラベル画像7
0らしきものを見いだし、メモリから読み出したラベル
画像右下角部に相当するテンプレート画像データと画素
比較することのパターンマッチングに基づいて計測対象
基準画像検出領域D3を抽出し、その計測対象基準画像
検出領域D3での両者の画像データの一致度を算出し、
その一致度が所定のしきい値以上となっているか否かを
判断し、しきい値以上となっているときは欠陥無しすな
わち位置ずれ無しと判定し、しきい値未満のときは欠陥
有りすなわち位置ずれ有りと判定する。欠陥無しとは、
実際の容器においてそれに貼り付けられているラベルの
貼り付け位置が正常ないし許容範囲内であるということ
である。なお、欠陥有りの場合はラベルが貼り付けられ
ていない場合も表すものとし、これは一致度が所定値以
下のときに、そのように判定する。
Then, a high-speed search is performed in the measurement search area D4 to confirm that the boundary 81 between the container body image 51 and the background image 80 is included.
Finding what seems to be 0, extracting a measurement target reference image detection area D3 based on pattern matching of comparing pixels with template image data corresponding to the lower right corner of the label image read from the memory and extracting the measurement target reference image detection area Calculate the degree of coincidence between the two image data in D3,
It is determined whether or not the degree of coincidence is equal to or greater than a predetermined threshold. If the degree of coincidence is equal to or greater than the threshold, it is determined that there is no defect, that is, there is no displacement. It is determined that there is a displacement. No defect means
This means that the position of the label attached to the actual container is normal or within an allowable range. Note that a case where there is a defect indicates a case where no label is attached, and this is determined when the degree of coincidence is equal to or less than a predetermined value.

【0007】さまざまの要因で位置決め用基準画像検出
領域D1の位置ずれが生じる。例えば、CCDカメラの
向きが振動等で変化することがあり、そうなるとCCD
カメラの視野が変化し、同じシャッタタイミング(トリ
ガタイミング)で撮像しても、取り込み画像データ全領
域100の内部での前記の4つの領域D1〜D4に位置
ずれが生じる。昨日のCCDカメラの設定位置や視野方
向などが今日は変化している可能性もある。場合によっ
ては、時間経過とともに変動しているかもしれない。
[0007] Various positional deviations of the positioning reference image detection area D1 occur. For example, the direction of the CCD camera may change due to vibration, etc.
Even if the field of view of the camera changes and images are taken at the same shutter timing (trigger timing), the four regions D1 to D4 within the entire captured image data region 100 are misaligned. It is possible that the setting position of the CCD camera and the direction of the field of view yesterday have changed today. In some cases, it may fluctuate over time.

【0008】それを図4を用いて説明する。図4は、後
述する実施の形態でも用いられるものであって、位置決
め用基準画像検出領域が図3の場合のD1からD1aへ
位置ずれしたものとしている。なお、図3の場合の様子
は二点鎖線で図示している。つまり、取り込み画像デー
タ全領域100の内部において、容器画像50、容器本
体画像51、キャップ画像60およびラベル画像70の
すべてが、水平方向にΔCX、垂直方向にΔCYの位置
ずれを生じたとする。これに伴って、計測対象基準画像
検出領域はD3からD3aへ位置ずれする。なお、基準
サーチ領域D2や計測サーチ領域D4は変わらないもの
とする。
This will be described with reference to FIG. FIG. 4 is also used in an embodiment to be described later, in which the positioning reference image detection area is shifted from D1 in FIG. 3 to D1a. The state in the case of FIG. 3 is shown by a two-dot chain line. That is, it is assumed that the container image 50, the container body image 51, the cap image 60, and the label image 70 all have a positional shift of ΔCX in the horizontal direction and ΔCY in the vertical direction inside the entire captured image data area 100. Accordingly, the measurement target reference image detection area shifts from D3 to D3a. Note that the reference search area D2 and the measurement search area D4 are not changed.

【0009】容器画像50等が取り込み画像データ全領
域100において位置ずれを生じた場合に、基準サーチ
領域D2でサーチした結果として得た位置決め用基準画
像検出領域D1aの座標をPa(X0a,Y0a)とする
と、水平方向および垂直方向の位置ずれ量ΔCX,ΔC
Yはそれぞれ、 ΔCX=X0a−X0 ………………………………………………(3) ΔCY=Y0a−Y0 ………………………………………………(4) である。そして、位置ずれ後の位置決め用基準画像検出
領域D1aを基にした位置ずれ後の計測対象基準画像検
出領域D3aの計測対象位置座標Qa(X1a,Y1a)と
すると、 X1a=X0 +ΔX+ΔCX ………………………………………(5) Y1a=Y0 +ΔY+ΔCY ………………………………………(6) のように補正すればよい。なお、これら式(5),
(6)は式(1),(2)より、それぞれ、 X1a=X1 +ΔCX ………………………………………………(7) Y1a=Y1 +ΔCY ………………………………………………(8) と等価であり、元の計測対象基準画像検出領域D3の座
標Q(X1 ,Y1 )を位置ずれ量ΔCX,ΔCYだけ補
正したことに相当している。
When the container image 50 or the like is displaced in the entire captured image data area 100, the coordinates of the positioning reference image detection area D1a obtained as a result of the search in the reference search area D2 are expressed as Pa (X0a, Y0a). Then, the displacement amounts ΔCX, ΔC in the horizontal direction and the vertical direction
Y is ΔCX = X0a−X0... ...... (3) ΔCY = Y0a−Y0 ……………………………………… ... (4). Then, assuming that the measurement target position coordinates Qa (X1a, Y1a) of the measurement target reference image detection area D3a after the displacement based on the positioning reference image detection area D1a after the displacement, X1a = X0 + ΔX + ΔCX ... ... (5) Y1a = Y0 + ΔY + ΔCY (6) The correction may be made as shown in (6). Note that these equations (5),
(6) is obtained from the expressions (1) and (2) as follows: X1a = X1 + ΔCX (7) Y1a = Y1 + ΔCY (7) (8) is equivalent to correcting the coordinates Q (X1, Y1) of the original measurement target reference image detection area D3 by the positional deviation amounts ΔCX, ΔCY. Is equivalent.

【0010】このようにして計測対象基準画像検出領域
D3aの位置ずれ補正が行われる。これ以降のパターン
マッチングは、計測サーチ領域D4でのサーチを行っ
て、計測対象基準画像検出領域D3aでの画像データと
テンプレート画像データとの画素比較での一致度がしき
い値よりも大きいか否かを判定する。
[0010] In this manner, the displacement of the reference image detection area D3a to be measured is corrected. In the subsequent pattern matching, a search is performed in the measurement search area D4 to determine whether or not the degree of coincidence in pixel comparison between the image data and the template image data in the measurement target reference image detection area D3a is greater than a threshold value. Is determined.

【0011】欠陥有りすなわち位置ずれ有りと判定した
ときは、一般的には警報または警告を発することが行わ
れる。そのとき直ちに生産ラインを停止するか、それと
もある程度時間をおいて様子を見てから停止するかす
る。
When it is determined that there is a defect, that is, a position shift, an alarm or a warning is generally issued. At that time, the production line may be stopped immediately or after waiting for a while to see the situation.

【0012】[0012]

【発明が解決しようとする課題】上記した従来の技術に
は次のような問題点がある。生産ラインの稼働中におい
て、パターンマッチングの画像処理にマッチングミスな
どの不具合が発生することがある。すなわち、ラベルに
位置ずれが発生していないにもかかわらず、位置ずれ有
りの警報をしてしまうことがある。あるいは、逆に、ラ
ベルに位置ずれが発生しているにもかかわらず、位置ず
れ無しと誤判定してしまう場合もある。要するに、エラ
ーが発生するわけであるが、そのエラー発生率が高い
と、生産の歩留まりが低下する。そこで、そのような事
態が発生した場合、あるいは発生すると予想される場合
には、基準サーチ領域D2や計測サーチ領域D4の設定
のし直しを行う。
The above-mentioned prior art has the following problems. During operation of the production line, a problem such as a matching error may occur in the image processing of the pattern matching. That is, there is a case where a warning is issued that there is a displacement even though no displacement has occurred in the label. Or, conversely, there may be a case where a misalignment is determined to be no misalignment despite the misalignment of the label. In short, an error occurs, but if the error occurrence rate is high, the production yield decreases. Therefore, when such a situation occurs or is expected to occur, the reference search area D2 and the measurement search area D4 are reset.

【0013】また、何らかの事情により、計測対象物が
CCDカメラの視野すなわち取り込み画像データ全領域
100の範囲から外側へはみ出すことがある。計測対象
物自体がはみ出さないまでも、計測サーチ領域D4がは
み出すことがある。そして、このような事態が継続し、
元の正常な状態には復帰しない場合がある。このように
なると、継続的に、パターンマッチングが不可能になっ
たり、パターンマッチングの精度が大幅に低下したりす
る。これでは生産の歩留まりの低下を招く。そこで、そ
のような事態が発生した場合、あるいは発生すると予想
される場合には、上記と同様に、基準サーチ領域D2や
計測サーチ領域D4の設定のし直しを行う。
Also, for some reason, the object to be measured may protrude outward from the field of view of the CCD camera, ie, the entire captured image data area 100. Even if the measurement object itself does not protrude, the measurement search area D4 may protrude. And such a situation continues,
It may not return to the original normal state. In this case, the pattern matching becomes impossible continuously or the precision of the pattern matching is greatly reduced. This leads to a decrease in production yield. Therefore, when such a situation occurs or is expected to occur, the reference search area D2 and the measurement search area D4 are reset as described above.

【0014】このような基準サーチ領域D2や計測サー
チ領域D4の再設定により、エラー発生率をゼロに近づ
けるのである。この場合、場合によっては、CCDカメ
ラの画角を変更して視野を調整することも行われる。
By resetting the reference search area D2 and the measurement search area D4, the error occurrence rate approaches zero. In this case, in some cases, the field of view is adjusted by changing the angle of view of the CCD camera.

【0015】このような再設定は、オペレータによるマ
ニュアル作業(人為的作業)によって行われる。このマ
ニュアルによるサーチ領域の再設定の作業について説明
すると、まず、CCDカメラの視野内に計測対象物の全
体が入るように、計測対象物を位置調整する。このと
き、もちろん、計測対象物を搬送するコンベヤなどの搬
送手段は停止させておく。計測対象物をCCDカメラで
撮像した映像はモニタに映し出されている。そのモニタ
の映出の状況も勘案しながら、オペレータは計測対象物
の位置を調整したり、あるいはCCDカメラの視野を調
整したりする。
Such resetting is performed by a manual operation (artificial operation) by an operator. The operation of resetting the search area according to this manual will be described. First, the position of the measurement target is adjusted so that the entire measurement target falls within the field of view of the CCD camera. At this time, of course, the transport means such as a conveyor for transporting the measurement object is stopped. An image of the object to be measured captured by the CCD camera is displayed on a monitor. The operator adjusts the position of the object to be measured or adjusts the field of view of the CCD camera while also taking into account the state of projection on the monitor.

【0016】そして、CCDカメラによる取り込み画像
データ全領域100内における計測対象物画像の相対的
位置関係は一応これでよいと確認したうえで、基準サー
チ領域D2と計測サーチ領域D4の再設定を行う。まず
は、基準サーチ領域D2の再設定を行い、続いて計測サ
ーチ領域D4の再設定を行う。まず、基準サーチ領域D
2の設定についてであるが、例えばキャップ画像60の
左上角部を位置決め用基準画像検出領域D1とするよう
に、その周囲に基準サーチ領域D2を設定する。続いて
は、計測サーチ領域D4の設定に進む。例えばラベル画
像70の右下角部を計測対象基準画像検出領域D3とす
るように、その周囲に計測サーチ領域D4を設定する。
このような作業をすべてマニュアル作業で行っている。
After confirming that the relative positional relationship of the image of the object to be measured in the entire area 100 of the image data captured by the CCD camera is sufficient, the reference search area D2 and the measurement search area D4 are reset. . First, the reference search area D2 is reset, and then the measurement search area D4 is reset. First, the reference search area D
Regarding the setting of 2, the reference search area D2 is set around the cap image 60 such that the upper left corner of the cap image 60 is the reference image detection area D1 for positioning. Subsequently, the process proceeds to the setting of the measurement search area D4. For example, a measurement search area D4 is set around the label image 70 such that the lower right corner of the label image 70 is the measurement target reference image detection area D3.
All such work is done manually.

【0017】さて、このような従来の技術の問題は、上
記のようにして再設定したあとの基準サーチ領域D2お
よび計測サーチ領域D4がはたして許容される範囲内に
あるかどうかのチェックを行わないまま、生産ラインの
稼働を開始するようになっていた。それは、そのような
チェックの機能を有していないからである。そのため、
もしも許容される範囲をはみ出して設定されていた場合
には、そのことに気付かないままの稼働開始ということ
になり、トラブルが発生して初めて設定ミスを認識でき
るという具合であった。そして、トラブルが発生するま
で分からないとなると、トラブル発生までに不良品がす
でに発生している可能性があり、歩留まりが低下するお
それが多分にある。また、生産ラインを停止して、再設
定を行わなければならなくなり、生産効率の大幅な低下
をもたらす。オペレータにとっても作業負担が大きなも
のとなる。しかも、その再設定によっても、再びトラブ
ルを起こす可能性がゼロになるわけではなく、再々のト
ラブル発生を招かないとも限らないのである。
The problem of the prior art is that the reference search area D2 and the measurement search area D4 after resetting as described above are not checked to see if they are within the allowable range. As a result, the production line started to operate. This is because it does not have such a check function. for that reason,
If the setting is outside the allowable range, the operation is started without noticing that, and the setting error can be recognized only after a trouble occurs. If it is not known until a trouble occurs, there is a possibility that a defective product has already occurred before the trouble occurs, and there is a possibility that the yield may decrease. In addition, the production line must be stopped and resetting must be performed, resulting in a significant decrease in production efficiency. The work load is also heavy for the operator. In addition, the resetting does not necessarily eliminate the possibility of causing a trouble again, and does not guarantee that trouble will occur again.

【0018】あらかじめ知るようにするためには、ユー
ザーが机上で計算するなどして、再設定の結果の基準サ
ーチ領域D2や計測サーチ領域D4が取り込み画像デー
タ全領域100をはみ出さない範囲での再設定であるか
否かをチェックすればよいが、そのような計算は非常に
面倒である。
In order for the user to know in advance, for example, the user performs a calculation on a desk or the like, so that the reference search area D2 or the measurement search area D4 as a result of resetting does not protrude from the whole area 100 of the captured image data. It is sufficient to check whether the setting is reset or not, but such a calculation is very troublesome.

【0019】本発明は上記した課題の解決を図るべく創
作したものであって、サーチ領域の再設定が適正か否か
を、その再設定時においてあらかじめチェックすること
のできる画像処理装置を提供することを目的としてい
る。
The present invention has been made in order to solve the above-mentioned problem, and provides an image processing apparatus which can check in advance whether resetting of a search area is appropriate or not at the time of resetting. It is intended to be.

【0020】[0020]

【課題を解決するための手段】上記した課題の解決を図
ろうとする本発明にかかわる請求項1の画像処理装置
は、次のような構成となっている。理解を容易にするた
め後述する実施の形態にかかわる図面で用いた符号を併
記して記述する。撮像した計測対象物の画像データにつ
いて基準サーチ領域D2内の位置決め用基準画像検出領
域D1での基準位置座標P(X0 ,Y0 )を検出すると
ともに計測サーチ領域D4内の計測対象基準画像検出領
域D3での計測対象位置座標Q(X1 ,Y1 )を検出
し、前記基準位置座標P(X0 ,Y0 )に対する前記計
測対象位置座標Q(X1 ,Y1 )の相対的位置関係から
検査対象の良否を判定する画像処理装置であって、前記
基準サーチ領域D2および前記計測サーチ領域D4と取
り込み画像全領域100との相対位置がずれている状態
で行う再設定のときに、初期設定時の取り込み画像全領
域100に対する両サーチ領域D2,D4の相対的位置
関係が再設定後でも同じになるように補正を行うことに
より、前記計測サーチ領域D4のみを移動させても前記
基準サーチ領域D2の再設定が不要になるように、すな
わち、その再設定後の基準サーチ領域D2および計測サ
ーチ領域d4が取り込み画像データ全領域100の内部
に収まっているか否かを判定するように構成してある。
この構成によると、次のような作用がある。すなわち、
基準サーチ領域D2および計測サーチ領域D4の再設定
において、再設定後の基準サーチ領域D2および計測サ
ーチ領域D4が取り込み画像データ全領域100の内部
に収まっているものであるか否かについて、その再設定
の段階ですでにチェックすることができるため、実際の
計測実行においては、基準位置座標Pの位置ずれが基準
サーチ領域D2の範囲内であればどのような位置ずれで
あっても、再設定後の基準サーチ領域D2や計測サーチ
領域D4が取り込み画像データ全領域100からはみ出
すというトラブルは発生しない。また、再設定後の基準
サーチ領域D2や計測サーチ領域D4が取り込み画像デ
ータ全領域100の内部に収まっているか否かの判定の
チェックが自動的に行われるため、オペレータがいちい
ち机上で計算するなどして人為的に判断するわずらわし
さは生じない。そして、実際の計測実行においてはみ出
しのトラブルを生じさせることがなく、生産ラインがそ
の稼働中に不測にストップするなどの不具合の発生を抑
制でき、再度の設定のし直しによる生産効率の低下は招
かないですむ。
The image processing apparatus according to the first aspect of the present invention, which aims to solve the above-mentioned problems, has the following configuration. To facilitate understanding, reference numerals used in the drawings relating to the embodiments described later are also described. For the image data of the imaged measurement target, the reference position coordinates P (X0, Y0) in the positioning reference image detection area D1 in the reference search area D2 are detected, and the measurement target reference image detection area D3 in the measurement search area D4. The coordinates Q (X1, Y1) of the measurement target position are detected, and the quality of the inspection target is determined from the relative positional relationship of the coordinates Q (X1, Y1) of the measurement target position with respect to the reference position coordinates P (X0, Y0). An image processing apparatus for performing initialization in a state where the relative positions of the reference search area D2 and the measurement search area D4 and the captured image entire area 100 are shifted from each other; By performing correction so that the relative positional relationship between the two search areas D2 and D4 with respect to 100 is the same even after resetting, only the measurement search area D4 is moved. In this case, it is determined whether or not the reference search area D2 needs to be reset, that is, whether the reference search area D2 and the measurement search area d4 after the reset are included in the entire captured image data area 100. It is configured to determine.
According to this configuration, the following operation is provided. That is,
In the resetting of the reference search area D2 and the measurement search area D4, it is determined whether or not the reset reference search area D2 and the measurement search area D4 fall within the entire captured image data area 100. Since the check can be already performed at the setting stage, in the actual measurement execution, even if the positional deviation of the reference position coordinate P is within the range of the reference search area D2, the position is reset regardless of the positional deviation. The trouble that the later reference search area D2 or measurement search area D4 protrudes from the whole captured image data area 100 does not occur. In addition, since the reference search area D2 and the measurement search area D4 after the resetting are automatically checked to determine whether or not they fall within the entire captured image data area 100, the operator can calculate each time on the desk. There is no annoyance of artificial judgment. Further, in the actual measurement execution, no protruding trouble occurs, and it is possible to suppress the occurrence of troubles such as the production line being stopped unexpectedly during its operation, and a decrease in the production efficiency due to the resetting of the setting is caused. You don't have to.

【0021】本発明にかかわる請求項2の画像処理装置
は、上記請求項1において、前記の再設定後の基準サー
チ領域および計測サーチ領域が取り込み画像データ全領
域の内部に収まっていないときは、撮像手段の視野変更
のための移動方向の指示の表示または計測対象物の移動
方向の指示の表示を行うように構成したものである。こ
の構成によると、移動方向の指示を見たオペレータは、
その指示に従って撮像手段または計測対象物を移動させ
ればよいので、再設定における補正の作業を迅速,容易
に行うことができる。
According to a second aspect of the present invention, in the first aspect, when the reference search area and the measurement search area after the resetting do not fall within the entire captured image data area, It is configured to display an instruction of a moving direction for changing the field of view of the imaging means or an instruction of a moving direction of the measurement target. According to this configuration, the operator who sees the instruction of the moving direction,
Since the imaging means or the object to be measured may be moved in accordance with the instruction, the work of the correction in the resetting can be performed quickly and easily.

【0022】本発明にかかわる請求項3の画像処理装置
は、上記請求項1,2において、必要に応じて、位置ず
れ判定条件の補正を行い、その補正後の位置ずれ判定条
件が許容範囲に収まっているか否かを判定するように構
成したものである。この構成による作用は次のようにな
る。撮像手段の移動または計測対象物の移動によって位
置ずれ判定条件が変化するようなアルゴリズムの場合も
あり得る。この場合、位置ずれ判定条件も補正し、それ
が許容範囲内か否かをチェックし、許容範囲内でなけれ
ば、位置ずれ判定条件を再び補正する。したがって、適
正な位置ずれ判定条件を自動的に見いだすことができ
る。
According to a third aspect of the present invention, in the image processing apparatus according to the first and second aspects, the misalignment determination condition is corrected as necessary, and the corrected misalignment determination condition falls within an allowable range. It is configured to determine whether or not it fits. The operation of this configuration is as follows. There may be an algorithm in which the misalignment determination condition changes depending on the movement of the imaging unit or the movement of the measurement target. In this case, the misregistration determination condition is also corrected, and it is checked whether the condition is within the allowable range. If not, the misregistration determination condition is corrected again. Therefore, it is possible to automatically find an appropriate misalignment determination condition.

【0023】本発明にかかわる請求項4の画像処理装置
は、上記請求項1〜3において、前記計測対象物が搬送
されるものであり、その搬送経路の所要の検査ポイント
に前記計測対象物が到達したことを検出する到達検出手
段を備えており、この到達検出手段による検出信号をト
リガとして前記計測対象物の撮像および検査対象の良否
の判定を行うように構成したものである。この構成によ
ると、計測対象物が搬送されるものであっても、その検
査対象をタイミング良く撮像して、上記の作用を得るこ
とが可能となる。
According to a fourth aspect of the present invention, there is provided the image processing apparatus according to any one of the first to third aspects, wherein the measurement target is transported, and the measurement target is located at a required inspection point on the transport route. An arrival detection means for detecting arrival is provided, and the detection signal from the arrival detection means is used as a trigger to image the measurement object and determine the quality of the inspection object. According to this configuration, even if the object to be measured is conveyed, the inspection object can be imaged with good timing, and the above-described operation can be obtained.

【0024】本発明にかかわる請求項5の画像処理装置
は、上記請求項1〜4において、前記計測対象物の検査
対象が画像データ上の二次元的な位置であることを特徴
としている。容器などの半製品または製品に貼り付けら
れているラベルの貼り付け位置や印刷内容の印刷位置の
良否の判定あるいは貼り付けや印刷有無の判定、半導体
チップのピンの位置の良否の判定、プリント基板上に実
装された電子部品の配置の良否の判定、搬送用のトレイ
に載置されている複数の部品の配置の良否の判定などを
行う画像処理装置において、上記の作用が効果的に発揮
される。
According to a fifth aspect of the present invention, in the image processing apparatus according to the first to fourth aspects, the inspection target of the measurement target is a two-dimensional position on image data. Judgment of the labeling position of the semi-finished product such as a container or the label attached to the product or the printing position of the printed contents or judgment of the sticking or printing, judgment of the position of the semiconductor chip pin, judgment of the printed circuit board In the image processing apparatus for determining the quality of the arrangement of the electronic components mounted thereon, the quality of the arrangement of the plurality of components placed on the transport tray, and the like, the above-described operation is effectively exerted. You.

【0025】[0025]

【発明の実施の形態】以下、本発明にかかわる画像処理
装置の実施の形態を図面に基づいて詳細に説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, embodiments of an image processing apparatus according to the present invention will be described in detail with reference to the drawings.

【0026】図1は実施の形態の画像処理装置の電気的
構成を示すブロック図である。図1において、符号の1
は当該の画像処理装置、2は撮影レンズや絞りなどを含
む光学系および固体撮像手段の代表例であるCCD(電
荷結合デバイス)などからなるCCDカメラであり、こ
のCCDカメラ2は、撮影レンズによってCCD上に光
学像を結像し、結像された光学像をCCDで光電変換し
て電気信号として出力するものである。3はCCDカメ
ラ2からのアナログの映像信号(CCD出力信号)をデ
ィジタル化して画像データに変換するA/D変換器、4
はCCDカメラ2、A/D変換器3およびフレームメモ
リ5に対してタイミング信号を出力して画像データの取
得のタイミング制御を行うとともに、フレームメモリ5
およびD/A変換器11に対してタイミング信号を出力
して取得の映像信号の表示のタイミング制御を行うカメ
ラ・表示コントローラ、5は画像データ一時記憶手段の
一例としてのフレームメモリ、6はシステム全体の制御
を司る制御手段の一例としてのCPU(中央演算処理装
置)、7はCPU6による演算・制御等のためのプログ
ラムを格納しているROM(リードオンリーメモリ)、
8はCPU6の演算・制御等を補助するとともにデータ
を格納するRAM(ランダムアクセスメモリ)、9は外
部との間でデータや制御信号の入出力を行う入出力イン
ターフェイス、10はCPU6、ROM7、RAM8、
カメラ・表示コントローラ4、フレームメモリ6および
入出力インターフェイス9を接続するバス、11はフレ
ームメモリ5からカメラ・表示コントローラ4を介して
の画像データをアナログの映像信号に変換するD/A変
換器、12は画像処理装置1に図示しないインターフェ
イスおよびケーブルを介して接続されているCRT(陰
極線管)や液晶ディスプレイ(LCD)などのモニタで
ある。フレームメモリ5は、少なくとも1フレーム分以
上の画像データを蓄積できる画像メモリであって、VR
AM、SRAM、DRAMなどが一般的に使用される
が、ここではバス10とは独立動作可能なVRAMを使
用しているものとする。なお、カメラ・表示コントロー
ラ4とフレームメモリ5とはパラレルなバスラインを介
して接続されている。また、入出力インターフェイス9
には、RAM8に必要な初期値、判定基準等のためのパ
ラメータ、しきい値、その他の条件、必要なデータなど
を設定入力したり、必要な指示を与えたりするためのワ
イヤードリモコンなどの入力操作部13や画像処理装置
1の内部の状況や判断結果などをオペレータや作業者に
知らせるための警報器14やインジケータをそれぞれ個
別のケーブルを介して接続することが可能となってい
る。なお、ワイヤードリモコンに代えてワイヤレスリモ
コンを用いることも可能とし、この場合は、リモコン受
信機の出力端子を入出力インターフェイス9に接続する
ものとする。警報器14としては、LED(発光ダイオ
ード)、蛍光表示管その他任意の発光素子、灯器、ある
いはブザーなどの鳴動器が適用可能とする。さらに、入
出力インターフェイス9には、必要な外部記憶装置15
を接続することができるものとする。その外部記憶装置
15としては、ハードディスクドライブなどの磁気記録
デバイス、MO(Magneto Optics)ディスクドライブや
DVD(Digital Versatile Disk)‐RAMドライブな
どの光磁気記録デバイス、フラッシュメモリ、EEPR
OMその他の不揮発性メモリなどの半導体記憶デバイス
などがある。
FIG. 1 is a block diagram showing an electrical configuration of the image processing apparatus according to the embodiment. In FIG. 1, the symbol 1
Is a CCD camera comprising an optical system including a photographing lens and an aperture, and a CCD (Charge Coupled Device) which is a typical example of solid-state image pickup means. An optical image is formed on a CCD, and the formed optical image is photoelectrically converted by the CCD and output as an electric signal. An A / D converter 3 digitizes an analog video signal (CCD output signal) from the CCD camera 2 and converts it into image data.
Outputs a timing signal to the CCD camera 2, the A / D converter 3, and the frame memory 5 to control the timing of acquiring image data,
And a camera / display controller that outputs a timing signal to the D / A converter 11 to control the timing of displaying the acquired video signal, 5 is a frame memory as an example of image data temporary storage means, and 6 is the entire system. CPU (Central Processing Unit) as an example of control means for controlling the CPU, 7 is a ROM (Read Only Memory) storing a program for calculation and control by the CPU 6,
Reference numeral 8 denotes a RAM (random access memory) for assisting calculation and control of the CPU 6 and storing data, 9 denotes an input / output interface for inputting and outputting data and control signals to and from the outside, 10 denotes a CPU 6, ROM 7, RAM 8 ,
A bus connecting the camera / display controller 4, the frame memory 6 and the input / output interface 9, a D / A converter 11 for converting image data from the frame memory 5 via the camera / display controller 4 into an analog video signal, Reference numeral 12 denotes a monitor such as a CRT (cathode ray tube) or a liquid crystal display (LCD) connected to the image processing apparatus 1 via an interface (not shown) and a cable. The frame memory 5 is an image memory capable of storing at least one frame or more of image data.
AM, SRAM, DRAM, and the like are generally used. Here, it is assumed that a VRAM that can operate independently of the bus 10 is used. The camera / display controller 4 and the frame memory 5 are connected via a parallel bus line. Also, the input / output interface 9
Inputs such as a wired remote controller for setting and inputting parameters, threshold values, other conditions, necessary data, and the like necessary for the RAM 8 for initial values, judgment criteria, and the like, and for giving necessary instructions. It is possible to connect an alarm 14 and an indicator for notifying an operator or an operator of the situation or the judgment result inside the operation unit 13 or the image processing apparatus 1 via individual cables. Note that a wireless remote controller can be used instead of the wired remote controller. In this case, the output terminal of the remote controller receiver is connected to the input / output interface 9. As the alarm 14, an LED (light emitting diode), a fluorescent display tube or any other light emitting element, a lamp, or a buzzer such as a buzzer can be applied. Further, the input / output interface 9 has a necessary external storage device 15.
Can be connected. Examples of the external storage device 15 include a magnetic recording device such as a hard disk drive, a magneto-optical recording device such as an MO (Magneto Optics) disk drive and a DVD (Digital Versatile Disk) -RAM drive, a flash memory, and an EEPROM.
There are semiconductor storage devices such as OM and other nonvolatile memories.

【0027】図2は上記構成の画像処理装置1を適用す
る生産ライン検査システム20の概要を示す。図2にお
いて、符号の21は計測対象物30を搬送するコンベヤ
などの搬送手段、22は搬送手段21の近傍で搬送され
ていく計測対象物30の到達を検出するための到達検出
手段の一例としての光電センサであり、検査ポイントD
Pに配置されている。光電センサ22はケーブル23を
介して画像処理装置1の入出力インターフェイス9に接
続されている。なお、説明の便宜上、図2においては、
CCDカメラ2を画像処理装置1の外側に出して描いて
いるが、実際には、CCDカメラ2は画像処理装置1と
一体となっている。もっとも、CCDカメラ2を画像処
理装置1とは別体構成とし、両者をケーブルで接続した
態様としてもよい。Xは搬送手段21による搬送方向を
示す。
FIG. 2 shows an outline of a production line inspection system 20 to which the image processing apparatus 1 having the above configuration is applied. In FIG. 2, reference numeral 21 denotes a conveyance unit such as a conveyor for conveying the measurement target 30, and 22 denotes an example of an arrival detection unit for detecting arrival of the measurement target 30 conveyed near the conveyance unit 21. The inspection point D
P. The photoelectric sensor 22 is connected to the input / output interface 9 of the image processing apparatus 1 via a cable 23. For convenience of explanation, FIG.
Although the CCD camera 2 is drawn outside the image processing apparatus 1, the CCD camera 2 is actually integrated with the image processing apparatus 1. However, the CCD camera 2 may be configured separately from the image processing apparatus 1 and both may be connected by a cable. X indicates the transport direction of the transport unit 21.

【0028】図2においては、計測対象物30として、
容器本体31にキャップ32を封着しているとともに、
容器本体31にラベル40が貼り付けられた容器30が
示されている。なお、容器30としてはガラスビン、ペ
ットボトルなどのプラスチック容器、紙パック容器、ア
ルミ缶など何であってもよい。また、容器30の内容物
としては液体、粘体、粉体、粒体など何であってもよ
い。ラベル40は、商品名やデザインを付したもの、商
品の仕様・性状等を記載したものなど何であってもよ
い。ラベル40の形状については、長方形、正方形、楕
円形、円形、その他何であってもよいが、ここでは、四
角形であるとしておく。さらには、後に説明するが、計
測対象物30としては、何も容器に限る必要はなく、画
像処理による検査が可能なものであれば、どのようなも
のを検査対象としてもよいことを付記しておく。ここで
の容器30は一例にすぎない。
In FIG. 2, the measurement object 30 is
While cap 32 is sealed to container body 31,
The container 30 in which the label 40 is attached to the container body 31 is shown. Note that the container 30 may be anything such as a plastic container such as a glass bottle and a PET bottle, a paper pack container, and an aluminum can. Further, the contents of the container 30 may be anything such as a liquid, a viscous body, a powder, and a granule. The label 40 may be of any type, such as a label with a product name or design, or a description or specification of the product. The shape of the label 40 may be a rectangle, a square, an ellipse, a circle, or any other shape. In this case, the label 40 is assumed to be a rectangle. Furthermore, as will be described later, it is noted that the measurement target 30 need not be limited to a container, but may be any object as long as it can be inspected by image processing. Keep it. The container 30 here is only an example.

【0029】次に、上記のように構成された実施の形態
の場合の生産ライン検査システム20に適用された画像
処理装置1の動作を説明する。
Next, the operation of the image processing apparatus 1 applied to the production line inspection system 20 in the embodiment configured as described above will be described.

【0030】駆動されている搬送手段21によって複数
の計測対象物30が所定の間隔を隔てて連続的に搬送さ
れていく。検査ポイントDPに達した計測対象物30が
あると、その検査ポイントDPに設置されている到達検
出手段22が動作する。到達検出手段22が光電センサ
の場合は、次のような動作となる。光電センサ22は、
レーザーダイオードなどの発光素子とフォトダイオード
などの受光素子からなり、発光素子から出射したレーザ
ービームなどが計測対象物30に当たって反射し、その
反射光を受光素子で捕捉し、電気信号に変換し増幅する
ことにより到達検出を行う。
A plurality of measuring objects 30 are continuously conveyed at predetermined intervals by the driven conveying means 21. When there is a measurement target 30 that has reached the inspection point DP, the arrival detection means 22 installed at the inspection point DP operates. When the arrival detecting means 22 is a photoelectric sensor, the following operation is performed. The photoelectric sensor 22 includes:
It comprises a light emitting element such as a laser diode and a light receiving element such as a photodiode. A laser beam or the like emitted from the light emitting element hits the measurement object 30 and is reflected. The reflected light is captured by the light receiving element, converted into an electric signal, and amplified. Thus, arrival detection is performed.

【0031】計測対象物30が検査ポイントDPに到達
したことを到達検出手段22が検出すると、到達検出手
段22はその検出信号をトリガ信号として画像処理装置
1に送出する。画像処理装置1においては、その入出力
インターフェイス9を介して入力されてきたトリガ信号
がバス10を介してCPU6に与えられる。CPU6は
トリガ信号を入力すると、カメラ・表示コントローラ4
に起動信号を出力する。カメラ・表示コントローラ4は
起動信号を入力すると、CCDカメラ2、A/D変換器
3、フレームメモリ5およびD/A変換器11に対して
タイミング信号を出力する。
When the arrival detecting means 22 detects that the measurement object 30 has reached the inspection point DP, the arrival detecting means 22 sends the detection signal to the image processing apparatus 1 as a trigger signal. In the image processing apparatus 1, a trigger signal input via the input / output interface 9 is provided to the CPU 6 via the bus 10. When the CPU 6 receives the trigger signal, the camera / display controller 4
Output a start signal. Upon input of the activation signal, the camera / display controller 4 outputs a timing signal to the CCD camera 2, A / D converter 3, frame memory 5 and D / A converter 11.

【0032】CCDカメラ2におけるCCDはタイミン
グ信号を入力すると、その電子シャッタを開き作動さ
せ、被写体である計測対象物30を撮像する。すなわ
ち、計測対象物30の光学像が撮像レンズを介してCC
Dの表面に結像し、CCDはその光学像を信号電荷とし
て蓄積しているが、タイミング信号を入力すると、感光
部のフォトダイオードから垂直転送CCDへの転送およ
び垂直転送CCDから水平転送CCDへの転送を行い、
出力アンプを介して映像信号として出力する。A/D変
換器3はタイミング信号の入力によって起動し、CCD
カメラ2から入力したアナログの映像信号(CCD出力
信号)をディジタルの画像データに変換する。このA/
D変換器3のビット数を例えば8ビットとすると、画像
データは256階調となる。フレームメモリ5はタイミ
ング信号を入力し、A/D変換器3と同期をとった状態
でA/D変換器3からの1フレーム分の画像データを格
納する。なお、8ビットについては、一例にすぎなく
て、仕様に応じて適宜に変更してよいことはいうまでも
ない。
When a timing signal is input to the CCD of the CCD camera 2, the electronic shutter is opened and operated, and an image of the object 30 to be measured is captured. That is, the optical image of the measurement target 30 is transmitted through the imaging lens to the CC.
An image is formed on the surface of D, and the CCD accumulates the optical image as a signal charge. When a timing signal is input, the CCD is transferred from the photodiode of the photosensitive section to the vertical transfer CCD and from the vertical transfer CCD to the horizontal transfer CCD. Transfer
It is output as a video signal via an output amplifier. The A / D converter 3 is activated by the input of a timing signal,
An analog video signal (CCD output signal) input from the camera 2 is converted into digital image data. This A /
If the bit number of the D converter 3 is, for example, 8 bits, the image data has 256 gradations. The frame memory 5 receives the timing signal, and stores the image data for one frame from the A / D converter 3 in synchronization with the A / D converter 3. It is needless to say that 8 bits are merely an example and may be changed as appropriate according to specifications.

【0033】カメラ・表示コントローラ4は、フレーム
メモリ5への画像データの書き込みと並行して、その書
き込んだ画像データをフレームメモリ5から読み出し、
D/A変換器11に転送する。D/A変換器11は、転
送されてきた画像データをアナログの映像信号に変換
し、モニタ12に出力する。なお、モニタ12に至る映
像信号は、図示しない所要のビデオエンコーダなどによ
りNTSC方式などモニタ12に適合した所要のフォー
マットに変換されているものとする。このようにして、
計測対象物30の到達を検出した時点から、その計測対
象物30を被写体像とする映像をモニタ12にリアルタ
イムに映出する。
The camera / display controller 4 reads out the written image data from the frame memory 5 in parallel with the writing of the image data to the frame memory 5,
The data is transferred to the D / A converter 11. The D / A converter 11 converts the transferred image data into an analog video signal and outputs it to the monitor 12. It is assumed that the video signal reaching the monitor 12 has been converted into a required format suitable for the monitor 12 such as the NTSC system by a required video encoder (not shown). In this way,
From the time when the arrival of the measurement target 30 is detected, an image in which the measurement target 30 is a subject image is projected on the monitor 12 in real time.

【0034】カメラ・表示コントローラ4は1フレーム
分の画像データのフレームメモリ5に対する書き込みが
完了すると、その書き込み完了信号をCPU6に出力す
る。その書き込み完了信号を入力したCPU6は、RO
M7から読み出したプログラムおよびRAM8から読み
出した画像処理演算用条件に従って、フレームメモリ5
をアクセスし、フレームメモリ5に格納されている1フ
レーム分の画像データを読み出す。そして、1画素単位
または複数画素の集合であるブロック単位で所要の画像
処理のための演算を実行し、判定のための演算結果をR
AM8にストアする。次に、その演算結果とRAM8か
ら読み出した判定基準との比較を行い、演算結果が正常
であるか否かを判定する。
When the writing of one frame of image data to the frame memory 5 is completed, the camera / display controller 4 outputs a write completion signal to the CPU 6. The CPU 6 that has received the write completion signal outputs the RO
In accordance with the program read from M7 and the image processing calculation conditions read from RAM 8, frame memory 5
To read the image data for one frame stored in the frame memory 5. Then, an operation for required image processing is executed in a unit of one pixel or a block which is a set of a plurality of pixels, and the operation result for determination is represented by R
Store in AM8. Next, the calculation result is compared with a determination reference read from the RAM 8 to determine whether or not the calculation result is normal.

【0035】RAM8には、あらかじめ入力操作部13
から入出力インターフェイス9およびバス10を介して
画像処理演算用条件や判定基準が設定登録されている。
画像処理演算用条件としては、パターンマッチングのた
めの基準サーチ領域D2や計測サーチ領域D4の座標デ
ータなどがある。判定基準としては、テンプレート画像
データなどがある。
The RAM 8 has an input operation unit 13 in advance.
, Image processing calculation conditions and criteria are set and registered via the input / output interface 9 and the bus 10.
The image processing calculation conditions include coordinate data of a reference search area D2 for pattern matching and a measurement search area D4. The judgment criteria include template image data.

【0036】具体的な画像処理は次のとおりである。図
3はパターンマッチングの動作説明図である。図3にお
いて、符号の50は図2に示す計測対象物すなわち容器
30についての画像データである容器画像、51は容器
本体31についての画像データである容器本体画像、6
0はキャップ32についての画像データであるキャップ
画像、70はラベル40についての画像データであるラ
ベル画像、80は背景画像である。図3に示すように、
CCDカメラによって撮像され、フレームメモリ5に格
納されている取り込み画像データ全領域100において
基準サーチ領域D2を高速サーチしてキャップ画像60
らしきものを見いだし、RAM8から読み出したキャッ
プ画像左上角部に相当するテンプレート画像データと画
素比較することのパターンマッチングに基づいて、位置
決め用基準画像検出領域D1を抽出し、キャップ画像6
0の左上角部である基準位置座標P(X0 ,Y0 )を検
出する。
The specific image processing is as follows. FIG. 3 is an explanatory diagram of the operation of pattern matching. In FIG. 3, reference numeral 50 denotes a container image which is image data of the measurement object shown in FIG. 2, that is, the container 30, 51 denotes a container body image which is image data of the container body 31, and 6.
0 is a cap image which is image data of the cap 32, 70 is a label image which is image data of the label 40, and 80 is a background image. As shown in FIG.
In the entire captured image data area 100 captured by the CCD camera and stored in the frame memory 5, the reference search area D2 is searched at high speed and the cap image 60
Then, based on the pattern matching of comparing the pixel with the template image data corresponding to the upper left corner of the cap image read from the RAM 8 and extracting the reference image detection area D1 for positioning, the cap image 6
The reference position coordinate P (X0, Y0), which is the upper left corner of 0, is detected.

【0037】次に、上記で検出した基準位置座標P(X
0 ,Y0 )に基づいて計測サーチ領域D4を取り込み画
像データ全領域100上に設定する。すなわち、基準サ
ーチ領域D2の座標と計測サーチ領域D4の座標との差
分に相当する水平方向の変位量ΔXと垂直方向の変位量
ΔYとを演算によって算出し、基準サーチ領域D2から
変位量ΔX,ΔYの変位を行った座標を起点として計測
サーチ領域D4を設定する。
Next, the reference position coordinates P (X
0, Y0), the measurement search area D4 is set on the entire image data area 100. That is, a horizontal displacement amount ΔX and a vertical displacement amount ΔY corresponding to the difference between the coordinates of the reference search area D2 and the coordinates of the measurement search area D4 are calculated, and the displacement amounts ΔX, The measurement search area D4 is set with the coordinates at which the displacement of ΔY has been performed as a starting point.

【0038】そして、計測サーチ領域D4において高速
サーチを行い、容器本体画像51と背景画像80との境
界81を含んでいることを確認した上で、ラベル画像7
0らしきものを見いだし、RAM8から読み出したラベ
ル画像右下角部に相当するテンプレート画像データと画
素比較することのパターンマッチングに基づいて、計測
対象基準画像検出領域D3を抽出し、その計測対象基準
画像検出領域D3での両者の画像データの一致度を算出
し、その一致度が所定のしきい値以上となっているか否
かを判断し、しきい値以上となっているときは欠陥無し
すなわち位置ずれ無しと判定し、しきい値未満のときは
欠陥有りすなわち位置ずれ有りと判定する。また、一致
度が所定値以下(この所定値は前記のしきい値よりかな
り低く設定されている)のときは、ラベルが貼り付けら
れていないものと判定する。図3の場合は、ラベル画像
70が容器本体画像51に対して適正な位置にあると判
断される。すなわち、計測対象物30においてラベル4
0が容器本体31に対して適正な位置関係で貼り付けら
れていることになる。
Then, a high-speed search is performed in the measurement search area D4 to confirm that the boundary 81 between the container body image 51 and the background image 80 is included.
Based on the pattern matching in which a pixel which seems to be 0 and pixel comparison is performed with template image data corresponding to the lower right corner of the label image read from the RAM 8, a measurement target reference image detection area D3 is extracted, and the measurement target reference image detection is performed. The degree of coincidence between the two image data in the area D3 is calculated, and it is determined whether or not the degree of coincidence is equal to or more than a predetermined threshold. It is determined that there is no data, and if it is less than the threshold value, it is determined that there is a defect, that is, that there is a position shift. When the degree of coincidence is equal to or less than a predetermined value (this predetermined value is set considerably lower than the threshold value), it is determined that no label is attached. In the case of FIG. 3, it is determined that the label image 70 is at an appropriate position with respect to the container main body image 51. That is, the label 4
0 is affixed to the container body 31 in an appropriate positional relationship.

【0039】図4の場合は、取り込み画像データ全領域
100において容器画像50、容器本体画像51、キャ
ップ画像60、ラベル画像70が図3よりも水平方向に
ΔCX、垂直方向にΔCYずれている。図4において、
図3の状態を二点鎖線で表している。すなわち、図4の
位置決め用基準画像検出領域D1aは図3の位置決め用
基準画像検出領域D1より(ΔCX,ΔCY)だけずれ
ている。そして、図4の計測対象基準画像検出領域D3
aは図3の計測対象基準画像検出領域D3より同じく
(ΔCX,ΔCY)だけずれている。しかし、容器本体
画像51に対するラベル画像70の相対位置関係は同じ
であるので、計測対象基準画像検出領域D3aによる計
測対象位置座標Qa(X1a,Y1a)は適正なものであ
り、ラベルの貼り付け位置が正常であると判定する。な
お、位置決め用基準画像検出領域D1aと計測対象基準
画像検出領域D3aとの相対位置関係が図3の場合のそ
れと同じになっている。
In the case of FIG. 4, the container image 50, the container main body image 51, the cap image 60, and the label image 70 are shifted by ΔCX in the horizontal direction and ΔCY in the vertical direction in FIG. In FIG.
The state of FIG. 3 is represented by a two-dot chain line. That is, the positioning reference image detection area D1a in FIG. 4 is shifted by (ΔCX, ΔCY) from the positioning reference image detection area D1 in FIG. Then, the measurement target reference image detection area D3 in FIG.
a is similarly shifted by (ΔCX, ΔCY) from the measurement target reference image detection area D3 in FIG. However, since the relative positional relationship of the label image 70 to the container body image 51 is the same, the measurement target position coordinates Qa (X1a, Y1a) by the measurement target reference image detection area D3a are appropriate, and the label sticking position Is determined to be normal. Note that the relative positional relationship between the positioning reference image detection area D1a and the measurement target reference image detection area D3a is the same as that in the case of FIG.

【0040】図5の場合、計測対象基準画像検出領域D
3bにおける計測対象位置座標Qb(X1b,Y1b)が適
正でない。それは、容器本体画像51に対するラベル画
像70の相対位置関係が正規の位置関係よりずれている
ためである。つまり、距離α1 が正規の距離α0 に比べ
て過剰となっている。この場合、ラベルの貼り付け位置
について欠陥有りと判定する。なお、位置決め用基準画
像検出領域D1と計測対象基準画像検出領域D3bとの
相対位置関係が図3の場合のそれとは異なっている。
In the case of FIG. 5, the measurement target reference image detection area D
The measurement target position coordinates Qb (X1b, Y1b) in 3b are not appropriate. This is because the relative positional relationship between the label image 70 and the container body image 51 is shifted from the normal positional relationship. That is, the distance α1 is excessive compared to the regular distance α0. In this case, it is determined that the label affixing position has a defect. Note that the relative positional relationship between the positioning reference image detection area D1 and the measurement target reference image detection area D3b is different from that in the case of FIG.

【0041】図6の場合、位置決め用基準画像検出領域
D1aは図4と同様になっている。しかし、計測対象基
準画像検出領域D3cにおける計測対象位置座標Qc
(X1c,Y1c)が適正でない。それは、容器本体画像5
1に対するラベル画像70の相対位置関係が正規の位置
関係よりずれているためである。つまり、距離α2 が正
規の距離α0 に比べて過小となっている。この場合、ラ
ベルの貼り付け位置について欠陥有りと判定する。な
お、位置決め用基準画像検出領域D1aと計測対象基準
画像検出領域D3cとの相対位置関係が図4の場合のそ
れとは異なっている。
In the case of FIG. 6, the reference image detecting area D1a for positioning is the same as that of FIG. However, the measurement target position coordinates Qc in the measurement target reference image detection area D3c
(X1c, Y1c) is not appropriate. It is a container body image 5
This is because the relative positional relationship of the label image 70 with respect to No. 1 is shifted from the normal positional relationship. That is, the distance α2 is smaller than the normal distance α0. In this case, it is determined that the label affixing position has a defect. Note that the relative positional relationship between the positioning reference image detection area D1a and the measurement target reference image detection area D3c is different from that in the case of FIG.

【0042】上記の説明では、容器本体画像51に対す
るラベル画像70の相対位置関係がX方向で不適正な場
合を述べたが、Y方向で不適正となる場合もある。すな
わち、距離β0 に対して過剰または過小となることがあ
る。
In the above description, the case where the relative positional relationship of the label image 70 with respect to the container body image 51 is inappropriate in the X direction, but may be incorrect in the Y direction. That is, the distance β0 may be too large or too small.

【0043】以上のようなパターンマッチングによる画
像処理の結果は、カメラ・表示コントローラ4およびD
/A変換器11を介してモニタ12に表示される。図3
〜図6は画像データについてのものであるが、モニタ1
2に表示される内容も参考のために併記してある。すな
わち、計測対象基準画像検出領域D3における一致度
と、計測対象位置座標QのX座標値およびその判定結果
(OKまたはNG(No Good))ならびにY座標値およ
びその判定結果(OKまたはNG)であり、これらがモ
ニタ12に表示されるのである。ラベルの貼り付け位置
について欠陥有りのときは、CPU6は、バス10およ
び入出力インターフェイス9を介して外部の警報器14
を作動させる。ラベルの貼り付け無しの場合も同様であ
る。また、ラベルの貼り付け位置の不良または貼り付け
無しの場合には、その欠陥の画像データとともに判定結
果をバス10および入出力インターフェイス9を介して
外部記憶装置15に転送格納する。なお、その外部記憶
装置15としては、前述のように、ハードディスクやM
OディスクやDVD‐RAMやEEPROMやフラッシ
ュメモリなどがある。
The result of the image processing by the pattern matching described above is obtained by the camera / display controller 4 and the D
It is displayed on the monitor 12 via the / A converter 11. FIG.
6 to FIG. 6 relate to image data.
The contents displayed in 2 are also shown for reference. That is, the degree of coincidence in the measurement target reference image detection area D3, the X coordinate value of the measurement target position coordinate Q and its determination result (OK or NG (No Good)), and the Y coordinate value and its determination result (OK or NG) Yes, these are displayed on the monitor 12. When there is a defect in the label attaching position, the CPU 6 sends the external alarm 14 via the bus 10 and the input / output interface 9.
Activate The same applies to the case where no label is attached. In the case where the label attachment position is defective or not attached, the determination result is transferred to the external storage device 15 via the bus 10 and the input / output interface 9 together with the image data of the defect. As described above, the external storage device 15 includes a hard disk and an M
There are an O disk, a DVD-RAM, an EEPROM, a flash memory, and the like.

【0044】次に、図7〜図15に基づいて、基準サー
チ領域D2および計測サーチ領域D4の再設定の処理に
ついて説明する。この処理は、上述のパターンマッチン
グによるラベルの貼り付け位置の良否および貼り付け有
無の判定の前段階のものであることはいうまでもない。
この再設定は、オペレータがモニタ12の表示を見なが
ら、入力操作部13を操作することにより行う。
Next, a process of resetting the reference search area D2 and the measurement search area D4 will be described with reference to FIGS. Needless to say, this process is a stage prior to the determination of whether or not the label is pasted and whether or not the label is pasted by the pattern matching described above.
This resetting is performed by the operator operating the input operation unit 13 while watching the display on the monitor 12.

【0045】(1)まず、現在の設定の状態を図7に示
しておく。RAM8にはすでに、位置決め用基準画像検
出領域D1′、基準サーチ領域D2′、計測対象基準画
像検出領域D3′および計測サーチ領域D4′が設定さ
れている。説明の都合上、このような再設定前の要素符
号について記号の「′」を付して、再設定後のものと区
別するようにする。これを設定し直ししようとしている
のである。その再設定の理由はすでに述べたとおりいろ
いろであるが、とにかくエラー発生率を下げて、欠陥検
出の精度をアップするためである。
(1) First, FIG. 7 shows a current setting state. In the RAM 8, a positioning reference image detection area D1 ', a reference search area D2', a measurement target reference image detection area D3 ', and a measurement search area D4' have already been set. For convenience of explanation, such element codes before resetting are denoted by a symbol “′” so as to be distinguished from those after resetting. I'm trying to reset it. The reason for the resetting is various as described above, but is to lower the error occurrence rate and improve the accuracy of defect detection.

【0046】(2)図8に示すように、計測対象物30
を位置調整する。この位置調整は、搬送手段31を止め
たうえで行う。この位置調整は、エラー発生率をより低
くすると思われるように行う。この場合、必要に応じ
て、CCDカメラ2の視野の方向を上下に、あるいは左
右に、あるいは上下左右に変更することも行われる。な
お、100は取り込み画像データ全領域、50は容器画
像、51は容器本体画像、60はキャップ画像、70は
ラベル画像、Oは取り込み画像データ全領域100につ
いての原点である。
(2) As shown in FIG.
Adjust the position. This position adjustment is performed after the transport means 31 is stopped. This position adjustment is performed in such a manner that the error occurrence rate is considered to be lower. In this case, if necessary, the direction of the field of view of the CCD camera 2 may be changed up and down, left and right, or up and down and left and right. It should be noted that 100 is the entire captured image data area, 50 is the container image, 51 is the container body image, 60 is the cap image, 70 is the label image, and O is the origin of the entire captured image data area 100.

【0047】図8の段階では、まだ、再設定は開始され
ていない。図8には、位置調整後の容器画像50が取り
込み画像データ全領域100の内部でどのような位置に
あるかを示している。併せて、図7のときの位置決め用
基準画像検出領域D1′、基準サーチ領域D2′、計測
対象基準画像検出領域D3′および計測サーチ領域D
4′をすべて二点鎖線で示してある。これらが再設定の
対象となっている。
At the stage shown in FIG. 8, resetting has not yet started. FIG. 8 shows the position of the container image 50 after the position adjustment within the entire captured image data area 100. In addition, the positioning reference image detection area D1 ', reference search area D2', measurement target reference image detection area D3 ', and measurement search area D in FIG.
4 'are all shown by two-dot chain lines. These are the targets for resetting.

【0048】(3)次に、図9に示すように、オペレー
タはモニタ12における表示を見ながら入力操作部13
を操作して、キャップ画像60の左上角部に実線矩形で
図示した位置決め用基準画像検出領域D1についての基
準位置座標P(X0 ,Y0 )を設定する。この操作によ
るデータは入出力インターフェイス9およびバス10を
介してRAM8にストアされることになる。この処理は
CPU6が実行することはいうまでもない。
(3) Next, as shown in FIG.
Is operated to set the reference position coordinates P (X0, Y0) for the positioning reference image detection area D1 indicated by a solid rectangle in the upper left corner of the cap image 60. The data resulting from this operation is stored in the RAM 8 via the input / output interface 9 and the bus 10. Needless to say, this processing is executed by the CPU 6.

【0049】なお、ここでは、RAM8は充分に大きな
記憶容量をもっているものとし、かつ、電源をオフして
も記憶内容が消えないように、RAM8に対してバック
アップを行っているものとする。そのバックアップは、
例えばリチウム電池でもよいし、大容量のキャパシタで
もよい。
Here, it is assumed that the RAM 8 has a sufficiently large storage capacity and is backed up to the RAM 8 so that the stored contents are not lost even when the power is turned off. The backup is
For example, a lithium battery or a large-capacity capacitor may be used.

【0050】(4)次に、図10に示すように、元の図
7における位置決め用基準画像検出領域D1′の基準位
置座標P′(X0′,Y0′)から再設定された位置決め
用基準画像検出領域D1の基準位置座標P(X0 ,Y0
)へのX方向、Y方向の補正量ΔX1,ΔY1を算出
する。これら補正量ΔX1,ΔY1はRAM8にストア
される。
(4) Next, as shown in FIG. 10, the positioning reference reset from the reference position coordinates P '(X0', Y0 ') of the positioning reference image detection area D1' in FIG. The reference position coordinates P (X0, Y0) of the image detection area D1
) Are calculated in the X and Y directions. These correction amounts ΔX1 and ΔY1 are stored in the RAM 8.

【0051】(5)次に、図11に示すように、位置決
め用基準画像検出領域D1に対してその周囲に基準サー
チ領域D2を設定する。再設定の基準サーチ領域D2を
元の基準サーチ領域D2′と同じ形状・サイズにするの
が一般的であり、その場合は、次のような演算処理によ
って座標を求める。基準サーチ領域D2の四隅の座標を
それぞれ、A(Xa,Ya)、B(Xb,Yb)、C
(Xc,Yc)、D(Xd,Yd)とし、もとの基準サ
ーチ領域D2′の四隅の座標をそれぞれ、A′(X
a′,Ya′)、B′(Xb′,Yb′)、C′(X
c′,Yc′)、D′(Xd′,Yd′)とする。すな
わち、座標A(Xa,Ya)については、 Xa=Xa′+ΔX1 ……………………………………………(9) Ya=Ya′+ΔY1 ……………………………………………(10) として算出し、座標B(Xb,Yb)については、 Xb=Xb′+ΔX1 ……………………………………………(11) Yb=Yb′+ΔY1 ……………………………………………(12) として算出し、座標C(Xc,Yc)については、 Xc=Xc′+ΔX1 ……………………………………………(13) Yc=Yc′+ΔY1 ……………………………………………(14) として算出し、座標D(Xd,Yd)については、 Xd=Xd′+ΔX1 ……………………………………………(15) Yd=Yd′+ΔY1 ……………………………………………(16) として算出する。これらの座標データはRAM8にスト
アされる。
(5) Next, as shown in FIG. 11, a reference search area D2 is set around the positioning reference image detection area D1. Generally, the reference search area D2 to be reset has the same shape and size as the original reference search area D2 '. In this case, the coordinates are obtained by the following arithmetic processing. The coordinates of the four corners of the reference search area D2 are represented by A (Xa, Ya), B (Xb, Yb), C
(Xc, Yc) and D (Xd, Yd), and the coordinates of the four corners of the original reference search area D2 'are A' (X
a ', Ya'), B '(Xb', Yb '), C' (X
c ', Yc') and D '(Xd', Yd '). That is, for the coordinates A (Xa, Ya), Xa = Xa ′ + ΔX1 (9) Ya = Ya ′ + ΔY1... (9) ... (10), and the coordinates B (Xb, Yb) are calculated as follows: Xb = Xb ′ + ΔX1... ...... (11) ) Yb = Yb ′ + ΔY1... (12), and Xc = Xc ′ + ΔX1 for coordinates C (Xc, Yc). ... (13) Yc = Yc ′ + ΔY1... (14) ), Xd = Xd '+ ΔX1 (15) Yd = Yd' + ΔY1 (13) Yd = Yd '+ ΔY1 … (16) and Calculated Te. These coordinate data are stored in the RAM 8.

【0052】(6)次に、図12に示すように、元の図
7における計測対象基準画像検出領域D3′の計測対象
位置座標Q′(X1′,Y1′)に対して前記の補正量Δ
X1,ΔY1を加味した計測対象位置座標Q(X1 ,Y
1 )を算出し、計測対象基準画像検出領域D3を再設定
する。
(6) Next, as shown in FIG. 12, the correction amount for the measurement target position coordinates Q '(X1', Y1 ') of the original measurement target reference image detection area D3' in FIG. Δ
Measurement target position coordinates Q (X1, Y
1) is calculated, and the measurement target reference image detection area D3 is reset.

【0053】 X1 =X1′+ΔX1 ……………………………………………(17) Y1 =Y1′+ΔY1 ……………………………………………(18) である。図2に示す計測対象物である容器30の実物に
おいて、キャップ32の左上角部の位置と正規に貼り付
けられるラベル40の右下角部の位置との相対位置関係
はあらかじめ決まっているから、計測対象基準画像検出
領域D3は、位置決め用基準画像検出領域D1に基づい
て決定することができる。この新たな計測対象位置座標
Q(X1 ,Y1 )についての座標データはRAM8にス
トアされる。
X 1 = X 1 ′ + ΔX 1 (17) Y 1 = Y 1 ′ + ΔY 1 ……………………………………………… (18) Since the relative positional relationship between the position of the upper left corner of the cap 32 and the position of the lower right corner of the label 40 that is properly affixed is determined in advance in the actual container 30 as the measurement target shown in FIG. The target reference image detection area D3 can be determined based on the positioning reference image detection area D1. The coordinate data of the new measurement target position coordinates Q (X1, Y1) is stored in the RAM 8.

【0054】(7)次に、図13に示すように、計測対
象基準画像検出領域D3に対してその周囲に計測サーチ
領域D4を設定する。計測サーチ領域D4は、ラベル画
像70の右下角部を含むとともに、容器本体画像51と
背景画像80との境界81を含むように設定する。再設
定の計測サーチ領域D4を元の計測サーチ領域D4′と
同じ形状・サイズにするのが一般的であり、その場合
は、次のような演算処理によって座標を求める。計測サ
ーチ領域D4の四隅の座標をそれぞれ、E(Xe,Y
e)、F(Xf,Yf)、G(Xg,Yg)、H(X
h,Yh)とし、もとの計測サーチ領域D4′の四隅の
座標をそれぞれ、E′(Xe′,Ye′)、F′(X
f′,Yf′)、G′(Xg′,Yg′)、H′(X
h′,Yh′)とする。すなわち、座標E(Xe,Y
e)については、 Xe=Xe′+ΔX1 ……………………………………………(19) Ye=Ye′+ΔY1 ……………………………………………(20) として算出し、座標F(Xf,Yf)については、 Xf=Xf′+ΔX1 ……………………………………………(21) Yf=Yf′+ΔY1 ……………………………………………(22) として算出し、座標G(Xg,Yg)については、 Xg=Xg′+ΔX1 ……………………………………………(23) Yg=Yg′+ΔY1 ……………………………………………(24) として算出し、座標H(Xh,Yh)については、 Xh=Xh′+ΔX1 ……………………………………………(25) Yh=Yh′+ΔY1 ……………………………………………(26) として算出する。これらの座標データはRAM8にスト
アされる。
(7) Next, as shown in FIG. 13, a measurement search area D4 is set around the measurement target reference image detection area D3. The measurement search area D4 is set to include the lower right corner of the label image 70 and to include the boundary 81 between the container body image 51 and the background image 80. Generally, the measurement search area D4 to be reset has the same shape and size as the original measurement search area D4 '. In this case, the coordinates are obtained by the following arithmetic processing. The coordinates of the four corners of the measurement search area D4 are represented by E (Xe, Y
e), F (Xf, Yf), G (Xg, Yg), H (X
h, Yh), and the coordinates of the four corners of the original measurement search area D4 'are E' (Xe ', Ye') and F '(X
f ', Yf'), G '(Xg', Yg '), H' (X
h ′, Yh ′). That is, the coordinates E (Xe, Y
Regarding e), Xe = Xe ′ + ΔX1 (19) Ye = Ye ′ + ΔY1 …………………………………… ... (20), and the coordinates F (Xf, Yf) are calculated as follows: Xf = Xf ′ + ΔX1 (21) Yf = Yf ′ + ΔY1 (21) (22), and the coordinates G (Xg, Yg) are calculated as follows: Xg = Xg ′ + ΔX1. ... (23) Yg = Yg ′ + ΔY1... (24), and for the coordinates H (Xh, Yh), Xh = Xh '+ ΔX1 ……………………………………………………………………………………………… (25) Yh = Yh ′ + ΔY1 . These coordinate data are stored in the RAM 8.

【0055】(8)次に、上記で再設定した基準サーチ
領域D2および計測サーチ領域D4がCCDカメラ2に
よる取り込み画像データ全領域100の内部に収まって
いるか否かをチェックする。
(8) Next, it is checked whether or not the reference search area D2 and the measurement search area D4 reset as described above fall within the entire area 100 of image data captured by the CCD camera 2.

【0056】図14の場合には、再設定された基準サー
チ領域D2および計測サーチ領域D4が取り込み画像デ
ータ全領域100の内部に収まっていると判断される。
しかし、図15のように取り込み画像データ全領域10
0に対して下側の計測サーチ領域D4が+Y方向にはみ
出したり、図16のように取り込み画像データ全領域1
00に対して上側の基準サーチ領域D2が−Y方向には
み出したりしたときは、収まっていないと判断される。
また、図17のように取り込み画像データ全領域100
に対して上側の基準サーチ領域D2が−X方向にはみ出
したり、図18のように取り込み画像データ全領域10
0に対して下側の計測サーチ領域D4が+X方向にはみ
出したりしたときは、収まっていないと判断される。な
お、容器画像の形状を変えてあるのは、形状によってど
の方向にはみ出すかが異なるためである。
In the case of FIG. 14, it is determined that the reset reference search area D2 and measurement search area D4 fall within the entire captured image data area 100.
However, as shown in FIG.
The measurement search area D4 on the lower side with respect to 0 protrudes in the + Y direction, or the entire area 1 of the captured image data as shown in FIG.
When the reference search area D2 on the upper side of 00 is protruded in the -Y direction, it is determined that the area does not fit.
Also, as shown in FIG.
In contrast, the upper reference search area D2 protrudes in the −X direction, or as shown in FIG.
When the measurement search area D4 on the lower side of 0 protrudes in the + X direction, it is determined that it does not fit. The reason why the shape of the container image is changed is that the direction in which the image protrudes differs depending on the shape.

【0057】(9)収まっていないと判断したときは、
CPU6は、収めるべき方向を判断し、収めるために計
測対象物30を移動させるべき方向あるいはCCDカメ
ラ2を移動させるべき方向を算出し、その方向のデータ
をカメラ・表示コントローラ4およびD/A変換器11
を介してモニタ12に送出し、モニタ12においてその
移動させるべき方向矢印標記を表示する。図15の場合
は、CCDカメラ2についての移動させるべき方向矢印
標記Mが下向きに表示され、図16の場合は、CCDカ
メラ2についての移動させるべき方向矢印標記Mが上向
きに表示されている。また、図17の場合は、CCDカ
メラ2についての移動させるべき方向矢印標記Mが左向
きに表示され、計測対象物30である製品についての移
動させるべき方向矢印標記Nが右向きに表示されてい
る。図18の場合は、CCDカメラ2についての移動さ
せるべき方向矢印標記Mが右向きに表示され、計測対象
物30である製品についての移動させるべき方向矢印標
記Nが左向きに表示されている。この移動させるべき方
向矢印標記MやNの表示によってオペレータに対して基
準サーチ領域D2や計測サーチ領域D4の再設定が良く
ないことを知らせる。X方向、Y方向の両方ではみ出す
ときは、移動させるべき方向矢印標記として斜め方向矢
印標記を表示してもよいし、X方向、Y方向の両方向矢
印標記を表示してもよい。はみ出しの程度に応じて方向
矢印標記の長さを変化させてもよい。
(9) If it is determined that the size does not fit,
The CPU 6 determines the direction to be accommodated, calculates the direction in which the measuring object 30 is to be moved or the direction in which the CCD camera 2 is to be moved in order to store the data, and converts the data of the direction into the camera / display controller 4 and the D / A conversion. Table 11
To the monitor 12 via the monitor, and displays the direction arrow mark to be moved on the monitor 12. In the case of FIG. 15, the direction arrow mark M to be moved about the CCD camera 2 is displayed downward, and in the case of FIG. 16, the direction arrow mark M to be moved about the CCD camera 2 is displayed upward. In the case of FIG. 17, the direction arrow mark M to be moved for the CCD camera 2 is displayed to the left, and the direction arrow mark N to be moved to the product as the measurement target 30 is displayed to the right. In the case of FIG. 18, the direction arrow mark M to be moved for the CCD camera 2 is displayed to the right, and the direction arrow mark N to be moved for the product as the measurement target 30 is displayed to the left. The display of the direction arrow marks M and N to be moved informs the operator that resetting of the reference search area D2 and the measurement search area D4 is not good. When protruding in both the X direction and the Y direction, a diagonal arrow mark may be displayed as the direction arrow mark to be moved, or a bidirectional arrow mark in the X direction and the Y direction may be displayed. The length of the direction arrow mark may be changed according to the degree of protrusion.

【0058】なお、このとき、CPU6は同時に警告信
号を出力するのもよい。その警告信号はバス10および
入出力インターフェイス9を介して外部に接続の警報器
14に送出され、その警報器14を動作させ、オペレー
タに対して、聴覚的にも警告するのでもよい。
At this time, the CPU 6 may simultaneously output a warning signal. The warning signal may be sent to an externally connected alarm device 14 via the bus 10 and the input / output interface 9 to operate the alarm device 14 to give an audible alarm to the operator.

【0059】(10)オペレータはモニタ12に表示さ
れている移動させるべき方向MやNを見て、CCDカメ
ラ2を移動させ、あるいは計測対象物30を移動させ
る。計測対象物30のみを移動させてもよいし、CCD
カメラ2のみを移動させてもよいし、計測対象物30と
CCDカメラ2の双方を移動させてもよい。CCDカメ
ラ2の移動については、視野の方向(画角)をずらすと
いうことである。CCDカメラ2そのものの設置位置ま
で変更する必要はない。もっとも、場合によっては、そ
の設置位置を変更してもよい。あるいは、CCDカメラ
2がズームレンズを備えている場合には、そのズーム比
を可変するのでもよい。
(10) The operator looks at the directions M and N to be moved displayed on the monitor 12 and moves the CCD camera 2 or the object 30 to be measured. Only the measurement object 30 may be moved, or a CCD
Only the camera 2 may be moved, or both the measurement target 30 and the CCD camera 2 may be moved. Regarding the movement of the CCD camera 2, it means shifting the direction of the field of view (angle of view). It is not necessary to change the installation position of the CCD camera 2 itself. However, in some cases, the installation position may be changed. Alternatively, when the CCD camera 2 includes a zoom lens, the zoom ratio may be changed.

【0060】(11)上記の(3)〜(10)が何度か
再試行(リトライ)され、最終的には前記の(8)の判
断が肯定的となって、再設定した基準サーチ領域D2お
よび計測サーチ領域D4がCCDカメラ2による取り込
み画像データ全領域100の内部に収まった状況が得ら
れる。
(11) The above (3) to (10) are retried (retried) several times, and finally the judgment in (8) becomes affirmative, and the reset reference search area A situation is obtained in which D2 and the measurement search area D4 fall within the entire area 100 of image data captured by the CCD camera 2.

【0061】(12)なお、計測対象基準画像検出領域
D3が図19のように複数ある場合には、すべての計測
対象基準画像検出領域D3について上記の処理が終了し
たか否かをチェックし、終了していないときは上記の
(3)からの処理を繰り返す。
(12) When there are a plurality of measurement target reference image detection areas D3 as shown in FIG. 19, it is checked whether or not the above processing has been completed for all measurement target reference image detection areas D3. If not completed, the processing from the above (3) is repeated.

【0062】(13)以上のすべての処理が終了する
と、基準サーチ領域D2についての座標データと計測サ
ーチ領域D4についての座標データを改めてRAM8に
設定登録する。なお、RAM8に代えて、バス10に接
続した図1で二点鎖線で示すEEPROM16に各種の
データを保存するようにしてもよい。むしろ、その方が
良い場合があり得る。EEPROMは不揮発性メモリで
あり、バックアップが不要であるとともに、書き換えが
可能であるからである。
(13) When all the above processes are completed, the coordinate data for the reference search area D2 and the coordinate data for the measurement search area D4 are newly set and registered in the RAM 8. Instead of the RAM 8, various data may be stored in the EEPROM 16 connected to the bus 10 and shown by a two-dot chain line in FIG. Rather, it may be better. This is because the EEPROM is a nonvolatile memory, does not require a backup, and can be rewritten.

【0063】以上の処理によって再設定が完了したこと
になり、位置決め用基準画像検出領域D1についての基
準サーチ領域D2がRAM8やEEPROM16などの
記憶手段に設定登録され、計測対象基準画像検出領域D
3についての計測サーチ領域D4がRAM8やEEPR
OM16などの記憶手段に設定登録されることになる。
続いては、図3に示したような実際の計測実行に進む。
The resetting is completed by the above processing, and the reference search area D2 for the positioning reference image detection area D1 is set and registered in the storage means such as the RAM 8 and the EEPROM 16, and the measurement target image detection area D
Measurement search area D4 for RAM 3 is RAM8 or EEPR
The setting is registered in the storage means such as the OM16.
Subsequently, the process proceeds to actual measurement execution as shown in FIG.

【0064】以上のように、基準サーチ領域D2および
計測サーチ領域D4の再設定において、基準サーチ領域
D2および計測サーチ領域D4が取り込み画像データ全
領域100の内部に収まっているか否かの判断を、その
再設定の段階ですでにチェックすることができるため、
実際の計測実行においては、基準サーチ領域D2や計測
サーチ領域D4が取り込み画像データ全領域100から
はみ出すというトラブルは発生しない。また、基準サー
チ領域D2および計測サーチ領域D4が取り込み画像デ
ータ全領域100の内部に収まっているか否かの判断の
チェックが自動的に行われるため、オペレータがいちい
ち机上で計算するなどして人為的に判断するわずらわし
さは生じない。
As described above, in resetting the reference search area D2 and the measurement search area D4, it is determined whether or not the reference search area D2 and the measurement search area D4 fall within the whole captured image data area 100. You can already check at the reconfiguration stage,
In the actual measurement execution, there is no trouble that the reference search area D2 and the measurement search area D4 protrude from the whole captured image data area 100. In addition, since the reference search area D2 and the measurement search area D4 are automatically checked to determine whether or not they are within the entire captured image data area 100, the operator can manually calculate each time and perform artificial calculations. There is no troublesome judgment.

【0065】そして、実際の計測実行でのはみ出しのト
ラブルの発生を予防できるので、生産ラインがその稼働
中で不測にストップするなどの不具合の発生を抑制で
き、再設定による生産効率の低下は招かないですむ。
Further, since the occurrence of a protruding trouble in the actual measurement execution can be prevented, the occurrence of a trouble such as an unexpected stop of the production line during its operation can be suppressed, and the reduction of the production efficiency due to resetting is caused. You don't have to.

【0066】以上のCPU6による動作の概要を図20
のフローチャートに示しておく。
FIG. 20 shows an outline of the operation of the CPU 6 described above.
Is shown in the flowchart of FIG.

【0067】上記の実施の形態では、再設定の基準サー
チ領域D2を元の基準サーチ領域D2′と同じ形状・サ
イズにすることとしたが、基準サーチ領域D2の四隅の
座標A(Xa,Ya)、B(Xb,Yb)、C(Xc,
Yc)、D(Xd,Yd)のいずれをももとの基準サー
チ領域D2′の四隅の座標とは独立して設定するように
してもよい。また、上記の実施の形態では、再設定の計
測サーチ領域D4を元の計測サーチ領域D4′と同じ形
状・サイズにすることとしたが、計測サーチ領域D4の
四隅の座標E(Xe,Ye)、F(Xf,Yf)、G
(Xg,Yg)、H(Xh,Yh)のいずれをももとの
計測サーチ領域D4′の四隅の座標とは独立して設定す
るようにしてもよい。この場合の動作の概要を図21の
フローチャートに示しておく。
In the above embodiment, the reset reference search area D2 has the same shape and size as the original reference search area D2 '. However, the coordinates A (Xa, Ya) of the four corners of the reference search area D2. ), B (Xb, Yb), C (Xc,
Both Yc) and D (Xd, Yd) may be set independently of the coordinates of the four corners of the original reference search area D2 '. In the above-described embodiment, the reset measurement search area D4 has the same shape and size as the original measurement search area D4 '. However, the coordinates E (Xe, Ye) of the four corners of the measurement search area D4. , F (Xf, Yf), G
Any of (Xg, Yg) and H (Xh, Yh) may be set independently of the coordinates of the four corners of the original measurement search area D4 '. An outline of the operation in this case is shown in the flowchart of FIG.

【0068】なお、CCDカメラ2の移動または計測対
象物30の移動によって位置ずれ判定条件が変化するよ
うなアルゴリズムの場合もあり得る。そのときは、図2
0の場合はステップS7とステップS11の間に、ま
た、図21の場合はステップS26とステップS30の
間に、図22に示すような処理を行うようにすればよ
い。位置ずれ判定条件も補正し、それが許容範囲内か否
かをチェックする。許容範囲内でなければ、位置ずれ判
定条件を再び補正する。なお、このような位置ずれ判定
条件の補正およびそのチェックは、計測対象基準画像検
出領域D3が複数ある場合には、それぞれについて行う
ものとする。このことは、計測対象物30の品種が変化
した場合に特に有効となる。それは、基準位置座標P
(X0 ,Y0 )に対する計測対象位置座標Q(X1 ,Y
1 )の相対的位置関係が変化するからである。このよう
な場合には、位置ずれ判定条件の変化が伴うからであ
る。このように処理することにより、適正な位置ずれ判
定条件を自動的に見いだすことができる。
It is to be noted that there may be an algorithm in which the displacement determination condition is changed by the movement of the CCD camera 2 or the movement of the object 30 to be measured. At that time, FIG.
The processing shown in FIG. 22 may be performed between step S7 and step S11 in the case of 0, and between step S26 and step S30 in the case of FIG. The position deviation determination condition is also corrected, and it is checked whether the condition is within an allowable range. If it is not within the allowable range, the misregistration determination condition is corrected again. It should be noted that, when there are a plurality of measurement target reference image detection areas D3, such correction of the misregistration determination condition and its check are performed for each of them. This is particularly effective when the type of the measurement target 30 changes. It is the reference position coordinate P
Measurement target position coordinates Q (X1, Y0) with respect to (X0, Y0)
This is because the relative positional relationship 1) changes. This is because such a case involves a change in the misalignment determination condition. By performing the processing as described above, it is possible to automatically find an appropriate misalignment determination condition.

【0069】以上、二つの実施の形態について説明して
きたが、本発明は次のように構成したものも含み得るも
のとする。
Although the two embodiments have been described above, the present invention can include the following configurations.

【0070】(1)フレームメモリ5に代えてフィール
ドメモリでもよいし、その他のメモリでもよい。
(1) Instead of the frame memory 5, a field memory may be used, or another memory may be used.

【0071】(2)すでに述べたことであるが、画像処
理演算用条件や判定基準を格納する記憶エリアとして、
RAM8に代えて、図1で二点鎖線で示したEEPRO
M16やフラッシュメモリその他の不揮発性メモリを用
いてもよい。この場合、その不揮発性メモリは画像処理
装置1の内部においてバス10に接続しておくのでもよ
いし、入出力インターフェイス9を介して外部に接続す
るのでもよい。
(2) As described above, as a storage area for storing image processing calculation conditions and determination criteria,
EEPRO shown by a two-dot chain line in FIG.
M16, a flash memory, or another nonvolatile memory may be used. In this case, the nonvolatile memory may be connected to the bus 10 inside the image processing apparatus 1 or may be connected to the outside via the input / output interface 9.

【0072】(3)フレームメモリ5をシステムメモリ
としてのRAM8と共用することも可能である。
(3) The frame memory 5 can be shared with the RAM 8 as a system memory.

【0073】(4)計測対象物30が所定の検査ポイン
トDPに到達したことを検出する到達検出手段について
は、上記の実施の形態の光電センサ22に代えて、CC
Dカメラ2で撮像して得られた画像データの画像処理に
基づいて、すなわち画像データに対して到達検出用のサ
ーチウインドウを設定して、ソフトウェア的に到達検出
を判定するように構成してもよい。
(4) The arrival detecting means for detecting that the measurement object 30 has reached the predetermined inspection point DP is replaced by the CC instead of the photoelectric sensor 22 of the above embodiment.
The arrival detection may be determined by software based on image processing of image data obtained by imaging with the D camera 2, that is, by setting a search window for arrival detection for the image data. Good.

【0074】(5)計測対象物30としては何も容器に
限る必要はなく、また、検査対象としては何もラベルの
貼り付け位置や貼り付けの有無に限る必要はなく、画像
処理による検査が可能なものであれば、どのようなもの
を検査対象としてもよい。半製品または製品に印刷され
ている印刷内容の印刷位置の良否の判定あるいは印刷有
無の判定でもよいし、半導体チップのピンの位置の良否
の判定、プリント基板上に実装された電子部品の配置の
良否の判定、搬送用のトレイに載置されている複数の部
品の配置の良否の判定など何であってもよい。
(5) The object 30 to be measured does not need to be limited to a container, and the object to be inspected does not need to be limited to the position where the label is attached or the presence or absence of the label. Whatever is possible may be the inspection target. The determination of the print position of the printed content printed on the semi-finished product or the product or the determination of the presence or absence of printing may be performed, the determination of the position of the semiconductor chip pins may be performed, and the arrangement of the electronic components mounted on the printed circuit board may be determined. Any judgment may be made, such as judgment of pass / fail and judgment of pass / fail of arrangement of a plurality of components placed on the transport tray.

【0075】(6)カメラ・表示コントローラ4は、フ
レームメモリ5への画像データの書き込みと並行して、
その書き込んだ画像データをフレームメモリ5から読み
出し、D/A変換器11に転送し、モニタ12に映像を
リアルタイムで表示したが、このようなリアルタイムの
表示はしなくてもよい。つまり、モニタ12を位置ずれ
有りのときだけリアルタイムに表示動作させるようにし
てもよいし、あるいはそれもなくして、位置ずれ有りの
欠陥の原因究明のときにだけ用いるようにすることも可
能である。
(6) The camera / display controller 4 writes the image data into the frame memory 5
The written image data is read out from the frame memory 5, transferred to the D / A converter 11, and the video is displayed on the monitor 12 in real time. However, such real time display is not required. In other words, the monitor 12 may be displayed in real time only when there is a displacement, or may be used only when investigating the cause of a defect having a displacement. .

【0076】(7)位置ずれ有りなどの欠陥有りのとき
の画像データ等の保存に際しては、画像データを圧縮し
てから保存するように構成してもよい。この場合、表示
に際しては画像伸張して表示するものとする。
(7) When storing image data when there is a defect such as a position shift, the image data may be compressed and then stored. In this case, it is assumed that the image is expanded and displayed at the time of display.

【0077】(8)欠陥有りのときの画像データ等の保
存を行う外部記憶装置15に代えて、同様な不揮発性メ
モリを画像処理装置1の内部に設けてもよい。また、R
AM8またはフレームメモリ5の容量を大きくして、そ
れらに画像データ等の保存を行うように構成してもよ
い。
(8) A similar non-volatile memory may be provided inside the image processing apparatus 1 in place of the external storage device 15 for storing image data when there is a defect. Also, R
The capacity of the AM 8 or the frame memory 5 may be increased to store image data or the like in them.

【0078】(9)モデムカードやISDNカードを利
用して公衆回線あるいは専用回線を介して画像データ等
を遠隔の端末に送出するように構成することも可能であ
る。
(9) It is also possible to use a modem card or an ISDN card to transmit image data and the like to a remote terminal via a public line or a dedicated line.

【0079】(10)その他本発明の要旨と直接に関係
しない任意の事項については、公知の任意のものが適用
可能であり、また、公知以外のものであっても、本発明
の要旨を逸脱しない範囲において適用可能であることは
いうまでもない。
(10) As for any other items which are not directly related to the gist of the present invention, any known ones can be applied. It is needless to say that the present invention can be applied within a range not to be applied.

【0080】上記の(1)〜(10)は互いに独立した
事項であり、これらのうち任意の事項を任意数適当に組
み合わせてもよきものとする。
The above items (1) to (10) are independent of each other, and any of these items may be appropriately combined in any number.

【0081】[0081]

【発明の効果】画像処理装置についての請求項1の発明
によれば、基準サーチ領域および計測サーチ領域の再設
定において、その再設定された基準サーチ領域や計測サ
ーチ領域が取り込み画像データ全領域に収まっているも
のであるか否かのチェックをその再設定の際に自動的に
行うことができる。すなわち、サーチ領域の再設定が適
正か否かをその再設定時においてあらかじめチェックす
ることができ、オペレータがいちいち机上で計算するな
どして人為的に判断するわずらわしさをなくせるととも
に、実際の計測実行において基準サーチ領域内で位置ず
れが発生したときでも、はみ出しのトラブルを生じさせ
ることがなく、生産ラインがその稼働中に不測にストッ
プするなどの不具合の発生を抑制でき、再度の設定のし
直しによる生産効率の低下を招かないですむ。
According to the first aspect of the present invention, in resetting the reference search area and the measurement search area, the reset reference search area and the measurement search area are included in the entire area of the captured image data. A check as to whether or not the data is within the range can be automatically performed at the time of resetting. That is, it is possible to check in advance whether or not the search area reset is appropriate at the time of resetting. This eliminates the hassle of having to manually determine by the operator, for example, calculating on a desk, and at the same time, reducing the actual measurement. Even when a position shift occurs in the reference search area during execution, it does not cause an overhang problem, can suppress the occurrence of problems such as unexpected stop of the production line during its operation, and can be set again. Fixing does not cause a drop in production efficiency.

【0082】請求項2の発明によれば、オペレータは撮
像手段または計測対象物を移動させるに当たって、表示
された移動方向の指示の表示を見て、それに従って移動
させればよいので、再設定における補正の作業を迅速,
容易に行うことができる。
According to the second aspect of the present invention, when the operator moves the imaging means or the object to be measured, the operator only has to look at the displayed instruction of the moving direction and move it in accordance with the instruction. Quick correction work,
It can be done easily.

【0083】請求項3の発明によれば、位置ずれ判定条
件の補正を行う場合にも、その補正の適否をチェックす
るように構成してあるので、適正な位置ずれ判定条件を
自動的に見いだすことができる。
According to the third aspect of the present invention, even when correcting the misregistration determination condition, it is configured to check whether or not the correction is appropriate, so that the appropriate misregistration determination condition is automatically found. be able to.

【0084】請求項4の発明によれば、生産ライン等で
搬送される計測対象物について、計測対象物をタイミン
グ良く撮像し、その検査対象の良否判定を効率良く行え
るので、計測対象物が搬送されるものであっても、上記
請求項1と同様の効果が得られる。
According to the fourth aspect of the present invention, the measurement object is imaged with good timing for the measurement object conveyed on the production line or the like, and the quality of the inspection object can be efficiently determined. The same effects as those of the first aspect can be obtained.

【0085】請求項5の発明によれば、容器などの半製
品または製品に貼り付けられているラベルの貼り付け位
置や印刷内容の印刷位置の良否の判定あるいは貼り付け
や印刷有無の判定、半導体チップのピンの位置の良否の
判定、プリント基板上に実装された電子部品の配置の良
否の判定、搬送用のトレイに載置されている複数の部品
の配置の良否の判定などを行う画像処理装置において、
上記の効果が良好に発揮され、したがってまた、汎用性
を高めることができる。
According to the fifth aspect of the present invention, it is determined whether or not a label affixed to a semi-finished product such as a container or a product, or a print position of a printed content, or a determination of whether or not a label is affixed or printed. Image processing for determining whether the pin positions of the chip are good, whether the electronic components mounted on the printed circuit board are good or not, and whether the multiple components placed on the transport tray are good or bad. In the device,
The above-described effects are favorably exhibited, and therefore, versatility can be enhanced.

【図面の簡単な説明】[Brief description of the drawings]

【図1】 本発明の実施の形態の画像処理装置の電気的
構成を示すブロック図
FIG. 1 is a block diagram showing an electrical configuration of an image processing apparatus according to an embodiment of the present invention.

【図2】 実施の形態の画像処理装置を適用する生産ラ
イン検査システムの概要の説明図
FIG. 2 is an explanatory diagram of an outline of a production line inspection system to which the image processing apparatus according to the embodiment is applied;

【図3】 実施の形態の生産ライン検査システムでの画
像処理装置によるパターンマッチングの動作説明図(位
置ずれ無しの場合)
FIG. 3 is an explanatory diagram of an operation of pattern matching by an image processing device in the production line inspection system according to the embodiment (in the case where there is no displacement);

【図4】 上記画像処理装置によるパターンマッチング
の動作説明図(図3に対する位置ずれ補正の場合)
FIG. 4 is an explanatory diagram of an operation of pattern matching by the image processing apparatus (in the case of positional deviation correction with respect to FIG. 3)

【図5】 上記画像処理装置によるパターンマッチング
の動作説明図(図3に対応し、位置ずれ有りの場合)
FIG. 5 is an explanatory diagram of an operation of pattern matching by the image processing apparatus (corresponding to FIG. 3 and when there is a position shift)

【図6】 上記画像処理装置によるパターンマッチング
の動作説明図(図4に対応し、位置ずれ有りの場合)
FIG. 6 is an explanatory diagram of an operation of pattern matching by the image processing apparatus (corresponding to FIG. 4, in the case where there is a displacement)

【図7】 上記画像処理装置による再設定での現在の
(元の)各領域の設定の状況を示す説明図
FIG. 7 is an explanatory diagram showing a current setting state of each (original) area in resetting by the image processing apparatus;

【図8】 上記画像処理装置による再設定での計測対象
物の位置調整の段階の説明図
FIG. 8 is an explanatory diagram of a stage of adjusting the position of the measurement target in resetting by the image processing apparatus.

【図9】 上記画像処理装置による再設定での基準サー
チ領域の設定の説明図
FIG. 9 is an explanatory diagram of setting of a reference search area in resetting by the image processing apparatus.

【図10】 上記画像処理装置による再設定での補正量
の算出の説明図
FIG. 10 is an explanatory diagram of calculation of a correction amount in resetting by the image processing apparatus.

【図11】 上記画像処理装置による再設定での位置決
め用基準画像検出領域の設定の説明図
FIG. 11 is an explanatory diagram of setting of a reference image detection area for positioning in resetting by the image processing apparatus.

【図12】 上記画像処理装置による再設定での計測サ
ーチ領域の設定の説明図
FIG. 12 is an explanatory diagram of setting of a measurement search area in resetting by the image processing apparatus.

【図13】 上記画像処理装置による再設定での計測対
象基準画像検出領域の設定の説明図
FIG. 13 is an explanatory diagram of setting of a measurement target reference image detection area in resetting by the image processing apparatus.

【図14】 上記画像処理装置による再設定での基準サ
ーチ領域および計測サーチ領域が正常であるときの説明
FIG. 14 is an explanatory diagram when a reference search area and a measurement search area in resetting by the image processing apparatus are normal;

【図15】 上記画像処理装置による再設定での計測サ
ーチ領域が取り込み画像データ全領域を+Y方向にはみ
出したときの説明図
FIG. 15 is an explanatory diagram when the measurement search area in the resetting by the image processing apparatus protrudes the whole area of the captured image data in the + Y direction.

【図16】 上記画像処理装置による再設定での基準サ
ーチ領域が取り込み画像データ全領域を−Y方向にはみ
出したときの説明図
FIG. 16 is an explanatory diagram when the reference search area in the resetting by the image processing apparatus protrudes the whole area of the captured image data in the −Y direction.

【図17】 上記画像処理装置による再設定での基準サ
ーチ領域が取り込み画像データ全領域を−X方向にはみ
出したときの説明図
FIG. 17 is an explanatory diagram when the reference search area in the resetting by the image processing apparatus protrudes the whole area of the captured image data in the −X direction.

【図18】 上記画像処理装置による再設定での計測サ
ーチ領域が取り込み画像データ全領域を+X方向にはみ
出したときの説明図
FIG. 18 is an explanatory diagram when the measurement search area in the resetting by the image processing apparatus protrudes the whole area of the captured image data in the + X direction.

【図19】 上記画像処理装置による再設定での計測対
象基準画像検出領域を複数設定する場合の説明図
FIG. 19 is a diagram illustrating a case where a plurality of measurement target reference image detection areas are set by resetting by the image processing apparatus.

【図20】 上記画像処理装置による再設定の動作を示
す概略のフローチャート
FIG. 20 is a schematic flowchart showing an operation of resetting by the image processing apparatus.

【図21】 再設定のときに基準サーチ領域や計測サー
チ領域の形状・サイズを変更する場合の再設定の動作を
示す概略のフローチャート
FIG. 21 is a schematic flowchart showing the resetting operation when changing the shape and size of the reference search area and the measurement search area at the time of resetting;

【図22】 位置ずれ判定条件の補正を行う場合の再設
定の動作を示す概略のフローチャート
FIG. 22 is a schematic flowchart showing an operation of resetting when correcting a position shift determination condition.

【符号の説明】[Explanation of symbols]

1…画像処理装置、2…CCDカメラ、3…A/D変換
器、4…カメラ・表示コントローラ、5…フレームメモ
リ、6…CPU、7…ROM、8…RAM、9…入出力
インターフェイス、10…バス、11…D/A変換器、
12…モニタ、13…入力操作部、14…警報器、15
…外部記憶装置、16…EEPROM、20…生産ライ
ン検査システム、21…搬送手段、22…到達検出手段
(光電センサ)、23…ケーブル、30…計測対象物
(容器)、31…容器本体、32…キャップ、40…ラ
ベル、50…容器画像、51…容器本体画像、60…キ
ャップ画像、70…ラベル画像、80…背景画像、10
0…取り込み画像データ全領域、DP…検査ポイント、
D1…位置決め用基準画像検出領域、D2…基準サーチ
領域、D3…計測対象基準画像検出領域、D4…計測サ
ーチ領域、P…基準位置座標、Q…計測対象位置座標、
D1′…もとの位置決め用基準画像検出領域、D2′…
もとの基準サーチ領域、D3′…もとの計測対象基準画
像検出領域、D4′…もとの計測サーチ領域、P′…も
との基準位置座標、Q′…もとの計測対象位置座標、Δ
X1,ΔY1…補正量、M…CCDカメラを移動させる
べき方向矢印標記、N…計測対象物を移動させるべき方
向矢印標記
DESCRIPTION OF SYMBOLS 1 ... Image processing apparatus, 2 ... CCD camera, 3 ... A / D converter, 4 ... Camera / display controller, 5 ... Frame memory, 6 ... CPU, 7 ... ROM, 8 ... RAM, 9 ... Input / output interface, 10 ... bus, 11 ... D / A converter,
12 monitor, 13 input operation unit, 14 alarm device, 15
... external storage device, 16 ... EEPROM, 20 ... production line inspection system, 21 ... transportation means, 22 ... arrival detection means (photoelectric sensor), 23 ... cable, 30 ... measurement object (container), 31 ... container body, 32 ... cap, 40 ... label, 50 ... container image, 51 ... container image, 60 ... cap image, 70 ... label image, 80 ... background image, 10
0: whole area of captured image data, DP: inspection point,
D1: positioning reference image detection area, D2: reference search area, D3: measurement target reference image detection area, D4: measurement search area, P: reference position coordinates, Q: measurement target position coordinates,
D1 ': Original positioning reference image detection area, D2':
Original reference search area, D3 '... Original measurement target reference image detection area, D4' ... Original measurement search area, P '... Original reference position coordinates, Q' ... Original measurement target position coordinates , Δ
X1, ΔY1: correction amount, M: directional arrow mark to move CCD camera, N: directional arrow mark to move measurement object

フロントページの続き Fターム(参考) 2F065 AA03 AA49 BB15 CC00 EE00 FF04 FF26 JJ03 JJ26 LL06 NN11 PP03 PP05 PP15 QQ03 QQ23 QQ24 QQ25 QQ36 QQ39 SS09 SS13 5B057 AA02 BA02 CA08 CA13 CB08 CB12 CC03 DA03 DA07 DA08 DB02 DB09 DC07 5C022 AA01 AB62 AC01 AC42 5C054 AA01 AA05 CA04 CC02 CD05 CE14 CG02 CH03 CH04 DA01 EA05 EA07 FA01 FA02 FB01 FB03 FC12 FC15 FE22 FE28 FF02 FF03 FF07 GB12 GB15 GD09 HA03 Continued on the front page F-term (reference) 2F065 AA03 AA49 BB15 CC00 EE00 FF04 FF26 JJ03 JJ26 LL06 NN11 PP03 PP05 PP15 QQ03 QQ23 QQ24 QQ25 QQ36 QQ39 SS09 SS13 5B057 AA02 BA02 CA08 CA13 CB08 DB07 DA02 AC42 5C054 AA01 AA05 CA04 CC02 CD05 CE14 CG02 CH03 CH04 DA01 EA05 EA07 FA01 FA02 FB01 FB03 FC12 FC15 FE22 FE28 FF02 FF03 FF07 GB12 GB15 GD09 HA03

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 撮像した計測対象物の画像データについ
て基準サーチ領域内の位置決め用基準画像検出領域での
基準位置座標を検出するとともに計測サーチ領域内の計
測対象基準画像検出領域での計測対象位置座標を検出
し、前記基準位置座標に対する前記計測対象位置座標の
相対的位置関係から検査対象の良否を判定する画像処理
装置であって、前記基準サーチ領域および前記計測サー
チ領域と取り込み画像との相対位置がずれている状態で
行う再設定のときに、初期設定時の取り込み画像に対す
る両サーチ領域の相対的位置関係が再設定後でも同じに
なるように補正を行うことにより、前記計測サーチ領域
のみを移動させても前記基準サーチ領域の再設定が不要
になるように構成してあることを特徴とする画像処理装
置。
1. A method of detecting a reference position coordinate in a positioning reference image detection area in a reference search area for a captured image data of a measurement object, and a measurement target position in a measurement target reference image detection area in the measurement search area. An image processing apparatus that detects coordinates and determines the acceptability of an inspection target based on a relative positional relationship of the measurement target position coordinates with respect to the reference position coordinates, wherein a relative position between the reference search region and the measurement search region and a captured image is determined. At the time of resetting performed in a state where the position is shifted, by performing correction so that the relative positional relationship between the two search areas with respect to the captured image at the time of initial setting becomes the same even after resetting, only the measurement search area is The image processing apparatus is characterized in that it is not necessary to reset the reference search area even if is moved.
【請求項2】 前記の再設定後の基準サーチ領域および
計測サーチ領域が取り込み画像データ全領域の内部に収
まっていないときは、撮像手段の視野変更のための移動
方向の指示の表示または計測対象物の移動方向の指示の
表示を行うように構成してあることを特徴とする請求項
1に記載の画像処理装置。
2. When the reference search area and the measurement search area after the resetting do not fall within the entire area of the captured image data, display of a moving direction instruction for changing the field of view of the imaging means or measurement target 2. The image processing apparatus according to claim 1, wherein an instruction of a moving direction of an object is displayed.
【請求項3】 必要に応じて、位置ずれ判定条件の補正
を行い、その補正後の位置ずれ判定条件が許容範囲に収
まっているか否かを判定するように構成してあることを
特徴とする請求項1または請求項2に記載の画像処理装
置。
3. The apparatus according to claim 1, wherein the position deviation determination condition is corrected as required, and it is determined whether or not the corrected position deviation determination condition falls within an allowable range. The image processing apparatus according to claim 1.
【請求項4】 前記計測対象物が搬送されるものであ
り、その搬送経路の所要の検査ポイントに前記計測対象
物が到達したことを検出する到達検出手段を備えてお
り、この到達検出手段による検出信号をトリガとして前
記計測対象物の撮像および検査対象の良否の判定を行う
ように構成してあることを特徴とする請求項1から請求
項3までのいずれかに記載の画像処理装置。
4. An apparatus according to claim 1, wherein said measurement object is transported, and said arrival detection means detects that said measurement object has arrived at a required inspection point on said transport path. The image processing apparatus according to any one of claims 1 to 3, wherein the detection signal is used as a trigger to perform imaging of the measurement target and determination of whether the inspection target is good or not.
【請求項5】 前記計測対象物の検査対象が画像データ
上の二次元的な位置であることを特徴とする請求項1か
ら請求項4までのいずれかに記載の画像処理装置。
5. The image processing apparatus according to claim 1, wherein the inspection target of the measurement target is a two-dimensional position on the image data.
JP11145154A 1999-05-25 1999-05-25 Image processor Pending JP2000339458A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11145154A JP2000339458A (en) 1999-05-25 1999-05-25 Image processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11145154A JP2000339458A (en) 1999-05-25 1999-05-25 Image processor

Publications (1)

Publication Number Publication Date
JP2000339458A true JP2000339458A (en) 2000-12-08

Family

ID=15378685

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11145154A Pending JP2000339458A (en) 1999-05-25 1999-05-25 Image processor

Country Status (1)

Country Link
JP (1) JP2000339458A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006214870A (en) * 2005-02-03 2006-08-17 Hitachi Metals Ltd Shape measuring system, method, and program
JP2007502110A (en) * 2003-08-11 2007-02-08 リレルート,クリスチャン Method and apparatus for recording and estimating the weight of fish
JP2011191943A (en) * 2010-03-12 2011-09-29 Omron Corp Apparatus and program for processing image
JP2015145796A (en) * 2014-01-31 2015-08-13 株式会社キーエンス Image inspection device, image inspection method, image inspection program, and computer-readable recording medium
JP2015145797A (en) * 2014-01-31 2015-08-13 株式会社キーエンス Image inspection device, image inspection method, image inspection program, and computer-readable recording medium
JP2016506515A (en) * 2012-12-20 2016-03-03 エムエスセ エ エスジェセセMsc & Sgcc Method and apparatus for measuring the verticality of a container
JP2017078621A (en) * 2015-10-20 2017-04-27 株式会社デンソー Inspection system
JP2018010021A (en) * 2017-10-24 2018-01-18 株式会社キーエンス Image inspection device

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007502110A (en) * 2003-08-11 2007-02-08 リレルート,クリスチャン Method and apparatus for recording and estimating the weight of fish
JP2006214870A (en) * 2005-02-03 2006-08-17 Hitachi Metals Ltd Shape measuring system, method, and program
JP4683324B2 (en) * 2005-02-03 2011-05-18 日立金属株式会社 Shape measuring system, shape measuring method and shape measuring program
JP2011191943A (en) * 2010-03-12 2011-09-29 Omron Corp Apparatus and program for processing image
JP2016506515A (en) * 2012-12-20 2016-03-03 エムエスセ エ エスジェセセMsc & Sgcc Method and apparatus for measuring the verticality of a container
JP2015145796A (en) * 2014-01-31 2015-08-13 株式会社キーエンス Image inspection device, image inspection method, image inspection program, and computer-readable recording medium
JP2015145797A (en) * 2014-01-31 2015-08-13 株式会社キーエンス Image inspection device, image inspection method, image inspection program, and computer-readable recording medium
JP2017078621A (en) * 2015-10-20 2017-04-27 株式会社デンソー Inspection system
JP2018010021A (en) * 2017-10-24 2018-01-18 株式会社キーエンス Image inspection device

Similar Documents

Publication Publication Date Title
TWI249351B (en) Image processing system, projector, and image processing method
US11838497B2 (en) Calibration of a surround view camera system
JP3946716B2 (en) Method and apparatus for recalibrating a three-dimensional visual sensor in a robot system
US6898486B2 (en) Position detecting device and takeout apparatus with position detecting device
US9122123B2 (en) Projector having focus adjusting section for adjusting projection based on projection distance information, computer program product, and image projecting method
JP2000339458A (en) Image processor
KR100771496B1 (en) Calibrating apparatus and method of marking for laser marking system
US6452503B1 (en) Semiconductor wafer imaging system
JP2830839B2 (en) Distance measuring device
US11956537B2 (en) Location positioning device for moving body and location positioning method for moving body
JP3741136B2 (en) Obstacle adaptive projection display
JP3604587B2 (en) Image processing device
JP4032052B2 (en) Position detection apparatus and correction method thereof
JP2005523820A (en) Marking correction method for laser marking system
JP2006108457A (en) Mounting error detection method and device of electronic part mounting device
JP3691888B2 (en) Electronic component mounting method
JP4707607B2 (en) Image acquisition method for component recognition data creation and component mounter
JP2007240197A (en) Three-dimensional shape measuring system
KR100520899B1 (en) Calibrating method of marking for lazer marking system
WO2022180453A1 (en) Information processing apparatus, information processing system, information processing method, and recording medium
JP2000331162A (en) Image processor
JP3351228B2 (en) Mobile robot handling position / posture correction device
JPH1196378A (en) Load position/attitude recognizing device
JP2000331163A (en) Image processor
KR100486088B1 (en) Calibrating method of marking for lazer marking system using post vision camera

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20040309