JP3433331B2 - Image inspection method and apparatus - Google Patents
Image inspection method and apparatusInfo
- Publication number
- JP3433331B2 JP3433331B2 JP06213594A JP6213594A JP3433331B2 JP 3433331 B2 JP3433331 B2 JP 3433331B2 JP 06213594 A JP06213594 A JP 06213594A JP 6213594 A JP6213594 A JP 6213594A JP 3433331 B2 JP3433331 B2 JP 3433331B2
- Authority
- JP
- Japan
- Prior art keywords
- line segment
- pixel data
- image
- data
- positional deviation
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
Landscapes
- Inking, Control Or Cleaning Of Printing Machines (AREA)
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
- Image Processing (AREA)
- Image Analysis (AREA)
Description
【0001】[0001]
【産業上の利用分野】本発明は、基準画像と検査対象画
像との位置ずれ補正を行って、両者を比較して検査する
画像検査方法及び装置に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image inspection method and apparatus for correcting the displacement between a reference image and an image to be inspected and comparing them for inspection.
【0002】[0002]
【従来の技術】印刷物の不良には、印刷用紙の皺、異
物、汚れ等の欠陥によるもの、印刷中に発生する、イン
キ汚れ、ヒッキー、ドクター筋、濃度不良、色調不良
等、様々なものがある。従来、印刷物の検査は、人間に
よって行われる目視検査が主体であり、例えば、枚葉印
刷機、あるいは印刷機の折ユニットから排出される印刷
後の印刷物においては、印刷機のオペレータが適時抜き
取って、目視による検査を行っていた。また、連続した
印刷物が印刷機より排出され抜き取りの行えない場合
は、印刷物の走行速度に同期させて瞬間発光するストロ
ボ光を印刷物に照射し、人間の目の残像を利用して静止
状態とし印刷物の目視検査を行っていた。2. Description of the Related Art Defects in printed matter are caused by defects such as wrinkles, foreign substances, and stains on printing paper, ink stains, hickies, doctor streaks, poor density, poor color tone, etc. that occur during printing. is there. Conventionally, the inspection of the printed matter is mainly a visual inspection performed by a human.For example, in the case of the printed matter discharged from a sheet-fed printing press or a folding unit of the printing press, the operator of the printing press pulls it out at appropriate times. , Visual inspection was performed. If continuous printed matter is ejected from the printing machine and cannot be extracted, the printed matter is irradiated with strobe light that instantaneously emits light in synchronization with the running speed of the printed matter, and the afterimage of the human eye is used to stop the printed matter. Was being visually inspected.
【0003】目視検査は検査する人間に対する作業負荷
が非常に大きく、また人間が行うため不良の見逃しが避
けられないものである。そこで、印刷物検査を自動的に
行う提案がなされ様々な技術が開示されている。例え
ば、特公平1−47823には、正常な印刷物が印刷さ
れた時点で走行印刷物の絵柄から読み取った画像データ
を基準画像データとして画像メモリに記憶しておき、そ
の画像メモリから読み出した基準画像データを、印刷中
の検査対象の印刷物の絵柄から読み取った検査対象画像
データと画素単位で比較して印刷の良否判定を行う方式
の印刷物の検査装置に関する技術が開示されている。The visual inspection imposes a very heavy work load on the person to be inspected, and since it is performed by a person, it is unavoidable to overlook defects. Therefore, various techniques have been disclosed by making a proposal for automatically inspecting a printed matter. For example, in Japanese Examined Patent Publication No. 1-47823, the image data read from the pattern of the running print at the time when the normal printed matter is printed is stored in the image memory as reference image data, and the reference image data read from the image memory is stored. There is disclosed a technique relating to a printed matter inspection apparatus of a system in which the quality of printing is determined by comparing, in pixel units, with the inspection target image data read from the pattern of the printed matter of the inspection target being printed.
【0004】ところが、基準画像データと検査対象画像
データとを画素単位で比較する場合、不良検出の精度を
高めると両データ間の位置ずれがわずかである場合でも
位置ずれを不良と誤検出し、位置ずれを不良と誤検出し
ないようにするためには不良検出の精度を低下させるこ
とが必要であり、ある程度の位置ずれを避け得ない場合
には要求を満足するに充分な検査性能が得られなかっ
た。そこで、特公平1−20477には、検査対象画像
データまたは基準画像データを1画素ずつ印刷物の走行
方向に対して左右方向に位置ずれさせて、検査対象画像
データと基準画像データを比較し、両データが最も一致
したときの両データ間の位置ずれ量に基づき、位置ずれ
を補正した上で、検査対象画像データと基準画像データ
を比較するという技術が開示されている。However, when the reference image data and the image data to be inspected are compared on a pixel-by-pixel basis, if the accuracy of defect detection is increased, even if the positional deviation between both data is slight, the positional deviation is erroneously detected as a defect, In order to prevent misregistration of misalignment as a defect, it is necessary to reduce the accuracy of defect detection.If some misalignment cannot be avoided, sufficient inspection performance can be obtained to satisfy the requirements. There wasn't. Therefore, in Japanese Examined Patent Publication No. 1-20477, the inspection target image data or the reference image data is displaced pixel by pixel in the left-right direction with respect to the traveling direction of the printed matter, and the inspection target image data and the reference image data are compared. A technique is disclosed in which the positional deviation is corrected based on the positional deviation amount between the two pieces of data when the data are most matched, and then the inspection target image data and the reference image data are compared.
【0005】[0005]
【発明が達成しようとする課題】しかしながら従来の自
動検査技術における画像の位置ずれ補正の方法は、検査
対象画像データと基準画像データとを比較するという、
データ量の極めて大きい画像データを処理するものであ
るために、膨大な処理時間を要してしまうという問題が
あった。したがって本発明の目的は、処理時間が短く信
頼度の高い位置ずれ補正を行って画像の検査を行うこと
のできる画像検査方法及びその装置を提供することであ
る。However, in the conventional method for correcting the positional deviation of the image in the automatic inspection technique, the inspection target image data and the reference image data are compared.
There is a problem that an enormous amount of processing time is required because the image data having an extremely large amount of data is processed. SUMMARY OF THE INVENTION It is therefore an object of the present invention to provide an image inspection method and apparatus capable of inspecting an image by performing highly reliable positional deviation correction with a short processing time.
【0006】[0006]
【課題を達成するための手段】上記目的は、下記の本発
明によって達成される。すなわち、第1発明である、基
準画像と比較して検査対象画像を検査する画像検査方法
において、位置ずれを補正すべき方向と平行方向の線分
に対応する画素列の位置である線分位置を選択する線分
位置選択過程と、その線分位置選択過程で選択された線
分位置の基準画像上の基準画素データ列を抽出する第1
データ抽出過程と、その線分位置およびその線分位置か
ら画素単位で線分方向に位置変化させた複数の位置から
検査対象画像上の複数の検査対象画素データ列を抽出す
る第2データ抽出過程と、その第1データ抽出過程で抽
出された基準画素データ列とその第2データ抽出過程で
抽出された複数の検査対象画素データ列とから相関係数
を得る相関係数演算過程と、その相関係数演算過程で得
られた相関係数の中で最大の相関係数を与える検査対象
画素データ列の位置のデータと前記線分位置のデータか
ら位置ずれ量を得る位置ずれ量演算過程と、まず天地方
向について前記位置ずれ量を得て、その天地方向の位置
ずれ量にしたがって検出対象画素データの左右方向の線
分位置を補正する線分位置補正過程と、その後残る左右
方向について前記補正した左右方向の線分位置に基づい
て前記位置ずれ量を得て、それら各前記位置ずれ量に基
づいて2方向に位置ずれを補正して基準画像と比較して
検査対象画像を検査する位置ずれ補正比較過程とを含む
画像検査方法。The above object can be achieved by the present invention described below. That is, in the image inspection method for inspecting an image to be inspected by comparing with a reference image, which is the first aspect of the present invention, a line segment position which is a position of a pixel row corresponding to a line segment in a direction parallel to a direction in which positional deviation is to be corrected. Selecting a line segment position, and extracting a reference pixel data string on the reference image at the line segment position selected in the line segment position selecting step
Data extraction step and second data extraction step of extracting a plurality of inspection target pixel data strings on the inspection target image from the line segment position and a plurality of positions that are changed in the line segment direction in pixel units from the line segment position And a correlation coefficient calculation process for obtaining a correlation coefficient from the reference pixel data sequence extracted in the first data extraction process and the plurality of inspection target pixel data sequences extracted in the second data extraction process, and the phase thereof. A positional shift amount calculation step of obtaining a positional shift amount from the data of the position of the inspection target pixel data row giving the maximum correlation coefficient among the correlation coefficients obtained in the relation number calculation step and the line segment position data, First Heaven
The position in the up-and-down direction after obtaining the above-mentioned amount of misalignment
Lines in the left and right direction of the pixel data to be detected according to the amount of deviation
Line segment position correction process to correct the segment position and left and right
Based on the corrected line segment position in the left-right direction
To obtain the positional deviation amount, and based on each of the positional deviation amounts.
Then, adjust the displacement in two directions and compare it with the reference image.
An image inspection method including a positional deviation correction comparison process for inspecting an image to be inspected .
【0007】第2発明である、基準画像と比較して検査
対象画像を検査する画像検査装置において、位置ずれを
補正すべき方向と平行方向の線分に対応する画素列の位
置である線分位置を選択する線分位置選択手段と、その
線分位置選択手段で選択された線分位置の基準画像上の
基準画素データ列を抽出する第1データ抽出手段と、そ
の線分位置およびその線分位置から画素単位で線分方向
に位置変化させた複数の位置から検査対象画像上の複数
の検査対象画素データ列を抽出する第2データ抽出手段
と、その第1データ抽出手段で抽出された基準画素デー
タ列とその第2データ抽出手段で抽出された複数の検査
対象画素データ列とから相関係数を得る相関係数演算手
段と、その相関係数演算手段で得られた相関係数の中で
最大の相関係数を与える検査対象画素データ列の位置の
データと前記線分位置のデータから位置ずれ量を得る位
置ずれ量演算手段と、まず天地方向について前記位置ず
れ量を得て、その天地方向の位置ずれ量にしたがって検
出対象画素データの左右方向の線分位置を補正する線分
位置補正手段と、その後残る左右方向について前記補正
した左右方向の線分位置に基づいて前記位置ずれ量を得
て、それら各前記位置ずれ量に基づいて2方向に位置ず
れを補正して基準画像と比較して検査対象画像を検査す
る位置ずれ補正比較手段とを含む画像検査装置。 In the second aspect of the invention, which is an image inspection apparatus for inspecting an image to be inspected by comparing it with a reference image, a line segment that is a position of a pixel row corresponding to a line segment in a direction parallel to a direction in which misregistration is to be corrected. Line segment position selecting means for selecting a position, first data extracting means for extracting a reference pixel data string on the reference image at the line segment position selected by the line segment position selecting means, the line segment position and its line Second data extraction means for extracting a plurality of inspection target pixel data strings on the inspection target image from a plurality of positions that are position-changed in pixel units from the split position and extracted by the first data extraction means. Correlation coefficient calculating means for obtaining a correlation coefficient from the reference pixel data string and the plurality of inspection object pixel data strings extracted by the second data extracting means, and the correlation coefficient calculating means by the correlation coefficient calculating means. The largest correlation coefficient An inspection object pixel data column position deviation amount calculating means and the position data obtaining position deviation amount from the data of the line positions of the obtaining, not a first said position the vertical direction
The amount of deviation is obtained, and detection is performed according to the amount of displacement in the vertical direction.
A line segment that corrects the horizontal line segment position of output target pixel data
Position correction means and the above-mentioned correction for left and right directions remaining thereafter
Based on the horizontal line segment position
Based on each of the above-mentioned displacement amounts,
Correct this and compare with the reference image to inspect the image to be inspected
An image inspection apparatus including a positional deviation correction comparing unit.
【0008】第3発明である、前記線分位置選択手段に
より選択される前記線分位置は複数であって、それら各
前記線分位置に対して位置ずれ量を得て、それら位置ず
れ量の中の中位値の位置ずれ量に基づいて位置ずれを補
正して基準画像と比較して検査対象画像を検査する第2
発明の画像検査装置。第4発明である、前記線分位置選
択手段は、その線分位置選択手段で選択された線分位置
の基準画像上の基準画素データ列が線分と垂直方向に画
素データの変化が少なく、かつ線分と平行方向に画素デ
ータの変化が大きい線分位置を選択する線分位置選択手
段である第2、3発明の画像検査装置。第5発明であ
る、前記第1データ抽出手段は、その第1データ抽出手
段により抽出される基準画素データ列が、前記線分位置
の基準画像上の画素データ列及び、線分と直角方向にそ
れに隣接する所定数の画素データ列の対応する画素ごと
の画素データの加算平均値を画素データとする画素デー
タ列である第1データ抽出手段であり、かつ前記第2デ
ータ抽出手段は、その第2データ抽出手段により抽出さ
れる複数の検査対象画素データ列が、前記線分位置およ
びその線分位置から画素単位で線分方向に位置変化させ
た複数の各位置について、線分と直角方向に各位置ごと
にその位置に隣接する所定数の画素データ列の対応する
画素ごとの画素データの加算平均値を求め、それを画素
データとする複数の画素データ列である第2データ抽出
手段である、第2〜4発明の画像検査装置。According to a third aspect of the invention , there are a plurality of line segment positions selected by the line segment position selecting means, and the positional shift amount is obtained for each of the line segment positions, and the positional shift amounts are calculated. Second , inspecting the image to be inspected by correcting the positional shift based on the medium-level positional shift amount and comparing it with the reference image
The image inspection apparatus of the invention . According to a fourth aspect of the present invention , in the line segment position selecting means, the reference pixel data string on the reference image at the line segment position selected by the line segment position selecting means has little change in pixel data in a direction perpendicular to the line segment, The image inspection apparatus according to the second or third aspect of the invention , which is a line segment position selecting unit that selects a line segment position in which the pixel data changes largely in the direction parallel to the line segment. According to a fifth aspect of the present invention , in the first data extracting means, the reference pixel data sequence extracted by the first data extracting means is in a direction perpendicular to the pixel data sequence on the reference image at the line segment position and the line segment. The first data extracting means is a pixel data row having pixel data of an average value of pixel data of corresponding pixels of a predetermined number of pixel data rows adjacent thereto, and the second data extracting means is the first data extracting means. 2 The plurality of inspection target pixel data strings extracted by the data extracting means are arranged in the direction perpendicular to the line segment for each of the line segment position and each of the plurality of positions that are changed in the pixel unit from the line segment position in the pixel unit direction. A second data extraction unit that is a plurality of pixel data strings that obtains an addition average value of pixel data for each corresponding pixel of a predetermined number of pixel data strings adjacent to that position for each position, and that is the pixel data string. There, the image inspection device of the second to fourth invention.
【0009】[0009]
【作用】本発明の画像検査方法及び装置においては、基
準画像と検査対象画像とを位置ずれを補正して比較し検
査を行う。その位置ずれを補正する方法は、まず補正す
べき方向と平行方向の線分に対応する画素列の位置であ
る線分位置を選択し、その線分位置の基準画像上の基準
画素データ列を抽出して、更にその線分位置およびその
線分位置から画素単位で線分方向に位置変化させた複数
の位置から検査対象画像上の複数の検査対象画素データ
列を抽出する。そして、その基準画素データ列とその複
数の検査対象画素データ列とから相関係数を得て、その
相関係数の中で最大の相関係数を与える検査対象画素デ
ータ列の位置のデータと前記線分位置のデータから位置
ずれ量を得る。その位置ずれ量は、まず天地方向につい
て得て、その天地方向の位置ずれ量にしたがって検出対
象画素データの左右方向の線分位置を補正する。しかる
後それら2方向の位置ずれ量に基づいて位置ずれを補正
して基準画像と比較して検査対象画像を検査する。In the image inspection method and apparatus of the present invention, the reference image and the image to be inspected are corrected by comparing their positional deviations and then compared. The method of correcting the positional deviation is to first select a line segment position that is the position of the pixel column corresponding to the line segment in the direction parallel to the direction to be corrected, and then set the reference pixel data sequence on the reference image at that line segment position. Then, a plurality of inspection target pixel data strings on the inspection target image are extracted from the line segment position and a plurality of positions in which the line segment position is changed pixel by pixel in the line segment direction. Then, a correlation coefficient is obtained from the reference pixel data sequence and the plurality of inspection target pixel data sequences, and the position data of the inspection target pixel data sequence that gives the maximum correlation coefficient among the correlation coefficients and the data The displacement amount is obtained from the data of the line segment position. The amount of misalignment is first measured in the vertical direction.
And the detected pair according to the amount of vertical displacement.
The position of the line segment in the left-right direction of the phantom pixel data is corrected. After that, the positional deviation is corrected based on the positional deviation amounts in the two directions and compared with the reference image to inspect the inspection target image.
【0010】この本発明の画像検査方法及び装置によれ
ば、データ量の極めて大きい2次元の画像データを処理
するのではなく、1次元の画像データを処理するため
に、処理時間は極めて短くすることができ、また一般に
位置ずれ量が大きい天地方向の位置ずれ補正を先に行な
うため信頼性が高い。 According to the image inspection method and apparatus of the present invention,
Processing two-dimensional image data with extremely large data volume
To process one-dimensional image data rather than
In addition, the processing time can be extremely short, and in general
The amount of displacement is large.
Therefore, it is highly reliable.
【0011】また、選択される前記線分位置は複数であ
って、それら各前記線分位置に対して位置ずれ量を得
て、それら位置ずれ量の中の中位値の位置ずれ量に基づ
いて位置ずれを補正して基準画像と比較して検査対象画
像を検査することによって、外乱要因等により複数の位
置ずれ補正量の一部に誤りが生じても、信頼度の高い正
しい補正量を得ることができる。Further, there are a plurality of the line segment positions selected, the positional shift amounts are obtained for the respective line segment positions, and the positional shift amount of the median value of the positional shift amounts is based on the positional shift amount. By inspecting the image to be inspected by correcting the displacement and comparing it with the reference image, the correct correction amount with high reliability can be obtained even if some of the displacement correction errors occur due to factors such as disturbances. Obtainable.
【0012】また、線分位置の選択において選択された
線分位置の基準画像上の基準画素データ列が線分と垂直
方向に画素データの変化が少なく、かつ線分と平行方向
に画素データの変化が大きくなる線分位置を選択するこ
とによって、線分と垂直方向の位置ずれの影響を受けに
くくし、かつ相関量を算出する際のデータ量を保証し、
信頼度の高い正しい補正量を得ることができる。Further, in the reference pixel data string on the reference image at the line segment position selected in the selection of the line segment position, there is little change in the pixel data in the direction perpendicular to the line segment, and the pixel data is arranged in the direction parallel to the line segment. By selecting the position of the line segment where the change is large, it is less susceptible to the misalignment of the line segment and the vertical direction, and the data amount when calculating the correlation amount is guaranteed,
A correct correction amount with high reliability can be obtained.
【0013】また、第1データ抽出手段により抽出され
る基準画素データ列が、前記線分位置の基準画像上の画
素データ列及び、前記線分と平行する所定数の画素デー
タ列の対応する画素ごとの画素データの加算平均値を画
素データとする画素データ列であり、また第2データ抽
出手段により抽出される複数の検査対象画素データ列
が、前記線分位置およびその線分位置から画素単位で線
分方向に位置変化させた複数の各位置について、線分と
直角方向に各位置ごとにその位置に平行する所定数の画
素データ列の対応する画素ごとの画素データの加算平均
値を求め、それを画素データとする複数の画素データ列
であることにより、線分と垂直方向の位置ずれの影響を
低減し、信頼度の高い正しい補正量を得ることができ
る。The reference pixel data string extracted by the first data extracting means is a pixel data string on the reference image at the line segment position and a corresponding pixel of a predetermined number of pixel data strings parallel to the line segment. A plurality of inspection object pixel data strings extracted by the second data extracting means are pixel data strings in which the arithmetic mean value of the pixel data for each pixel data is used as pixel data. For each of a plurality of positions whose positions have been changed in the direction of the line segment, the arithmetic mean value of the pixel data for each corresponding pixel of the predetermined number of pixel data rows parallel to the position is obtained for each position in the direction perpendicular to the line segment. Since it is a plurality of pixel data strings using it as pixel data, it is possible to reduce the influence of misalignment in the vertical direction with respect to the line segment and obtain a correct correction amount with high reliability.
【0014】[0014]
【実施例】対象となる画像が、例えば印刷物である場合
には、印刷機における印刷物の走行系の精度により、蛇
行等による左右方向のずれ、テンション変動等による天
地方向のずれは避けられない。これら位置ずれを有する
2枚の画像を照合検査すると誤検出の原因となってしま
うため、位置ずれ補正を行った後、照合検査を行う必要
がある。従来の位置ずれ補正は一方の画像全体を、もし
くは一部の領域と他方の画像の相関値を算出し、最も相
関が高かった位置を補正量としていた。しかし、これら
の方式は処理量が多く、処理速度の点で問題となってい
た。本発明は、画像検査に際して行われる位置ずれ補正
において、処理速度の向上のため、処理量を大幅に低減
し、かつ信頼性を損なわないようするために成されたも
のである。When a target image is, for example, a printed matter, a lateral shift due to meandering or the like and a vertical shift due to tension fluctuation or the like cannot be avoided due to the accuracy of the traveling system of the printed matter in the printing press. Since the collation inspection of these two images having the positional displacement causes the erroneous detection, it is necessary to perform the collation inspection after performing the positional displacement correction. In the conventional misregistration correction, the correlation value of one image as a whole or a partial area and the other image is calculated, and the position having the highest correlation is used as the correction amount. However, these methods have a large amount of processing and have been a problem in terms of processing speed. The present invention is made in order to improve the processing speed in the positional deviation correction performed at the time of image inspection, to significantly reduce the processing amount, and not to impair the reliability.
【0015】図1は、本発明の画像検査方法及び装置に
おけるデータ処理の流れを示すフローチャートである。
図1において、まず補正すべき方向と平行方向の線分に
対応する画素列の位置である線分位置が選択される。選
択される線分位置は1つであっても複数であってよく、
この線分位置選択は基準画像を参照しながら、線分位置
の基準画像上の基準画素データ列が線分と垂直方向に画
素データの変化が少なく、かつ線分と平行方向に画素デ
ータの変化が大きくなる線分位置が選択される(S1線
分位置選択)。このS1は線分位置選択過程及び線分位
置選択手段において行われる。FIG. 1 is a flow chart showing the flow of data processing in the image inspection method and apparatus of the present invention.
In FIG. 1, first, a line segment position, which is a position of a pixel column corresponding to a line segment in a direction parallel to the direction to be corrected, is selected. The line segment position selected may be one or plural,
This line segment position selection refers to the reference image, and the reference pixel data string on the reference image at the line segment position has little change in pixel data in the direction perpendicular to the line segment and changes in pixel data in the direction parallel to the line segment. Is selected (S1 line segment position selection). This S1 is performed in the line segment position selection process and the line segment position selection means.
【0016】次に、S1で選択された線分位置の基準画
像上の基準画素データ列が抽出される。その際、基準画
素データ列は線分位置の基準画像上の単体の画素データ
列であってもよく、また基準画素データ列は前記線分位
置の基準画像上の画素データ列及び、線分と直角方向に
それに隣接する所定数の画素データ列の対応する画素ご
との画素データの加算平均値を画素データとする画素デ
ータ列であってもよい。そのような方法によって基準画
素データ列が抽出される(S2第1データ抽出)。この
S2は第1データ抽出過程及び第1データ抽出手段にお
いて行われる。Next, the reference pixel data string on the reference image at the line segment position selected in S1 is extracted. At that time, the reference pixel data sequence may be a single pixel data sequence on the reference image at the line segment position, and the reference pixel data sequence is the pixel data sequence on the reference image at the line segment position and the line segment. It may be a pixel data string in which the pixel data is the arithmetic mean value of the pixel data for each corresponding pixel of a predetermined number of pixel data strings adjacent to it in the perpendicular direction. The reference pixel data string is extracted by such a method (S2 first data extraction). This S2 is performed in the first data extraction process and the first data extraction means.
【0017】次に、S1で選択された線分位置及びその
線分位置から画素単位で線分方向に位置変化させた複数
の位置から検査対象画像上の複数の検査対象画素データ
列が抽出される。その際、複数の検査対象画素データ列
は検査対象画像上の前記線分位置およびその線分位置か
ら画素単位で線分方向に位置変化させた単体の画素デー
タ列であってもよく、また複数の検査対象画素データ列
は前記線分位置およびその線分位置から画素単位で線分
方向に位置変化させた複数の各位置について、線分と直
角方向に各位置ごとにその位置に隣接する所定数の画素
データ列の対応する画素ごとの画素データの加算平均値
を求め、それを画素データとする複数の画素データ列で
あってもよい。そのような方法によって検査対象画素デ
ータ列が抽出される(S3第2データ抽出)。このS3
は第2データ抽出過程及び第2データ抽出手段において
行われる。Next, a plurality of inspection target pixel data strings on the inspection target image are extracted from the line segment position selected in S1 and a plurality of positions where the line segment direction is changed in pixel units from the line segment position. It At this time, the plurality of inspection target pixel data rows may be the line segment positions on the inspection target image and a single pixel data row whose position is changed in pixel units in the line segment direction from the line segment positions. Of the inspection target pixel data sequence, the line segment position and a plurality of positions in which the line segment direction is changed in pixel units from the line segment position are adjacent to the line segment in the direction perpendicular to the line segment. It may be a plurality of pixel data strings in which the addition average value of the pixel data for each corresponding pixel of the number of pixel data strings is obtained and used as the pixel data. The inspection target pixel data string is extracted by such a method (S3 second data extraction). This S3
Is performed in the second data extraction process and the second data extraction means.
【0018】次に、S2で抽出された基準画素データ列
とS3で抽出された複数の検査対象画素データ列とから
相関係数が演算される(S4相関係数演算)。S2で抽
出された基準画素データ列が複数の場合は各基準画素デ
ータ列に対して同様の相関係数の演算が行われる。この
S4は相関係数演算過程及び相関係数演算手段において
行われる。Next, a correlation coefficient is calculated from the reference pixel data string extracted in S2 and the plurality of inspection object pixel data strings extracted in S3 (S4 correlation coefficient calculation). When there are a plurality of reference pixel data strings extracted in S2, a similar correlation coefficient is calculated for each reference pixel data string. This S4 is performed in the correlation coefficient calculation process and the correlation coefficient calculation means.
【0019】次に、S2で抽出された基準画素データ列
が一つの場合はS4で演算された相関係数が最大となる
ずらし量を位置ずれ量とする演算が行われる。またS2
で抽出された基準画素データ列が複数の場合は各基準画
素データ列に対する相関係数が最大となるずらし量を比
較して、それら位置ずれ量の中の中位値の位置ずれ量を
位置ずれ量とする演算が行われる(S5位置ずれ量演
算)。このS5は位置ずれ量演算過程及び位置ずれ量演
算手段において行われる。Next, when the number of reference pixel data strings extracted in S2 is one, the displacement amount that maximizes the correlation coefficient calculated in S4 is used as the displacement amount. Also S2
If there are multiple reference pixel data strings extracted in step 3, the shift amounts that maximize the correlation coefficient for each reference pixel data sequence are compared, and the position shift amount of the middle value of the position shift amounts is shifted. The calculation of the amount is performed (S5 position shift amount calculation). This S5 is performed in the positional deviation amount calculation process and the positional deviation amount calculation means.
【0020】次に、S5で得られた位置ずれ量に基づい
て基準画像と検査対象画像との間の位置ずれを補正し
て、基準画像と比較して検査対象画像を検査する(S6
位置ずれ補正比較)。このS6は位置ずれ補正比較過程
及び位置ずれ補正比較手段において行われる。Next, the positional deviation between the reference image and the inspection object image is corrected based on the positional deviation amount obtained in S5, and the inspection object image is inspected by comparing with the reference image (S6).
Misalignment correction comparison). This S6 is performed in the positional deviation correction comparison process and the positional deviation correction comparison means.
【0021】図2は、本発明の画像検査方法及び装置に
おける位置ずれ補正のデータ処理の流れを絵図で示した
ものである。この図2において、図2(a)は基準画像
を示しており、今、図中の点線で表される線分が選択さ
れた線分位置とする。線分位置とは、印刷物、写真フィ
ルムである場合は線分で示された位置そのものである。
またディジタルデータとしての画像データであれば線分
で示された位置の画素の位置、すなわち画素のアドレス
のことである。そしてそれは線分で示されているから画
素列、あるいは画素データ列のアドレスである。FIG. 2 is a pictorial diagram showing the flow of data processing for positional deviation correction in the image inspection method and apparatus of the present invention. In FIG. 2, FIG. 2A shows the reference image, and the line segment represented by the dotted line in the figure is the selected line segment position. The line segment position is the position itself indicated by the line segment in the case of printed matter or photographic film.
In the case of image data as digital data, it means the pixel position at the position indicated by the line segment, that is, the pixel address. Since it is indicated by a line segment, it is the address of the pixel column or pixel data column.
【0022】ディジタルデータとしての画像データは、
各画素のデータ長さが1バイト(8ビット、0〜25
5)、あるいは要求精度により6ビット(0〜63)、
10ビット(0〜1023)等を選択することができ
る。白黒でなくカラー画像データの場合は、3原色に対
応する3倍のデータ長とするのが普通である。またデー
タは、測色学上の輝度値、RGB値、XYZ値、濃度
値、反射率、透過率等であってもよい。しかし通常は、
印刷物、写真フィルムからディジタルデータを得て利用
する場合は、測色学上の厳密な値は必要なく、例えば印
刷不良検査においては検出データの再現性、安定性があ
れば充分な場合が多い。従って検出系等の特性に応じて
検出されるデータとしての濃淡、或いは明るさ、輝度値
に関連したデータを画像データとすることができる。Image data as digital data is
The data length of each pixel is 1 byte (8 bits, 0-25
5), or 6 bits (0 to 63) depending on the required accuracy,
10 bits (0 to 1023) or the like can be selected. In the case of color image data other than black and white, the data length is usually tripled corresponding to the three primary colors. Further, the data may be a colorimetric luminance value, RGB value, XYZ value, density value, reflectance, transmittance and the like. But usually
When digital data is obtained from a printed matter or a photographic film and used, a strict colorimetric value is not necessary, and for example, in printing defect inspection, reproducibility and stability of detection data are often sufficient. Therefore, it is possible to use, as image data, light and shade as data detected according to the characteristics of the detection system or the like, or data related to brightness and luminance values.
【0023】図2において、基準画像の線分位置におけ
る基準画素データ列は、図2(c)のグラフようにな
る。又、図2(b)は検査対象画像を示しており、基準
画像で選択された線分の位置の検査対象画素データ列は
図2(d)のグラフのようになる。この基準画像で選択
された線分位置の検査対象画素データ列とともに、線分
位置を線分方向に画素単位で位置変化させた複数の位置
から検査対象画像上の複数の検査対象画素データ列を抽
出する。In FIG. 2, the reference pixel data string at the line segment position of the reference image is as shown in the graph of FIG. 2 (c). 2B shows the inspection target image, and the inspection target pixel data string at the position of the line segment selected in the reference image is as shown in the graph of FIG. 2D. Along with the inspection target pixel data row at the line segment position selected in this reference image, a plurality of inspection target pixel data rows on the inspection target image are obtained from a plurality of positions where the line segment position is changed in pixel units in the line segment direction. Extract.
【0024】そして、基準画素データ列と複数の検査対
象画素データ列との相関係数を演算する。相関係数の最
も大きい検査対象画素データ列を選択し、その位置から
基準画素データ列の位置を引き算して差を求めれば、そ
の差が位置ずれ補正量である。位置ずれ補正は検査対象
画素データ列の位置から位置ずれ補正量を引き算した位
置を位置ずれ補正後の検査対象画素データ列の位置とす
ればよい。この位置は前述したように、画素データある
いは画素データ列のアドレスと同意味である。Then, the correlation coefficient between the reference pixel data sequence and the plurality of inspection target pixel data sequences is calculated. If the inspection target pixel data string having the largest correlation coefficient is selected and the position of the reference pixel data string is subtracted from the position to obtain the difference, the difference is the misregistration correction amount. The misregistration correction may be performed by using a position obtained by subtracting the misregistration correction amount from the position of the inspection target pixel data string as the position of the inspection object pixel data string after the misregistration correction. As described above, this position has the same meaning as the address of the pixel data or the pixel data string.
【0025】上述の説明では複数の検査対象画素データ
列を抽出することを述べたが、基準画像で選択された線
分位置の検査対象画素データ列だけを抽出して、基準画
素データ列と検査対象画素データ列の相関係数を一方を
ずらしながら演算する方法であってもよい。その場合ず
らすことによってはみ出した画素データは無視し、基準
画素データ列と検査対象画素データ列とで共通する画素
データ列について相関係数を演算することになり、演算
する画素データの量は異なるが、画素データ列が大きけ
れば結果は大きな差異とならない。また、基準画像上で
選択された線分位置を含み、画素データ列のずらす画素
数分だけ余分に検査対象画素データ列を抽出すれば、基
準画素データ列をずらしながら演算する方法であっても
演算する画素データの量は、上述の複数の検査対象画素
データ列を抽出する場合と同じである。得られる結果も
差は無い。In the above description, it has been described that a plurality of inspection object pixel data strings are extracted, but only the inspection object pixel data string at the line segment position selected in the reference image is extracted, and the reference pixel data string and the inspection are extracted. A method of calculating the correlation coefficient of the target pixel data string while shifting one side may be used. In that case, the pixel data protruding by shifting is ignored, and the correlation coefficient is calculated for the pixel data string common to the reference pixel data string and the inspection target pixel data string, and the amount of pixel data to be calculated is different. If the pixel data string is large, the result will not be a big difference. In addition, even if the method includes performing calculation while shifting the reference pixel data string by extracting extra inspection target pixel data strings by the number of pixels to be shifted in the pixel data string including the selected line segment position on the reference image. The amount of pixel data to be calculated is the same as in the case of extracting the plurality of inspection target pixel data strings described above. There is no difference in the results obtained.
【0026】上述の説明では、補正すべき方向が1方向
の場合を説明したが、印刷中の印刷物等においては天地
方向とともに左右方向に位置ずれが発生する。補正すべ
き方向が2方向の場合には、その2方向の中の1方向に
ついて上述した方法で位置ずれ量を得て、その後残る1
方向について同様の方法で位置ずれ量を得て、それらず
れ量に基づいて2方向に位置ずれを補正すればよい。ま
た、選択される線分位置は一つに限るものではなく複数
であってもよい。それら各線分位置に対して上述した方
法で位置ずれ量を得て、それら位置ずれ量の中の中位値
の位置ずれ量に基づいて位置ずれを補正することができ
る。複数にすれば線分位置が一つの場合に比較して信頼
性や精度が増すことなる。中位値の代わりに平均値を求
め、画素位置に対する端数は四捨五入する方法であって
も同様の効果がある。また、複数線分のうち線分位置の
最大最小を除く残りの位置の平均値を求める方法であっ
てもよく、3本の線分を選択して距離の近い2本の平均
値を求める方法であってもよい。In the above description, the case in which the direction to be corrected is one has been described, but in the printed matter or the like being printed, a positional shift occurs in the horizontal direction as well as the vertical direction. When the directions to be corrected are two directions, the amount of positional deviation is obtained by the method described above for one of the two directions, and the remaining 1
It suffices to obtain the positional deviation amount in the same manner for the directions and correct the positional deviation in two directions based on the positional deviation amount. Further, the line segment position selected is not limited to one, but may be plural. It is possible to obtain the positional deviation amount for each of the line segment positions by the above-described method, and correct the positional deviation based on the median positional deviation amount of the positional deviation amounts. If a plurality of line segment positions are provided, the reliability and accuracy are increased as compared with the case where there is one line segment position. Even if the average value is obtained instead of the median value and the fraction with respect to the pixel position is rounded off, the same effect can be obtained. Alternatively, a method of obtaining an average value of the remaining positions of the plurality of line segments other than the maximum and minimum of the line segment positions may be used, and a method of selecting three line segments and obtaining an average value of two close distances May be
【0027】また、線分位置の選択は画像の絵柄内容に
よって適切な位置がある。線分位置の基準画像上の基準
画素データ列が線分と垂直方向に画素データの変化が少
なく、かつ線分と平行方向に画素データの変化が大きく
なる線分位置を選択することによって、より信頼性や精
度が増すことなる。そのような位置を見い出す方法とし
ては、例えば画像の絵柄のエッジを抽出して、線分とほ
ぼ平行するエッジが近くにあるような線分位置を避け、
線分とほぼ直交するエッジが存在するような線分位置を
選択することで行うことができる。Further, the selection of the line segment position has an appropriate position depending on the picture content of the image. By selecting a line segment position in which the reference pixel data string on the reference image at the line segment position has a small change in pixel data in the direction perpendicular to the line segment and a large change in pixel data in the direction parallel to the line segment, Reliability and accuracy will increase. As a method of finding such a position, for example, the edge of the pattern of the image is extracted to avoid a line segment position where an edge substantially parallel to the line segment is near
This can be done by selecting a line segment position where an edge that is substantially orthogonal to the line segment exists.
【0028】また抽出される基準画素データ列として、
線分位置の基準画像上の画素データ列及び、線分と直角
方向にそれに隣接する所定数の画素データ列の対応する
画素ごとの画素データの加算平均値を画素データとする
画素データ列であるようにし、同様に抽出される複数の
検査対象画素データ列として、線分位置およびその線分
位置から画素単位で線分方向に位置変化させた複数の各
位置について、線分と直角方向に各位置ごとにその位置
に隣接する所定数の画素データ列の対応する画素ごとの
画素データの加算平均値を求め、それを画素データとす
る複数の画素データ列とすることができる。そうするこ
とによって、より信頼性や精度が増すことなる。As the reference pixel data string to be extracted,
It is a pixel data string in which a pixel data string on a reference image at a line segment position and a pixel data of an average value of pixel data of corresponding pixels of a predetermined number of pixel data strings adjacent to the line segment in a direction perpendicular to the line segment are pixel data. In the same manner, as a plurality of inspection target pixel data strings that are similarly extracted, a line segment position and a plurality of positions that are changed in the line segment direction in pixel units from the line segment position It is possible to obtain an arithmetic mean value of pixel data for each pixel corresponding to a predetermined number of pixel data strings adjacent to the position for each position, and make the pixel data a plurality of pixel data strings. By doing so, reliability and accuracy will be increased.
【0029】上述のような位置ずれ補正に対して従来の
位置ずれ補正では、2次元の相関演算を行わなければな
らなかったので、高速なプロセッサを使用しても、高速
処理が困難であった。しかし、本発明では、相関演算は
1次元配列で行われるので、高速処理が可能となる。例
えば、信号処理専用のプロセッサとしてDSP(digital
signal processor)等を用いた場合には、1次元配列の
相関演算は、瞬時に実行することができる。In the conventional misregistration correction, in contrast to the above-mentioned misregistration correction, two-dimensional correlation calculation had to be performed, so that high-speed processing was difficult even if a high-speed processor was used. . However, in the present invention, since the correlation calculation is performed in the one-dimensional array, high speed processing is possible. For example, a DSP (digital
When a signal processor) or the like is used, the correlation calculation of a one-dimensional array can be executed instantaneously.
【0030】図3は、本発明の装置構成の概要を示す模
式図である。図3において、1は印刷ユニット、2は印
刷物、3はガイドローラ、4は照明用の光源、5は撮像
用のカメラユニット、6はカメラユニットを制御するカ
メラ制御部、7は印刷ユニットの機械的位置(版胴の回
転位置)を検出するロータリーエンコーダ、8はカメラ
ユニットによる撮像で得た画像データの処理を行う印刷
物検査装置の本体である。印刷用紙は印刷ユニット1を
通過し、そこにおいて印刷が行われれて印刷物1とな
り、ガイドローラ3によって導かれて、光源4によって
照明される位置に達する。その位置には通常ガイドロー
ラ3があって、印刷物2の位置が規定されている。その
位置において印刷物2はカメラユニット5によって撮像
される。カメラユニット5は図3の例では一次元の走査
によって画像を撮像するリニアセンサーカメラである。FIG. 3 is a schematic diagram showing an outline of the apparatus configuration of the present invention. In FIG. 3, 1 is a printing unit, 2 is a printed matter, 3 is a guide roller, 4 is a light source for illumination, 5 is a camera unit for imaging, 6 is a camera control unit for controlling the camera unit, and 7 is a machine of the printing unit. A rotary encoder for detecting a target position (rotational position of the plate cylinder), and 8 is a main body of a printed matter inspection apparatus for processing image data obtained by imaging by a camera unit. The printing paper passes through the printing unit 1, where printing is performed to form the printed matter 1, which is guided by the guide roller 3 and reaches a position illuminated by the light source 4. There is usually a guide roller 3 at that position, which defines the position of the printed matter 2. The printed matter 2 is imaged by the camera unit 5 at that position. The camera unit 5 is a linear sensor camera that captures an image by one-dimensional scanning in the example of FIG.
【0031】印刷ユニット1の版胴もしくは版胴と同期
して回転する部分にはロータリーエンコーダ7が設置さ
れており印刷の周期に同期したパルス信号を出力する。
このパルス信号はカメラ制御部6に入力され、カメラ制
御部6は、印刷の周期に同期して印刷物2が所定量走行
する毎にカメラユニット5に撮像開始信号を出力し、カ
メラユニット5の撮像データ、すなわちアナログデータ
を入力し、A/D(analog to digital )変換を行って
ディジタルデータに変換して、印刷物検査装置本体8に
データ転送を行う。このように印刷の周期に同期し、タ
イミングをとって二次元の走査が行われディジタル画像
データが印刷物検査装置本体8に読み込まれる
また、このように印刷の周期に同期して撮像されるか
ら、外乱要因、誤差要因がなければ、各印刷の周期で読
み取られる撮像データは、同じ周期タイミングの撮像デ
ータであれば常に同じ印刷絵柄位置の撮像データにな
る。A rotary encoder 7 is installed in the plate cylinder of the printing unit 1 or in a portion that rotates in synchronization with the plate cylinder, and outputs a pulse signal in synchronization with the printing cycle.
This pulse signal is input to the camera control unit 6, and the camera control unit 6 outputs an imaging start signal to the camera unit 5 every time the printed matter 2 travels a predetermined amount in synchronization with the printing cycle, and the camera unit 5 captures an image. Data, that is, analog data is input, A / D (analog to digital) conversion is performed to convert it into digital data, and the data is transferred to the printed matter inspection apparatus main body 8. In this way, two-dimensional scanning is performed at a timing synchronized with the printing cycle, the digital image data is read into the printed matter inspection apparatus main body 8, and since the image is captured in synchronization with the printing cycle in this manner, If there is no disturbance factor or error factor, the imaging data read in each printing cycle will always be the imaging data at the same print pattern position if the imaging data is at the same cycle timing.
【0032】ディジタル画像信号を入力した前記印刷物
検査装置本体8は、良品が印刷されたときの印刷物1の
ディジタル画像データを基準画像としてメモリに格納す
る。そして、それ以降入力されるディジタル画像データ
を検査対象画像データとして、印刷物1の不良が発生し
たか否かの判定を行う。The printed matter inspection apparatus main body 8 to which the digital image signal is input stores the digital image data of the printed matter 1 when a non-defective product is printed in the memory as a reference image. Then, it is determined whether or not a defect of the printed material 1 has occurred by using the digital image data input thereafter as the inspection target image data.
【0033】図4は、印刷物検査装置本体の構成を示す
ブロック図である。図4において、8は印刷物検査装置
本体、5はカメラユニット、6はカメラ制御部、9は基
準画像データメモリ、10は検査対象画像データメモ
リ、11は基準入力司令入力部、12は位置ずれ検出
部、13は位置ずれ補正比較部、14はパラメータ入力
部である。基準画像データメモリ9及び検査対象画像デ
ータメモリ10は、いずれも、印刷物1単位分(印刷ユ
ニットで行われる1周期分の印刷画面)を少なくとも記
憶できる記憶容量を有している。また基準入力司令入力
部11は、画像検査を始めるにあたって行う基準画像を
撮影し基準画像データメモリ9へデータ入力を行う司
令、そして続いて行う検査対象画像を撮影し検査対象画
像データメモリ10へデータ入力を行う司令の切り換え
を行う。FIG. 4 is a block diagram showing the structure of the main body of the printed matter inspection apparatus. In FIG. 4, 8 is a printed matter inspection apparatus main body, 5 is a camera unit, 6 is a camera control unit, 9 is a reference image data memory, 10 is an inspection target image data memory, 11 is a reference input command input unit, and 12 is a displacement detection. Reference numeral 13 is a positional deviation correction comparison unit, and 14 is a parameter input unit. Each of the reference image data memory 9 and the inspection target image data memory 10 has a storage capacity capable of storing at least one unit of printed matter (a printing screen for one cycle performed by the printing unit). Further, the reference input command input unit 11 is a command for taking a reference image to start the image inspection and inputting data to the reference image data memory 9, and then taking an inspection target image to be stored in the inspection target image data memory 10. Switch the command to input.
【0034】基準入力司令入力部11で基準画像データ
の入力が司令されると、図2のセレクタは基準画像デー
タメモリ9に撮像データの入力接続を行うが、このとき
は位置ずれ検出部12、及び位置ずれ補正比較部13は
動作しない。一方、基準入力司令入力部11にて検査対
象画像データの入力が司令されると、セレクタは検査対
象画像データメモリへ10に撮像データの入力接続を行
う。そして、位置ずれ検出部12は検査対象画像と基準
画像の位置ずれ検出を行い、その結果の位置ずれ補正量
を位置ずれ補正比較部13へ送る。そして、位置ずれ補
正量を受け取った位置ずれ補正比較部13は、位置ずれ
補正量を考慮して検査対象画像データと基準画像データ
との照合比較検査を行う。また、パラメータ入力部14
は、位置ずれ検出部12、および位置ずれ補正比較部1
3で用いられるパラメータを設定するための入力を行
う。パラメータとしては、例えば前記位置ずれ補正比較
部13で検査対象画像データと基準画像データとの比較
を行って、良否判定を行う場合の閾値を入力する。When the reference image data is input by the reference input command input unit 11, the selector shown in FIG. 2 connects the image data to the reference image data memory 9, and at this time, the positional deviation detection unit 12, And the positional deviation correction comparison unit 13 does not operate. On the other hand, when the input of the inspection target image data is commanded by the reference input command input unit 11, the selector makes an input connection of the imaging data to the inspection target image data memory 10. Then, the positional deviation detecting unit 12 detects the positional deviation between the inspection target image and the reference image, and sends the resulting positional deviation correction amount to the positional deviation correction comparing unit 13. Then, the misregistration correction comparison unit 13 that has received the misregistration correction amount performs a collation comparison inspection of the inspection target image data and the reference image data in consideration of the misregistration correction amount. In addition, the parameter input unit 14
Is the positional deviation detection unit 12 and the positional deviation correction comparison unit 1
Input for setting the parameters used in 3. As the parameter, for example, a threshold value is input when the misregistration correction comparison unit 13 compares the inspection target image data with the reference image data to determine whether the image is good or bad.
【0035】図5は、位置ずれ検出部の構成を示すブロ
ック部である。図5において、12は位置ずれ検出部、
9は基準画像データメモリ、10は検査対象画像データ
メモリ、11は基準入力司令入力部、13は位置ずれ補
正比較部、15は線分位置選択部、16は第1データ抽
出部、17は第2データ抽出部、18は第1相関線分メ
モリ、19は第2相関線分メモリ、20は相関係数算出
部、21は中位値算出部である。又、図6は位置ずれ検
出部12におけるデータ処理の流れを示すフローチャー
トである。FIG. 5 is a block section showing the structure of the position shift detecting section. In FIG. 5, reference numeral 12 denotes a positional deviation detection unit,
Reference numeral 9 is a reference image data memory, 10 is an inspection target image data memory, 11 is a reference input command input unit, 13 is a positional deviation correction comparing unit, 15 is a line segment position selecting unit, 16 is a first data extracting unit, and 17 is a first data extracting unit. 2 is a data extraction unit, 18 is a first correlation line segment memory, 19 is a second correlation line segment memory, 20 is a correlation coefficient calculation unit, and 21 is a median value calculation unit. Further, FIG. 6 is a flow chart showing the flow of data processing in the positional deviation detecting unit 12.
【0036】図5、図6において、まず線分位置選択部
15は基準画像データメモリ9の基準画像データを参照
して天地方向の線分位置を5つ選択する(S1)。第1
のデータ抽出部16は、その線分位置を入力し基準画像
データメモリ9より天地方向の各線分位置の基準画素デ
ータ列を抽出する(S2)。また第2のデータ抽出部1
7は、その線分位置を入力し検査対象画像データメモリ
10より天地方向の各線分位置の検査対象画素データ列
を複数抽出する(S3)。In FIGS. 5 and 6, the line segment position selection unit 15 first refers to the reference image data in the reference image data memory 9 and selects five line segment positions in the vertical direction (S1). First
The data extraction unit 16 of (1) inputs the line segment position and extracts the reference pixel data string of each line segment position in the vertical direction from the reference image data memory 9 (S2). In addition, the second data extraction unit 1
7 inputs the line segment position and extracts a plurality of inspection target pixel data strings at each line segment position in the vertical direction from the inspection target image data memory 10 (S3).
【0037】第1のデータ抽出部16によって抽出され
た基準画素データ列から一つが第1相関メモリ18に格
納される。また第2のデータ抽出部17によって抽出さ
れた検査対象画素データ列から一つが第2相関メモリ1
9に格納される。相関係数算出部20は第1相関メモリ
18と第2相関メモリ19に格納された基準画素データ
列と検査対象画素データ列との相関係数を演算する。こ
のような相関係数の演算は各基準画素データ列に対応す
る複数の検査対象画素データ列について複数回繰り返さ
れて、複数の相関係数が求められる(S4)。One of the reference pixel data strings extracted by the first data extraction unit 16 is stored in the first correlation memory 18. One of the inspection target pixel data strings extracted by the second data extracting unit 17 is the second correlation memory 1
9 is stored. The correlation coefficient calculation unit 20 calculates a correlation coefficient between the reference pixel data sequence stored in the first correlation memory 18 and the second correlation memory 19 and the inspection target pixel data sequence. Such calculation of the correlation coefficient is repeated a plurality of times for a plurality of inspection target pixel data rows corresponding to each reference pixel data row to obtain a plurality of correlation coefficients (S4).
【0038】中位値算出部21は、相関係数算出部20
で算出された複数の相関係数の中、各線分位置について
最大の相関係数を与える検査対象画素データ列を求め、
その位置ずれ量を演算する(S5)。また中位値算出部
21は、相関係数算出部20で求められた各線分位置に
ついての位置ずれ量から中位値を求めて天地方向の位置
ずれ量とする。この天地方向の位置ずれ量は位置ずれ補
正比較部13に出力される(S6)。以上のS1〜S6
で説明した天地方向についての位置ずれ量を求めるステ
ップは、左右方向についても全く同様に行うことができ
る。従って左右方向についての位置ずれ量を求めるステ
ップS7〜S12の説明は省略する。The median value calculation unit 21 includes a correlation coefficient calculation unit 20.
Among the plurality of correlation coefficients calculated in step 1, the inspection target pixel data string that gives the maximum correlation coefficient for each line segment position is obtained,
The amount of displacement is calculated (S5). Further, the median value calculation unit 21 obtains the median value from the positional deviation amount for each line segment position obtained by the correlation coefficient calculation unit 20 and sets it as the positional deviation amount in the vertical direction. The positional deviation amount in the vertical direction is output to the positional deviation correction comparing unit 13 (S6). The above S1 to S6
The step of obtaining the amount of positional deviation in the vertical direction described above can be performed in the same manner in the horizontal direction. Therefore, the description of steps S7 to S12 for obtaining the amount of positional deviation in the left-right direction will be omitted.
【0039】このようにこの例では、天地方向の位置ず
れ補正を行った後に、左右方向の位置ずれ補正を行う。
印刷物の検査においては、印刷物の走行による挙動状態
が、蛇行による左右方向の位置ずれよりも、印刷物を撮
影するカメラユニットが、印刷ユニットより離れた位置
に設置されるため、テンション変動等による天地方向の
位置ずれの方が普通は大きい。従って、この例のよう
に、天地方向の位置ずれ補正を先に行う方が、信頼性の
高い位置ずれ補正が可能となる。As described above, in this example, after the positional deviation in the vertical direction is corrected, the lateral positional deviation is corrected.
When inspecting printed matter, the behavioral state of the printed matter due to running is more than the positional displacement in the left-right direction due to meandering. The displacement of is usually larger. Therefore, as in this example, it is possible to perform the positional deviation correction with higher reliability by performing the positional deviation correction in the vertical direction first.
【0040】又、この例では、天地方向、左右方向と
も、線分位置の数を5本とした。これら5本分の位置ず
れ補正値の中位値を、最終的な位置ずれ補正値とするの
で、5本中2本までの、結果に誤りを生じても正しい補
正値を得ることができる。このように、線分位置を複数
とすることで、位置ずれ補正の信頼性を向上させること
ができる。線分位置選択部15によるこのような線分位
置の選択は、基準画像データから、左右方向の位置ずれ
時にデータ変化が少ない天地方向線分、及び天地方向の
位置ずれ時にデータ変化が少ない左右方向線分を選択す
る。In this example, the number of line segment positions is 5 in both the vertical direction and the horizontal direction. Since the median value of these five misregistration correction values is used as the final misregistration correction value, a correct correction value can be obtained even if an error occurs in up to two of the five results. In this way, by using a plurality of line segment positions, it is possible to improve the reliability of positional deviation correction. The selection of such a line segment position by the line segment position selection unit 15 is performed in the vertical direction line segment in which there is little data change when the position shifts in the left and right directions from the reference image data, and in the left and right direction where the data change does not change when the position shifts in the up and down direction. Select a line segment.
【0041】第1データ抽出部16及び第2データ抽出
部17では、線分位置選択部15で選択された線分位置
の基準画素データ列及び検出対象画素データを一次元配
列として、第1相関線分メモリ16及び第2相関線分メ
モリ17に格納する。ただし、左右方向の線分位置を線
分位置選択部15で選択する場合には、図7に示すよう
に、天地方向の位置ずれ補正量が既知であるから、その
位置ずれ補正量に従って、検出対象画素データの左右方
向の線分位置を補正する。図7は、検出対象画素データ
の左右方向の線分位置を天地方向の位置ずれ補正量に従
って、補正することを示す図である。第1相関線分メモ
リ16及び第2相関線分メモリ17は、線分位置に含ま
れる画素数に相当する基準画素データ列及び検査対象画
素データ列を格納するためのメモリで、線分位置の数
(この例では5つ分)の容量を有する。In the first data extraction unit 16 and the second data extraction unit 17, the reference pixel data sequence and the detection target pixel data of the line segment position selected by the line segment position selection unit 15 are used as a one-dimensional array to make the first correlation. It is stored in the line segment memory 16 and the second correlation line segment memory 17. However, when the line segment position in the left-right direction is selected by the line segment position selection unit 15, as shown in FIG. 7, since the positional deviation correction amount in the vertical direction is known, detection is performed according to the positional deviation correction amount. The position of the line segment in the left-right direction of the target pixel data is corrected. FIG. 7 is a diagram showing that the position of the line segment in the left-right direction of the detection target pixel data is corrected according to the amount of misalignment correction in the vertical direction. The first correlation line segment memory 16 and the second correlation line segment memory 17 are memories for storing a reference pixel data sequence and an inspection target pixel data sequence corresponding to the number of pixels included in the line segment position. It has a capacity of several (five in this example).
【0042】相関係数算出部20では、基準画素データ
列と複数の検査対象画素データ列の相関係数をそれぞれ
求め、相関係数が最大となるずらし量を求める。その
際、ずれに応じた相関係数の変化を大きくするために基
準画素データ列及び検査対象画素データ列の直流データ
成分を取り除く。すなわち、基準画素データ列及び検査
対象画素データ列の各々の平均値を各画素データから引
く。これを数式で示すと数1のようになる。The correlation coefficient calculation unit 20 obtains the correlation coefficients of the reference pixel data sequence and the plurality of inspection target pixel data sequences, respectively, and obtains the shift amount that maximizes the correlation coefficient. At that time, the DC data components of the reference pixel data sequence and the inspection target pixel data sequence are removed in order to increase the change in the correlation coefficient according to the shift. That is, the average value of each of the reference pixel data row and the inspection pixel data row is subtracted from each pixel data. When this is expressed by a mathematical formula, it becomes as shown in Formula 1.
【数1】f’(i) = f(i)− f^ g’(i) = g(i)− g^ ただし、f’(i) ; 新しい基準画素データ列 g’(i); 新しい検査対象画素データ列 i ; 位置(アドレス) f(i) ; 基準画素データ列 g(i) ; 検査対象画素データ列 f^ ; f(i)の平均値 g^ ; g(i)の平均値F ′ (i) = f (i) −f ^ g '(i) = g (i)-g ^ However, f '(i); new reference pixel data string g '(i); New inspection target pixel data string i; position (address) f (i); reference pixel data string g (i); inspection target pixel data string f ^; average value of f (i) g ^; average value of g (i)
【0043】相関係数算出部20で求められる相関係数
は以下の数2で求められる。The correlation coefficient calculated by the correlation coefficient calculation unit 20 is calculated by the following equation 2.
【数2】
ただし、Rj ; 相関係数
j ; 検査対象画素データ列の位置
n ; 画素データ列の画素数
数学上は相関係数(correlation coefficient )はf
(i)とg(i)の標準偏差及びnの積を求め、その積
で上記Rjを除算したものである。しかしここでは数学
上の厳密な相関係数は必要でなく、相対的な大小関係だ
けが重要であるから簡略化した数2で求められた値を相
関係数とする。また、相関係数算出部20では更に、R
jが最大となる検査対象画素データ列の位置jの値を算
出し、これを各線分位置における位置ずれ検出量とす
る。[Equation 2] However, Rj; correlation coefficient j; position of inspection target pixel data string n; number of pixels in pixel data string Mathematically, the correlation coefficient is f
This is a product of the standard deviation of (i) and g (i) and the product of n, and dividing the Rj by the product. However, a mathematically exact correlation coefficient is not necessary here, and only the relative magnitude relationship is important, so the value obtained by the simplified Equation 2 is used as the correlation coefficient. Further, in the correlation coefficient calculation unit 20, R
The value of the position j of the inspection target pixel data string where j is the maximum is calculated, and this is used as the positional deviation detection amount at each line segment position.
【0044】中位値算出部21では、5本分の線分位置
における位置ずれ検出量の中位値を算出する。例えば、
相関係数算出部20で得られた各線分位置における位置
ずれ検出量が次の通りであったとする。
{ 3,4,3,1,5 }
これを値の大きな順に並べ替えると、次のようになる。
{ 5,4,3,3,1 }
これから中位値である3を得て実際の位置ずれ補正に用
いる位置ずれ検出量とする。なお、この例の相関係数算
出部では、2つの線分の一致度を求めるのに、相関係数
を用いたが、2つのデータ列の差分の絶対値を合計した
値をもって、一致度を判定してもよい。The median value calculation unit 21 calculates the median value of the amount of displacement detection at the position of five line segments. For example,
It is assumed that the positional deviation detection amount at each line segment position obtained by the correlation coefficient calculation unit 20 is as follows. {3,4,3,1,5} When rearranged in descending order of value, the result is as follows. {5,4,3,3,1} From this, a median value of 3 is obtained and used as the positional deviation detection amount used for actual positional deviation correction. In the correlation coefficient calculation unit of this example, the correlation coefficient is used to obtain the degree of coincidence between the two line segments, but the degree of coincidence is calculated by summing the absolute values of the differences between the two data strings. You may judge.
【0045】図8は、線分位置選択部15で、天地方向
の線分が選択される際のデータ処理の流れを示すフロー
チャートである。天地方向の線分位置は左右の位置ずれ
の影響が少ない、すなわち基準画像の絵柄で水平方向の
エッジの少ないところが優先的に選択される。図8にお
いて、まず基準画像データから水平方向の差分画像デー
タを演算する(S101)。この差分画像データは、左
右の位置ずれの最大幅を想定して演算される。すなわち
差分画像の画素値Piは、以下の数3によって表され
る。FIG. 8 is a flow chart showing the flow of data processing when the line segment position selection unit 15 selects a line segment in the vertical direction. As for the line segment position in the vertical direction, the influence of the left and right misalignment is small, that is, the place of the reference image with few horizontal edges is preferentially selected. In FIG. 8, first, differential image data in the horizontal direction is calculated from the reference image data (S101). The difference image data is calculated by assuming the maximum width of left / right positional deviation. That is, the pixel value Pi of the difference image is represented by the following Expression 3.
【数3】Pi = max|Pi+i’ − Pi|
ただし、上記関数maxは、kを左右の位置ずれの最大
幅として、i’を
−k ≦ i’≦ +k
の範囲で変化させた場合の要素群の中で最大値を取るこ
とを示している。## EQU00003 ## Pi = max | Pi + i'-Pi | However, the above function max is an element when i'is changed in the range of -k≤i'≤ + k, where k is the maximum width of the lateral displacement. It shows that it takes the maximum value in the group.
【0046】次に、演算された水平差分画像を2値化す
る。2値化は、ある所定の閾値によって成される。例え
ば、その閾値には全画素の平均値のような演算された値
を用いてもよい(S102)。次に、水平差分2値画像
の各画素を天地方向に加算し、ヒストグラムを演算す
る。このヒストグラムは、各天地方向において、水平エ
ッジを持つ画素の数を表している(S103)。次に、
基準画像より垂直差分画像を演算する。この垂直差分画
像は、垂直方向のエッジの数をある程度保証するために
使用するものであり、対象画素と次の画素のデータの差
分によって演算される(S104)。その垂直差分画像
は、水平差分画像と同様に2値化され(S105)、更
に垂直方向に加算し、ヒストグラムを演算する。このヒ
ストグラムは、各垂直方向において、垂直エッジを持つ
画素の数を表している(S106)。Next, the calculated horizontal difference image is binarized. The binarization is performed by using a predetermined threshold value. For example, a calculated value such as an average value of all pixels may be used as the threshold value (S102). Next, each pixel of the horizontal difference binary image is added in the vertical direction, and the histogram is calculated. This histogram represents the number of pixels having horizontal edges in each vertical direction (S103). next,
A vertical difference image is calculated from the reference image. This vertical difference image is used to guarantee the number of edges in the vertical direction to some extent, and is calculated by the difference between the data of the target pixel and the data of the next pixel (S104). The vertical difference image is binarized similarly to the horizontal difference image (S105), and is further added in the vertical direction to calculate a histogram. This histogram represents the number of pixels having vertical edges in each vertical direction (S106).
【0047】次に、その水平差分ヒストグラムにおい
て、最小値を取る水平位置を選択する(S107)。そ
して、その水平位置に相当する垂直差分ヒストグラムの
値が、一定範囲に入っているかが判断されて(S10
8)、入っている場合にその水平位置を天地方向相関線
分の位置とする(S109)。その垂直差分ヒストグラ
ムの値が一定範囲に入っていない場合は(S108)、
その水平差分ヒストグラムの次の最小値を選択し(S1
07)、同様の判定を行う。これらの処理を、天地方向
相関線分が5本選ばれるまで繰り返す(S110)。な
お、選択される天地方向線分位置が隣合わないように、
1度選ばれた線分の左右の数ラインは、次の処理で選ば
れないように無効化しておくのがよい。その理由は、線
分位置が隣合っていると、1つの印刷物欠陥が、1度に
数本の線分上に掛かり、それらの画素データ列が、全て
変化する可能性が高くなってしまうためである。Next, in the horizontal difference histogram, the horizontal position having the minimum value is selected (S107). Then, it is determined whether the value of the vertical difference histogram corresponding to the horizontal position falls within a certain range (S10).
8) If there is, the horizontal position is set as the position of the vertical correlation line segment (S109). If the value of the vertical difference histogram is not within the certain range (S108),
Select the next minimum value of the horizontal difference histogram (S1
07), the same determination is made. These processes are repeated until five vertical direction correlation line segments are selected (S110). In addition, make sure that the selected vertical line segments are not next to each other.
It is preferable to invalidate the left and right several lines that have been selected once so that they will not be selected in the next process. The reason is that if the line segment positions are adjacent to each other, one printed matter defect may occur on several line segments at a time, and the pixel data strings of all of them may change. Is.
【0048】図9は、線分位置選択部15で、左右方向
の線分位置が選択される際のデータ処理の流れを示すフ
ローチャートである。基本的に図8の天地方向の線分位
置が選択される場合と変わりがなく、図8の説明におい
て天地を左右に、左右を天地に、垂直を水平に、水平を
垂直に読み代えれば、同様であるから説明は省略する。
図9においては、数3の代わりに以下の数4によって差
分画像の画素値Pjが表される。FIG. 9 is a flow chart showing the flow of data processing when the line segment position selection unit 15 selects a line segment position in the horizontal direction. Basically, there is no difference from the case where the line segment position in the vertical direction in FIG. 8 is selected. In the description of FIG. 8, if the vertical and horizontal directions are read, the left and right are vertical and the horizontal is vertical, and the horizontal is vertical. The description is omitted because it is similar.
In FIG. 9, the pixel value Pj of the difference image is expressed by the following Expression 4 instead of Expression 3.
【数4】Pj = max|Pj+j’ − Pj|
ただし、上記関数maxは、kを左右の位置ずれの最大
幅として、j’を
−k ≦ j’≦ +k
の範囲で変化させた場合の要素群の中で最大値を取るこ
とを示している。## EQU00004 ## Pj = max | Pj + j'-Pj | However, the above function max is an element when j'is changed in the range of -k ≤ j'≤ + k, where k is the maximum width of the lateral displacement. It shows that it takes the maximum value in the group.
【0049】図10は、位置ずれ補正比較部の構成を示
すブロック図である。図10において、13は位置ずれ
補正比較部、6はカメラ制御部、9は基準画像データメ
モリ、10は検査対象画像データメモリ、12は位置ず
れ検出部、22は膨張処理回路、23は縮退処理回路、
24は上限閾値設定回路、25は下限閾値設定回路、2
6は上限閾値画像バッファ、27は下限閾値画像バッフ
ァ、28は画像ずらし回路、29は上限閾値比較回路、
30は下限閾値比較回路である。以上の構成において、
画像ずらし回路28は、検査対象画像データメモリ10
の画像を位置ずれ検出部によって求められた位置ずれ補
正量に従って、ずらす処理を行う。FIG. 10 is a block diagram showing the structure of the positional deviation correction comparison unit. In FIG. 10, 13 is a positional deviation correction comparison section, 6 is a camera control section, 9 is a reference image data memory, 10 is an inspection target image data memory, 12 is a positional deviation detection section, 22 is an expansion processing circuit, and 23 is degeneration processing. circuit,
24 is an upper threshold setting circuit, 25 is a lower threshold setting circuit, 2
6 is an upper threshold image buffer, 27 is a lower threshold image buffer, 28 is an image shift circuit, 29 is an upper threshold comparison circuit,
Reference numeral 30 is a lower threshold comparison circuit. In the above configuration,
The image shifting circuit 28 includes the inspection target image data memory 10
The image is shifted according to the positional deviation correction amount obtained by the positional deviation detection unit.
【0050】縮退処理回路23は、基準画像データメモ
リ9に書き込まれた画像データの輝度の明るい領域に相
当する領域を細らせる処理を行なうものである。逆に、
膨張処理回路22は、明るい領域を太らせる処理を行な
う。実際の処理の一例は縮退処理回路23は以下の数
5、膨張処理回路22以下の数6で示される。The degeneracy processing circuit 23 performs a process of narrowing the area corresponding to the bright area of the image data written in the reference image data memory 9. vice versa,
The expansion processing circuit 22 performs processing for thickening a bright area. As an example of the actual processing, the degeneration processing circuit 23 is expressed by the following Expression 5, and the expansion processing circuit 22 and the following Expressions 6.
【数5】f(x,y)=min{f(x−1,y−
1),f(x,y−1),f(x+1,y−1),f
(x−1,y),f(x,y),f(x+1,y),f
(x−1,y+1),f(x,y+1),f(x+1,
y+1)}
ただし、上記関数min{}は、列挙した変数のうちの
最小値をとることを示している。F (x, y) = min {f (x-1, y-
1), f (x, y-1), f (x + 1, y-1), f
(X-1, y), f (x, y), f (x + 1, y), f
(X-1, y + 1), f (x, y + 1), f (x + 1,
y + 1)} However, the function min {} indicates that the minimum value of the listed variables is taken.
【数6】f(x,y)=max{f(x−1,y−
1),f(x,y−1),f(x+1,y−1),f
(x−1,y),f(x,y),f(x+1,y),f
(x−1,y+1),f(x,y+1),f(x+1,
y+1)}
ただし、上記関数max{}は、列挙した変数のうちの
最大値を取ることを示している。## EQU6 ## f (x, y) = max {f (x-1, y-
1), f (x, y-1), f (x + 1, y-1), f
(X-1, y), f (x, y), f (x + 1, y), f
(X-1, y + 1), f (x, y + 1), f (x + 1,
y + 1)} However, the function max {} indicates that the maximum value among the listed variables is taken.
【0051】数5は、対象画素とその8近傍の画素の輝
度の中から、最も暗い輝度値を新たに対象画素の輝度と
することを表している。又、数6は、対象画素とその8
近傍の画素の輝度の中から、最も明るい輝度値を新たに
対象画素の輝度とすることを表している。下限閾値設定
回路25には、予めパラメータ入力部14より輝度変動
の下限値が設定されていて、縮退処理回路23の出力よ
り、その下限値が減算され、下限閾値画像バッファ27
に書き込まれる。同様に上限閾値設定回路24には、予
めパラメータ入力部14より輝度変動の上限値が設定さ
れていて、膨張処理回路22の出力に、その上限値が加
算され、上限閾値画像バッファ26に書き込まれる。Expression 5 represents that the darkest brightness value is newly set as the brightness of the target pixel from the brightness of the target pixel and the pixels in the vicinity of the target pixel. In addition, Equation 6 is the target pixel and its 8
It represents that the brightest brightness value is newly set as the brightness of the target pixel from the brightness of the neighboring pixels. The lower limit threshold value setting circuit 25 has a lower limit value of the brightness variation set in advance by the parameter input unit 14, and the lower limit value is subtracted from the output of the degeneration processing circuit 23.
Written in. Similarly, in the upper limit threshold setting circuit 24, the upper limit value of the brightness variation is set in advance from the parameter input unit 14, and the upper limit value is added to the output of the expansion processing circuit 22 and written in the upper limit threshold image buffer 26. .
【0052】下限閾値比較回路30では、下限閾値画像
バッファ27の輝度値と検査対象画像データメモリ10
の輝度値を対応する画素毎に比較し、検査対象画像デー
タメモリ10の輝度値が、下限閾値画像バッファ27の
輝度値より低い場合に、欠陥が発生したと判定する。
又、上限閾値比較回路29では、上限閾値画像バッファ
26の輝度値と検査対象画像データメモリ10の輝度値
を対応する画素毎に比較し、検査対象画像データメモリ
の輝度値が、上限閾値画像バッファ26の輝度値より高
い場合に、欠陥が発生したと判定する。In the lower threshold comparison circuit 30, the luminance value of the lower threshold image buffer 27 and the inspection target image data memory 10 are compared.
Are compared for each corresponding pixel, and when the brightness value of the inspection target image data memory 10 is lower than the brightness value of the lower limit threshold image buffer 27, it is determined that a defect has occurred.
The upper threshold comparison circuit 29 compares the luminance value of the upper threshold image buffer 26 and the luminance value of the inspection target image data memory 10 for each corresponding pixel, and the luminance value of the inspection target image data memory is compared with the upper threshold image buffer. If the brightness value is higher than 26, it is determined that a defect has occurred.
【0053】なお、本発明の位置ずれ補正処理は、1画
素単位の補正であるから、補正処理を行っても1画素以
下の位置ずれは補正しきれない。そこで位置ずれ補正比
較部13で、縮退処理回路23及び膨張処理回路22を
備えて、画像中の輝度変化が激しいエッジ部分での誤検
出を許容した。また、本願発明の位置ずれ補正比較部1
3の構成はこの実施例に限定されるものではなく、基準
画像メモリの各画素の輝度と、被検査画像の各画素の輝
度を、位置ずれ量に従って単純に比較するものでもよ
い。Since the positional deviation correction processing of the present invention is correction for each pixel, the positional deviation of less than one pixel cannot be corrected even if the correction processing is performed. Therefore, the misregistration correction comparison unit 13 is provided with the degeneration processing circuit 23 and the expansion processing circuit 22 to allow erroneous detection at an edge portion in the image where the luminance change is large. Further, the positional deviation correction comparison unit 1 of the present invention
The configuration of 3 is not limited to this embodiment, and the brightness of each pixel of the reference image memory and the brightness of each pixel of the image to be inspected may be simply compared according to the amount of positional deviation.
【0054】[0054]
【発明の効果】以上説明した通り、本発明の画像検査方
法及び装置によれば、まず補正すべき方向と平行方向の
基準画像上の基準画素データ列を抽出して、更にその位
置に対応して複数の検査対象画素データ列を抽出する。
そして、それらデータ列から相関係数を得て、最大の相
関係数を与える検査対象画素データ列の位置のデータか
ら位置ずれ量を得る。その位置ずれ量は、まず天地方向
について得て、その天地方向の位置ずれ量にしたがって
検出対象画素データの左右方向の線分位置を補正する。
しかる後それら2方向の位置ずれ量に基づいて位置ずれ
を補正して基準画像と比較して検査対象画像を検査す
る。従って、データ量の極めて大きい2次元の画像デー
タを処理するのではなく、1次元の画像データを処理す
るために、処理時間は極めて短くすることができ、また
一般に位置ずれ量が大きい天地方向の位置ずれ補正を先
に行なうため信頼性が高い。また、基準画像上の基準画
素データ列は垂直方向に画素データの変化が少なく、平
行方向に画素データの変化が大きくなるよう選択するこ
とができるから線分と垂直方向の位置ずれの影響を受け
にくい。さらに、基準画素データ列および検査対象画素
データ列が、それらに隣接する所定数の画素データ列の
対応する画素ごとの画素データの加算平均値を用いる
と、線分と垂直方向の位置ずれの影響を更に受けにくく
なる。従って、信頼度の高い正しい補正量を得ることが
でき、相関量を算出する際のデータ量が保証され、信頼
度の高い正しい補正量を得ることができる。すなわち、
本発明によれば高速な位置ずれ補正処理を行って検査す
ることが可能であり、また位置ずれ補正処理も極めて信
頼性の高いものであるから、高速検査が可能で、検査精
度、信頼性に優れるという効果を得ることができる。As described above, according to the image inspection method and apparatus of the present invention, first, the reference pixel data string on the reference image in the direction parallel to the direction to be corrected is extracted and the position thereof is further corresponded. To extract a plurality of inspection target pixel data strings.
Then, the correlation coefficient is obtained from the data strings, and the positional deviation amount is obtained from the data of the position of the inspection target pixel data string that gives the maximum correlation coefficient. The amount of displacement is first in the vertical direction.
According to the amount of displacement in the vertical direction,
The position of the line segment in the horizontal direction of the detection target pixel data is corrected.
After that, the positional deviation is made based on the positional deviation amounts in those two directions.
The inspection target image by correcting the
It Therefore, two-dimensional image data that has an extremely large amount of data is
Processing one-dimensional image data instead of processing data
Therefore, the processing time can be extremely short, and
Generally, the amount of misalignment is large.
High reliability because it is done. Further, the reference pixel data string on the reference image can be selected so that the pixel data change is small in the vertical direction and the pixel data change is large in the parallel direction. Hateful. Furthermore, if the reference pixel data string and the inspection target pixel data string use the arithmetic mean value of the pixel data for each corresponding pixel of a predetermined number of pixel data strings adjacent to them, the effect of misalignment in the line segment and vertical direction Is more difficult to receive. Therefore, a correct correction amount with high reliability can be obtained, a data amount for calculating the correlation amount is guaranteed, and a correct correction amount with high reliability can be obtained. That is,
According to the present invention, it is possible to perform a high-speed misregistration correction process for inspection, and since the misregistration correction process is also extremely reliable, high-speed inspection is possible, and inspection accuracy and reliability are improved. effect called excellent can be obtained.
【図1】本発明の画像検査方法及び装置におけるデータ
処理の流れを示すフローチャートである。FIG. 1 is a flowchart showing a flow of data processing in an image inspection method and apparatus of the present invention.
【図2】本発明の画像検査方法及び装置における位置ず
れ補正のデータ処理の流れを絵図で示したものである。FIG. 2 is a pictorial diagram showing the flow of data processing for positional deviation correction in the image inspection method and apparatus of the present invention.
【図3】本発明の装置構成の概要を示す模式図である。FIG. 3 is a schematic diagram showing an outline of a device configuration of the present invention.
【図4】印刷物検査装置本体の構成を示すブロック図で
ある。FIG. 4 is a block diagram showing a configuration of a printed matter inspection apparatus main body.
【図5】位置ずれ検出部におけるデータ処理の流れを示
すフローチャートである。FIG. 5 is a flowchart showing a flow of data processing in a position shift detecting unit.
【図7】検出対象画素データの左右方向の線分位置を位
置ずれ補正量に従って、補正することを示す図である。FIG. 7 is a diagram showing that the position of a line segment in the left-right direction of pixel data to be detected is corrected according to a position shift correction amount.
【図8】線分位置選択部15で、天地方向の線分が選択
される際のデータ処理の流れを示すフローチャートであ
る。8 is a flowchart showing a flow of data processing when a line segment in the vertical direction is selected by the line segment position selection unit 15. FIG.
【図9】線分位置選択部15で、天地方向の線分位置が
選択される際のデータ処理の流れを示すフローチャート
である。FIG. 9 is a flowchart showing a flow of data processing when a line segment position in the vertical direction is selected by the line segment position selection unit 15.
【図10】位置ずれ補正比較部の構成を示すブロック図
である。FIG. 10 is a block diagram showing a configuration of a positional deviation correction comparison unit.
1印刷ユニット 2印刷物 3ガイドローラ 4光源 5カメラユニット 6カメラ制御部 7ロータリーエンコーダ 8印刷物検査装置本体 9基準画像データメモリ 10検査対象画像データメモリ 11基準入力司令入力部 12位置ずれ検出部 13位置ずれ補正比較部 14パラメータ入力部 15線分位置選択部 16第1データ抽出部 17第2データ抽出部 18第1相関線分メモリ 19第2相関線分メモリ 20相関係数算出部 21中位値算出部 22膨張処理回路 23縮退処理回路 24上限閾値設定回路 25下限閾値設定回路 26上限閾値画像バッファ 27下限閾値画像バッファ 28画像ずらし回路 29上限閾値比較回路 30下限閾値比較回路 1 printing unit 2 printed matter 3 guide rollers 4 light sources 5 camera unit 6 Camera control unit 7 rotary encoder 8 Printed matter inspection device body 9 Reference image data memory 10 Image data memory for inspection 11 Standard input Command input section 12 Positional deviation detector 13 Misregistration correction comparison unit 14 Parameter input section 15 line segment position selector 16 First data extraction unit 17 Second data extraction unit 18 First correlation line segment memory 19 Second correlation line segment memory 20 Correlation coefficient calculator 21 Median value calculator 22 expansion processing circuit 23 Degeneration processing circuit 24 upper limit threshold setting circuit 25 lower limit threshold setting circuit 26 upper threshold image buffer 27 Lower threshold image buffer 28 image shift circuit 29 upper threshold comparison circuit 30 lower threshold comparison circuit
───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 昭59−99592(JP,A) 特開 平2−217968(JP,A) 特開 平3−257304(JP,A) 特開 平3−41577(JP,A) 特開 平3−290786(JP,A) 特開 昭59−40241(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06T 7/00 - 7/60 B41F 33/14 G06T 1/00 H04N 1/40 - 1/409 H04N 1/00 ─────────────────────────────────────────────────── ─── Continuation of the front page (56) Reference JP-A-59-99592 (JP, A) JP-A-2-217968 (JP, A) JP-A-3-257304 (JP, A) JP-A-3- 41577 (JP, A) JP 3-290786 (JP, A) JP 59-40241 (JP, A) (58) Fields investigated (Int.Cl. 7 , DB name) G06T 7/00-7 / 60 B41F 33/14 G06T 1/00 H04N 1/40-1/409 H04N 1/00
Claims (5)
る画像検査方法において、 位置ずれを補正すべき方向と平行方向の線分に対応する
画素列の位置である線分位置を選択する線分位置選択過
程と、 その線分位置選択過程で選択された線分位置の基準画像
上の基準画素データ列を抽出する第1データ抽出過程
と、 その線分位置およびその線分位置から画素単位で線分方
向に位置変化させた複数の位置から検査対象画像上の複
数の検査対象画素データ列を抽出する第2データ抽出過
程と、 その第1データ抽出過程で抽出された基準画素データ列
とその第2データ抽出過程で抽出された複数の検査対象
画素データ列とから相関係数を得る相関係数演算過程
と、 その相関係数演算過程で得られた相関係数の中で最大の
相関係数を与える検査対象画素データ列の位置のデータ
と前記線分位置のデータから位置ずれ量を得る位置ずれ
量演算過程と、まず天地方向について前記位置ずれ量を得て、その天地
方向の位置ずれ量にしたがって検出対象画素データの左
右方向の線分位置を補正する線分位置補正過程と、 その後残る左右方向について前記補正した左右方向の線
分位置に基づいて前記位置ずれ量を得て、それら各前記
位置ずれ量に基づいて2方向に位置ずれを補正して基準
画像と比較して検査対象画像を検査する位置ずれ補正比
較過程 と、 を含むことを特徴とする画像検査方法。1. An image inspecting method for inspecting an image to be inspected by comparing with a reference image, wherein a line segment position which is a position of a pixel row corresponding to a line segment in a direction parallel to a direction in which positional deviation is to be corrected is selected. A line segment position selection process, a first data extraction process of extracting a reference pixel data string on the reference image at the line segment position selected in the line segment position selection process, the line segment position, and pixels from the line segment position A second data extracting step of extracting a plurality of inspection object pixel data strings on an inspection object image from a plurality of positions whose positions are changed in units of line segments, and a reference pixel data string extracted in the first data extracting step Of the correlation coefficient calculation process for obtaining a correlation coefficient from the plurality of inspection target pixel data strings extracted in the second data extraction process and the correlation coefficient obtained in the correlation coefficient calculation process. Test pair that gives the correlation coefficient Obtaining a positional deviation amount calculating process of obtaining data and positional deviation amount from the data of the line positions of the pixel data string, first the vertical direction the positional deviation amount, the vertical
To the left of the pixel data to be detected according to the amount of positional deviation in the direction
A line segment position correction process for correcting the position of the line segment in the right direction, and the corrected line in the left and right direction for the remaining left and right direction
The position deviation amount is obtained based on the minute position, and
Corrects misalignment in two directions based on the amount of misalignment
Positional deviation correction ratio to inspect the image to be inspected by comparing with the image
An image inspection method comprising: a comparison process .
る画像検査装置において、 位置ずれを補正すべき方向と平行方向の線分に対応する
画素列の位置である線分位置を選択する線分位置選択手
段と、 その線分位置選択手段で選択された線分位置の基準画像
上の基準画素データ列を抽出する第1データ抽出手段
と、 その線分位置およびその線分位置から画素単位で線分方
向に位置変化させた複数の位置から検査対象画像上の複
数の検査対象画素データ列を抽出する第2データ抽出手
段と、 その第1データ抽出手段で抽出された基準画素データ列
とその第2データ抽出手段で抽出された複数の検査対象
画素データ列とから相関係数を得る相関係数演算手段
と、 その相関係数演算手段で得られた相関係数の中で最大の
相関係数を与える検査対象画素データ列の位置のデータ
と前記線分位置のデータから位置ずれ量を得る位置ずれ
量演算手段と、まず天地方向について前記位置ずれ量を得て、その天地
方向の位置ずれ量にしたがって検出対象画素データの左
右方向の線分位置を補正する線分位置補正手段と、 その後残る左右方向について前記補正した左右方向の線
分位置に基づいて前記位置ずれ量を得て、それら各前記
位置ずれ量に基づいて2方向に位置ずれを補正して基準
画像と比較して検査対象画像を検査する位置ずれ補正比
較手段と、 を含むことを特徴とする画像検査装置。 2. An image inspection apparatus for inspecting an image to be inspected by comparing with a reference image, and selects a line segment position which is a position of a pixel row corresponding to a line segment in a direction parallel to a direction in which positional deviation is to be corrected. Line segment position selecting means, first data extracting means for extracting a reference pixel data string on the reference image at the line segment position selected by the line segment position selecting means, the line segment position and pixels from the line segment position Second data extracting means for extracting a plurality of inspection object pixel data strings on the inspection object image from a plurality of positions whose positions have been changed in the direction of the line segment, and reference pixel data strings extracted by the first data extracting means And a correlation coefficient calculating means for obtaining a correlation coefficient from the plurality of inspection object pixel data strings extracted by the second data extracting means, and the largest of the correlation coefficients obtained by the correlation coefficient calculating means. Test pair that gives the correlation coefficient Obtaining a positional deviation amount calculating means for obtaining data and positional deviation amount from the data of the line positions of the pixel data string, first the vertical direction the positional deviation amount, the vertical
To the left of the pixel data to be detected according to the amount of positional deviation in the direction
Line segment position correcting means for correcting the line segment position in the right direction, and the left and right line that has been corrected in the left and right directions that remain thereafter.
The position deviation amount is obtained based on the minute position, and
Corrects misalignment in two directions based on the amount of misalignment
Positional deviation correction ratio to inspect the image to be inspected by comparing with the image
An image inspection apparatus comprising: a comparison unit .
記線分位置は複数であって、それら各前記線分位置に対
して位置ずれ量を得て、それら位置ずれ量の中の中位値
の位置ずれ量に基づいて位置ずれを補正して基準画像と
比較して検査対象画像を検査することを特徴とする請求
項2記載の画像検査装置。 3. The line segment positions selected by the line segment position selecting means are plural, and the position shift amount is obtained for each of the line segment positions, and the middle position of the position shift amounts is obtained. claims, characterized in that to correct the positional deviation based on the amount of positional deviation value is compared with a reference image to inspect the inspection object image
Item 2. The image inspection apparatus according to item 2 .
択手段で選択された線分位置の基準画像上の基準画素デ
ータ列が線分と垂直方向に画素データの変化が少なく、
かつ線分と平行方向に画素データの変化が大きい線分位
置を選択する線分位置選択手段であることを特徴とする
請求項2または3記載の画像検査装置。 Wherein said line segment position selection means, the reference pixel data string of the reference image of the selected line segments located by the segment position selection means in line with the vertical direction much variation in the pixel data,
And a line segment position selecting means for selecting a line segment position in which a change in pixel data is large in a direction parallel to the line segment.
The image inspection apparatus according to claim 2 or 3 .
タ抽出手段により抽出される基準画素データ列が、前記
線分位置の基準画像上の画素データ列及び、線分と直角
方向にそれに隣接する所定数の画素データ列の対応する
画素ごとの画素データの加算平均値を画素データとする
画素データ列である第1データ抽出手段であり、 かつ前記第2データ抽出手段は、その第2データ抽出手
段により抽出される複数の検査対象画素データ列が、前
記線分位置およびその線分位置から画素単位で線分方向
に位置変化させた複数の各位置について、線分と直角方
向に各位置ごとにその位置に隣接する所定数の画素デー
タ列の対応する画素ごとの画素データの加算平均値を求
め、それを画素データとする複数の画素データ列である
第2データ抽出手段である、 ことを特徴とする請求項2〜4のいずれかに記載の画像
検査装置。 Wherein said first data extracting means, the reference pixel data string extracted by the first data extracting means, the pixel data strings on the reference image of the line position and, therewith the line perpendicular direction The first data extracting means is a pixel data row having pixel data which is an addition average value of pixel data of corresponding pixels of a predetermined number of adjacent pixel data rows, and the second data extracting means is the second data extracting means. A plurality of inspection target pixel data strings extracted by the data extraction means are arranged in the direction perpendicular to the line segment for each of the line segment position and each of a plurality of positions changed in the line segment direction in pixel units from the line segment position. A second data extraction unit that is a plurality of pixel data strings having pixel data as pixel data, which is obtained by calculating an addition average value of pixel data of corresponding pixels of a predetermined number of pixel data strings adjacent to the position. The image inspection apparatus according to any one of claims 2 to 4, wherein:
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP06213594A JP3433331B2 (en) | 1994-03-08 | 1994-03-08 | Image inspection method and apparatus |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP06213594A JP3433331B2 (en) | 1994-03-08 | 1994-03-08 | Image inspection method and apparatus |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH07249122A JPH07249122A (en) | 1995-09-26 |
| JP3433331B2 true JP3433331B2 (en) | 2003-08-04 |
Family
ID=13191344
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP06213594A Expired - Lifetime JP3433331B2 (en) | 1994-03-08 | 1994-03-08 | Image inspection method and apparatus |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3433331B2 (en) |
Families Citing this family (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP4375523B2 (en) | 2002-12-20 | 2009-12-02 | 富士ゼロックス株式会社 | Image processing apparatus, image processing method, image processing program, printed material inspection apparatus, printed material inspection method, printed material inspection program |
| JP4525090B2 (en) * | 2004-01-28 | 2010-08-18 | 富士ゼロックス株式会社 | Paper sheet inspection device, control device |
| JP4803376B2 (en) * | 2006-09-22 | 2011-10-26 | サクサ株式会社 | Camera tampering detection method |
| GB2473248A (en) * | 2009-09-04 | 2011-03-09 | Sony Corp | Determining image misalignment by comparing image characteristics at points along a line |
| JP6171688B2 (en) * | 2013-07-31 | 2017-08-02 | 株式会社リコー | Image inspection apparatus and image forming apparatus |
| US9258446B2 (en) | 2013-10-16 | 2016-02-09 | Fuji Xerox Co., Ltd. | Image processing apparatus |
| JP6468415B2 (en) | 2013-10-16 | 2019-02-13 | 富士ゼロックス株式会社 | Image processing apparatus and image processing program |
-
1994
- 1994-03-08 JP JP06213594A patent/JP3433331B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JPH07249122A (en) | 1995-09-26 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP7665326B2 (en) | Image processing device, image processing method, and program | |
| JP2002005846A (en) | Defect inspecting apparatus | |
| CN107155094B (en) | Using the vision inspections method of multiple video cameras | |
| JP3433331B2 (en) | Image inspection method and apparatus | |
| JP2006303491A (en) | Method of inspecting wafer | |
| JP3204876B2 (en) | Print inspection equipment | |
| JP2556894B2 (en) | Print quality inspection device and method | |
| JP2002008029A (en) | Image inspection device | |
| US6335982B1 (en) | Method and apparatus for inspecting streak | |
| EP0816825A2 (en) | Method and apparatus for inspecting streak | |
| JPS63135252A (en) | Apparatus for inspecting printing quality | |
| JPH09330412A (en) | Image inspection method and apparatus | |
| JP3589756B2 (en) | Inspection set value input display method and device for defect inspection | |
| JP3756279B2 (en) | Defect content discrimination method in printed matter inspection | |
| JP6665903B2 (en) | Feature image generation device, inspection device, feature image generation method, and feature image generation program | |
| JPH08171640A (en) | Image inspection method and apparatus | |
| JP2876999B2 (en) | Printing defect inspection equipment | |
| JPH1074262A (en) | Streak defect inspection method and device therefor | |
| JPH08281920A (en) | Image display method of printed matter inspection device | |
| JP2005091331A (en) | Printed product inspection apparatus and method | |
| JP3853429B2 (en) | Image inspection method and apparatus | |
| JPH08290555A (en) | Automatic evaluation method using optoelectronic equipment | |
| JP3759111B2 (en) | Inspection device and inspection method for printed matter | |
| JP2621690B2 (en) | Printing defect inspection equipment | |
| JPH09330411A (en) | Image inspection method and apparatus |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20030414 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080530 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090530 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090530 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100530 Year of fee payment: 7 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110530 Year of fee payment: 8 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120530 Year of fee payment: 9 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120530 Year of fee payment: 9 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130530 Year of fee payment: 10 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140530 Year of fee payment: 11 |
|
| EXPY | Cancellation because of completion of term |