Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP2646569B2 - Multi-value image evaluation device and threshold value determination device using the device - Google Patents
[go: Go Back, main page]

JP2646569B2 - Multi-value image evaluation device and threshold value determination device using the device - Google Patents

Multi-value image evaluation device and threshold value determination device using the device

Info

Publication number
JP2646569B2
JP2646569B2 JP62208849A JP20884987A JP2646569B2 JP 2646569 B2 JP2646569 B2 JP 2646569B2 JP 62208849 A JP62208849 A JP 62208849A JP 20884987 A JP20884987 A JP 20884987A JP 2646569 B2 JP2646569 B2 JP 2646569B2
Authority
JP
Japan
Prior art keywords
image
threshold value
window
brightness
information
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
Application number
JP62208849A
Other languages
Japanese (ja)
Other versions
JPS6451586A (en
Inventor
敦司 久野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Omron Corp
Original Assignee
Omron 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 Omron Corp filed Critical Omron Corp
Priority to JP62208849A priority Critical patent/JP2646569B2/en
Publication of JPS6451586A publication Critical patent/JPS6451586A/en
Application granted granted Critical
Publication of JP2646569B2 publication Critical patent/JP2646569B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)

Description

【発明の詳細な説明】 <産業上の利用分野> この発明は、知能ロボットの眼や目視検査装置などに
適用される画像処理技術に関連し、殊にこの発明は、濃
淡画像や距離画像等の多値画像について、その画質を評
価するのに用いられる多値画像評価装置と、この多値画
像評価装置を用いて多値画像を処理するしきい値を決定
するためのしきい値決定装置とに関する。
Description: TECHNICAL FIELD The present invention relates to an image processing technique applied to an eye, a visual inspection device, and the like of an intelligent robot. In particular, the present invention relates to a grayscale image, a distance image, and the like. Multi-valued image evaluation device used to evaluate the image quality of the multi-valued image, and a threshold value determination device for determining a threshold value for processing the multi-valued image using the multi-valued image evaluation device And about.

<従来の技術> 従来、多値画像の画質を評価するのに、予めわかって
いる特定形状の画像をもとにして、その特定形状の画像
とカメラで撮像された多値画像とを比較して、前記多値
画像の画質を評価する方式が提案されている(特開昭62
−80771号)。
<Conventional technology> Conventionally, in order to evaluate the image quality of a multi-valued image, based on an image of a specific shape that is known in advance, the image of the specific shape is compared with a multi-valued image captured by a camera. A method for evaluating the image quality of the multi-valued image has been proposed (Japanese Patent Laid-Open No. Sho 62-62).
No. -80771).

また前記の多値画像を2値化処理するしきい値を決定
する従来の方法として、一般にp−タイル法やモード法
が知られている。
In addition, as a conventional method of determining a threshold value for performing the binarization processing on the multi-valued image, a p-tile method and a mode method are generally known.

p−タイル法は、画像中に対象物の占める割合pが既
知のときに有効な方法であって、濃淡画像を2値化した
際に、「1」となる画素の数が全面素数に対してpの割
合になるようにしきい値tを定めるものである。
The p-tile method is an effective method when the proportion p of the object in the image is known, and when the grayscale image is binarized, the number of pixels that becomes “1” is relative to the total prime number. The threshold value t is determined so that the ratio becomes p.

第13図は濃淡画像の明るさのヒストグラムh1を示して
おり、横軸に明るさ、縦軸に画素数がとってある。p−
タイル法でしきい値の算出を行うには、まず同図に示す
ような明るさのヒストグラムh1を求めた後、明るさの値
の大きい方からの累積画素数(同図中、斜線で示す)が
全面素数に対してpの割合になるようにしきい値tを決
定する。
Figure 13 shows a histogram h 1 of the brightness of the gray-scale image, the brightness on the horizontal axis of, the number of pixels on the vertical axis are taken. p-
To perform calculation of the threshold in tile method, after initially seeking brightness histogram h 1 such as shown in the figure, in the cumulative number of pixels (figure from the larger brightness value, by hatching The threshold value t is determined so that the ratio (p.) Shown in FIG.

つぎにモード法は、対象物と背景との間にコントラス
トがある場合に明るさのヒストグラムに2個の山部が現
れることに着目したもので、その中間の谷部の位置にし
きい値を設定するものである。
Next, the mode method focuses on the fact that two peaks appear in the brightness histogram when there is a contrast between the object and the background, and sets a threshold value at the position of an intermediate trough. Is what you do.

第14図は、2個の山部1,2とその中間位置に谷部3と
が現れた明るさのヒストグラムh2を示しており、前記谷
部3の位置にしきい値tを設定することにより、対象物
と背景とを分離している。
Figure 14 shows the two ridges 2 and its intermediate position troughs 3 and brightness appeared in the histogram h 2, to set the threshold t to the position of the valley 3 Separates the object from the background.

また、他の方法としては比較的良好にしきい値を算出
できる方法として、大律のしきい値法が知られている。
As another method for calculating the threshold value relatively well, a large-scale threshold method is known.

この方法は、明るさのヒストグラムを谷部によって明
るい部分と暗い部分とにグループ分けするのではなく、
判別分析2値化法を用いることにより、ある境界より両
側を見て各グループが強くまとまり、かつ両グループの
中心が遠く離れるように明るさのヒストグラムを2個グ
ループに分けて、そのときの境界値を最適なしきい値と
するものである。ここで「強くまとまる」とは各グルー
プ内の分散の和が小であることを意味し、また「中心が
遠く離れる」とは各グループ間の分散が大きいことを意
味しており、次式で表されるλを最大にするようなしき
い値kを求める。
This method does not group the brightness histogram into bright and dark areas by valleys,
By using the discriminant analysis binarization method, the brightness histogram is divided into two groups so that each group is strongly united when seeing both sides from a certain boundary, and the centers of both groups are far apart. The value is set as an optimum threshold value. Here, “strongly united” means that the sum of the variances in each group is small, and “far away from the center” means that the variance between each group is large. A threshold k that maximizes the represented λ is determined.

λ=σB 2W 2 …… なお上式中、σW 2は2個のグループの分散の平均値
(「クラス内分散」)という)、またσB 2は2個のグル
ープの平均値間距離の2乗(クラス間分散)であって、
第15図に示す正規化された明るさのヒストグラムh3にお
いて、第1グループG1の標準偏差をσ1,第1グループG1
の生起確率をω1,第2グループG2の標準偏差をσ2,第2
グループG2の生起確率をωとすると、それぞれつぎの
式で与えられる。
λ = σ B 2 / σ W 2 where σ W 2 is the average of the variances of the two groups (referred to as “intra-class variance”), and σ B 2 is the average of the two groups The square of the distance between values (variance between classes)
In the histogram h 3 brightness normalized shown in FIG. 15, the standard deviation of the first group G1 sigma 1, the first group G1
Is ω 1 , the standard deviation of the second group G2 is σ 2 ,
When the occurrence probability of the group G2 and omega 2, are respectively given by the following expression.

σW 2=ωσ1 2+ωσ2 2 …… σB 2=ωω(μ−μ …… かくて式のλを最大にするしきい値kは、具体的に
はつぎの式を最大とするしきい値kを求めることによ
り得ることができる。
σ W 2 = ω 1 σ 1 2 + ω 2 σ 2 2 ... σ B 2 = ω 1 ω 21 −μ 2 ) 2 ... Specifically, it can be obtained by finding a threshold value k that maximizes the following equation.

なお上式中、μは正規化された明るさのヒストグラ
ム全体の平均値,ω(k)はこのヒストグラムの0次累
積モーメント,μ(k)はこのヒストグラムの1次累積
モーメントである。
Note in the above formula, the mu T average value of the entire histogram of brightness normalized, omega (k) is zero-order cumulative moments of the histogram, mu (k) is a first-order cumulative moments of the histogram.

上記の各方法の他に、画質の悪さをしきい値の算出基
準とする方法も提案されている。
In addition to the above methods, a method has also been proposed in which poor image quality is used as a threshold calculation standard.

この方法は、濃淡画像を複数段階(例えば256段階)
の各明るさをそれぞれしきい値として2値化して2値画
像を生成すると共に、各2値画像につき連結成分数,境
界線の長さ,DF表現における繁雑度のいずれかによって
画質の悪さを算出した後、その算出結果から最適なしき
い値を決定するものである。
This method uses a multi-level image (for example, 256 levels)
Each of the brightness values is used as a threshold to generate a binary image by binarizing the image, and for each binary image, the quality of the image is determined by one of the number of connected components, the length of the boundary line, and the complexity of the DF expression. After the calculation, the optimum threshold value is determined from the calculation result.

第16図は、各しきい値に対する2値画像の画質の悪さ
を示しており、同図の曲線lにおいて画質の悪さが極小
となるときのしきい値tが最適なしきい値として抽出さ
れる。
FIG. 16 shows the poor image quality of the binary image with respect to each threshold value, and the threshold t at which the poor image quality is minimized in the curve 1 in FIG. 16 is extracted as the optimal threshold value. .

<発明が解決しようとする問題点> 前記した多値画像の評価方式は、評価対象の大きさや
形状が既知である場合にのみ有効であって、それらが未
知である場合には適用できず、従って未知の対象物を撮
像して得られた多値画像に対する画質の評価はこれまで
不可能であるとされてきた。
<Problems to be Solved by the Invention> The above-described method of evaluating a multi-valued image is effective only when the size and shape of the evaluation target are known, and cannot be applied when those are unknown. Therefore, it has been considered that it is impossible to evaluate the image quality of a multivalued image obtained by imaging an unknown object.

また上記したしきい値決定方法については、p−タイ
ル法は画像中の対象物の大きさが既知でなければ適用で
きず、その用途が限定されるという不利がある。
In addition, with respect to the above-described threshold value determination method, the p-tile method cannot be applied unless the size of an object in an image is known, and there is a disadvantage that its use is limited.

またモード法は、明るさのヒストグラムに多数個の起
伏が現れたり、或いは起伏が全く現れなかった場合には
谷部の特定が困難となり、しきい値の決定が容易でない
という不利がある。
In addition, the mode method has a disadvantage that when many undulations appear in the brightness histogram or when no undulations appear at all, it becomes difficult to specify a valley, and it is difficult to determine a threshold value.

さらに大律のしきい値法では、式の演算に時間がか
かるだけでなく、この演算をkを変えつつ繰り返し実行
するため、最適なしきい値の算出に多大の演算時間を必
要とする。しかもこの方法は、明るさのヒストグラムを
2個のグループに明確に分けるためのしきい値を求める
ことを狙いとし、良好な2値画像を得るためのしきい値
を求めることを狙いとするものではないから、この方法
で得たしきい値が常に良好な2値画像をもたらすのは限
らないのである。
Further, in the rule of the large threshold, not only the calculation of the equation takes time, but also the calculation is repeatedly performed while changing k, so that the calculation of the optimum threshold requires a large amount of calculation time. Moreover, this method aims at finding a threshold for clearly dividing the brightness histogram into two groups, and for finding a threshold for obtaining a good binary image. However, the threshold value obtained in this way does not always lead to a good binary image.

この点、画質の悪さをしきい値の算出基準とする方法
であれば理論上常に良好な2値画像を生成できることに
なるが、従来のこの種方法では、第16図に示すような滑
らかな理想曲線が得られるとは限らず、極小値が複数箇
所に現れるなどして、しきい値の決定が困難となる場合
が生ずる。また2値画像を多数回(例えば256回)生成
してその都度画質の悪さを算出するため、処理時間が長
くかかり、加えて画質の悪さの定義が演算能率上好まし
くないため、その値の算出に時間がかかるなどの問題が
ある。
In this regard, a method using the poor image quality as a reference for calculating the threshold value can theoretically always produce a good binary image. However, in this type of conventional method, a smooth image as shown in FIG. An ideal curve is not always obtained, and there are cases where it becomes difficult to determine a threshold value because local minima appear at a plurality of locations. Further, since a binary image is generated many times (for example, 256 times) and the image quality is calculated each time, the processing time is long. In addition, the definition of the image quality is not preferable in terms of computational efficiency. There is a problem that it takes time.

この発明は、上記問題に着目してなされたもので、対
象物の形状や大きさが未知であっても、多値画像の評価
が可能であり、また高速かつ安定した最適しきい値の決
定が可能である多値画像評価装置およびその装置を用い
たしきい値決定装置を提供し、もって常に良好な2値画
像を生成することを目的とする。
The present invention has been made in view of the above problems, and enables evaluation of a multi-valued image even when the shape and size of an object are unknown, and also enables fast and stable determination of an optimal threshold value. It is an object of the present invention to provide a multi-valued image evaluation device capable of performing the above-mentioned, and a threshold value determining device using the device, so that a good binary image is always generated.

<問題点を解決するための手段> この発明は、多値画像の画質を評価する多値画像評価
装置であって、多値画像上に所定形状のウィンドウを設
定して走査するウィンドウ走査手段と、各走査位置毎に
ウィンドウ内の画像につき所定の条件を用いて明るさレ
ベルを抽出し、その抽出結果により前記多値画像におい
て各明るさレベルにかかるウィンドウの数を示す第1の
情報を生成する第1の情報生成手段と、各走査位置にお
けるウィンドウ内の画像につき、前記所定の条件により
抽出された明るさレベルをしきい値として得られる2値
パターンが画像の滑らかさを判別するための合法パター
ンまたは非合法パターンに一致するか否かを判別した
後、この判別結果と前記しきい値とを対応づけることに
より、明るさの各レベル毎に、そのレベルをしきい値と
して得られる2値パターンが合法パターンまたは非合法
パターンに一致する度合いを示す第2の情報を生成する
第2の情報生成手段と、前記ウィンドウ走査手段による
走査が終了したとき、第1,第2の各情報生成手段により
生成された情報を用いて、画質の評価値を与える第3の
情報を生成する第3の情報生成手段とを備えている。
<Means for Solving the Problems> The present invention is a multi-valued image evaluation apparatus for evaluating the image quality of a multi-valued image, comprising: a window scanning means for setting and scanning a window of a predetermined shape on the multi-valued image; Extracting a brightness level using predetermined conditions for an image in a window for each scanning position, and generating first information indicating the number of windows corresponding to each brightness level in the multi-valued image based on the extraction result. A first information generating means for determining a smoothness of an image in a window at each scanning position by using a binary pattern obtained using the brightness level extracted under the predetermined condition as a threshold value; After determining whether or not the pattern matches a legal pattern or an illegal pattern, by associating the determination result with the threshold value, the level of each brightness level is set. A second information generating means for generating second information indicating the degree to which a binary pattern obtained as a threshold matches a legal pattern or an illegal pattern; and And third information generating means for generating third information for giving an image quality evaluation value using information generated by each of the second information generating means.

また第2の発明は、多値画像を処理するしきい値を決
定するしきい値決定装置であって、上記の各手段に加
え、第3の情報に基づき最良の画質を与える最適しきい
値を決定する最適しきい値決定手段を具備して成るもの
である。
According to a second aspect of the present invention, there is provided a threshold value determining apparatus for determining a threshold value for processing a multi-valued image. Is determined.

<作用> 多値画像評価装置において、ウィンドウ走査手段は多
値画像上に所定形状のウィンドウを設定して走査する。
<Operation> In the multi-valued image evaluation apparatus, the window scanning unit sets and scans a window of a predetermined shape on the multi-valued image.

この場合に第1の情報生成手段は、各走査位置毎にウ
ィンドウ内の画像につき抽出された明るさレベルによ
り、多値画像において各明るさレベルにかかるウィンド
ウの数を示す情報を生成する。また第2の情報生成手段
は、各走査位置毎にウィンドウ内の画像につき前記の明
るさレベルをしきい値として得られる2値画像が滑らか
さを判別するための合法パターンまたは非合法パターン
に合致するか否かを判別した後、この判別結果と前記し
きい値とを対応づけることにより、明るさの各レベル毎
にこのレベルをしきい値として2値化処理を行った場合
に得られる2値パターンが、合法パターンまたは非合法
パターンにどの位の頻度で一致するかを示す情報を生成
する。ウィンドウの走査が終了すると第3の情報生成手
段は、第1,第2の情報生成手段により生成された情報に
より画質の評価値を与える第3の情報を生成するもの
で、この第3の情報により多値画像の画質を評価でき
る。
In this case, the first information generating means generates information indicating the number of windows corresponding to each brightness level in the multi-valued image based on the brightness level extracted for the image in the window for each scanning position. Further, the second information generating means is arranged such that a binary image obtained by using the brightness level as a threshold value for the image in the window at each scanning position matches a legal pattern or an illegal pattern for determining smoothness. After the determination as to whether or not to perform the binarization process, by associating the result of the determination with the threshold value, a binarization process is performed for each brightness level using the level as a threshold value. Information indicating how frequently the value pattern matches the legal or illegal pattern is generated. When the scanning of the window is completed, the third information generating means generates third information for giving an image quality evaluation value based on the information generated by the first and second information generating means. Can evaluate the image quality of the multi-valued image.

また第2の発明のしきい値決定装置においては、第3
の情報に基づき最良の画質を与える最適しきい値を決定
するもので、これにより1回の走査により多値画像を処
理するための最適なしきい値を得ることができる。
Further, in the threshold value determination device of the second invention,
The optimum threshold value that gives the best image quality is determined on the basis of the above information, whereby the optimum threshold value for processing a multi-valued image by one scan can be obtained.

この発明によれば、対象物の形状や大きさが未知であ
っても、多値画像の評価およびしきい値の決定が可能で
あり、またウィンドウの1回の走査をもって多値画像の
評価と高速かつ安定した最適しきい値の決定とが可能で
ある。
According to the present invention, it is possible to evaluate a multi-valued image and determine a threshold value even when the shape and size of an object are unknown, and to evaluate and evaluate a multi-valued image by one scan of a window. Fast and stable determination of the optimum threshold value is possible.

<実施例> 第1図は、この発明にかかる多値画像評価装置が用い
られたしきい値決定装置の全体構成例を示しており、マ
イクロコンピュータ10を制御主体とし、ウィンドウ走査
部11,非合法パターン検出部12,非合法パターンヒストグ
ラム生成部13,明るさヒストグラム生成部14,画質ヒスト
グラム生成部15,ヒストグラム平滑処理部16,最適しきい
値探索部17を具備している。
<Embodiment> Fig. 1 shows an example of the overall configuration of a threshold value determining device using a multi-valued image evaluation device according to the present invention. It includes a legal pattern detection unit 12, an illegal pattern histogram generation unit 13, a brightness histogram generation unit 14, an image quality histogram generation unit 15, a histogram smoothing unit 16, and an optimal threshold search unit 17.

ウィンドウ走査部11は、マイクロコンピュータ10にCP
Uバス18を介して接続されたアドレスジェネレータ19
と、このアドレスジェネレータ19に画像バス20を介して
接続された画像メモリ24と、前記画像バス20のデータバ
ス23に接続されたFIFO(first−in first−out)方式
の第1のシフトレジスタ25および第1群のラッチ回路26
〜29と、この最終段のラッチ回路29に接続された同じFI
FO方式の第2のシフトレジスタ30および第2群のラッチ
回路31〜34とから構成されている。
The window scanning unit 11 controls the microcomputer 10
Address generator 19 connected via U bus 18
And an image memory 24 connected to the address generator 19 via an image bus 20, and a first shift register 25 of a FIFO (first-in first-out) system connected to a data bus 23 of the image bus 20. And the first group of latch circuits 26
To 29 and the same FI connected to the last-stage latch circuit 29.
It comprises a second shift register 30 of the FO system and a second group of latch circuits 31 to 34.

図示例のウィンドウ走査部11は、画像メモリ24に記憶
された濃淡画像上に、第5図に示すような矩形状のウィ
ンドウ60を設定してラスタ走査するためのものであっ
て、このウィンドウ60内の画像につき所定の画素A0〜A7
の明るさデータd0〜d7が同時に取り出されるようになっ
ている。なお図中、×印は処理対象外の画素である。
The window scanning unit 11 in the illustrated example is for setting a rectangular window 60 as shown in FIG. 5 on the grayscale image stored in the image memory 24 and performing raster scanning. Predetermined pixels A 0 to A 7 for the image in
Brightness data d 0 to d 7 is adapted to be taken out simultaneously. In the figure, the crosses indicate pixels that are not to be processed.

すなわちアドレスジェネレータ19は画像メモリ24の各
画素のアドレスを順次生成して、そのアドレスに対応す
る画素の明るさデータを画像パルス20を介して第1のシ
フトレジスタ25へ出力させる。なお画像バス20のうち、
アドレスバス21はアドレスを、データバス23は明るさデ
ータを、コントロールバス22はアドレスストローブ信号
やリード・ライト信号を、それぞれ伝送する。第1のシ
フトレジスタ25は画像メモリ24の横方向の画素数をn
(第5図参照)とすると、このnより第1群のラッチ回
路26〜29の段数を差し引いた段数(n−4)をもつもの
であって、この段数分だけ明るさデータの出力を遅延さ
せる動作を実行する。第1群の4段のラッチ回路26〜29
は全体としてシフトレジスタの動作を行い、最終段のラ
ッチ回路29の出力が第2のシフトレジスタ30へ出力され
る。この第2のシフトレジスタ30も(n−4)の段数を
有し、この段数分だけ明るさデータの出力を遅延させて
第2群の4段のラッチ回路31〜34へ伝える。
That is, the address generator 19 sequentially generates the address of each pixel in the image memory 24, and outputs the brightness data of the pixel corresponding to the address to the first shift register 25 via the image pulse 20. Of the image bus 20,
The address bus 21 transmits an address, the data bus 23 transmits brightness data, and the control bus 22 transmits an address strobe signal and a read / write signal. The first shift register 25 sets the number of pixels in the horizontal direction of the image memory 24 to n.
(See FIG. 5), the number of stages of the first group of latch circuits 26 to 29 is subtracted from n (n-4), and the output of the brightness data is delayed by the number of stages. Perform the action that causes First-stage four-stage latch circuits 26 to 29
Performs the operation of the shift register as a whole, and the output of the last-stage latch circuit 29 is output to the second shift register 30. The second shift register 30 also has (n-4) stages, and outputs the brightness data to the second group of four-stage latch circuits 31 to 34 by delaying the output by the number of stages.

かくて第1群および第2群の各ラッチ回路26〜28,31
〜34と第2のシフトレジスタ30とから同時に明るさデー
タが取り出されるもので、第1群のラッチ回路26〜28の
各出力は前記ウィンドウ60内の画素A0〜A2の明るさデー
タd0〜d2を与え、また第2のシフトレジスタ30および第
2群のラッチ回路31〜34の各出力はウィンドウ60内の画
素A3〜A7の明るさデータd3〜d7を与えることになる。
Thus, the first and second group latch circuits 26-28, 31
To 34 and in which at the same time the brightness data from the second shift register 30. is taken out, the output of the latch circuit 26 to 28 of the first group of luminance data d of the pixel A 0 to A 2 in the window 60 0 to d 2 gives also the output of the second shift register 30 and the second group of latch circuits 31 to 34 to give the brightness data d 3 to d 7 of the pixel a 3 to a 7 in the window 60 become.

なおこの実施例では、2行×5列の画素より成る長方
矩形状のウィンドウ60を設定しているが、ウィンドウ形
状はこれに限らず、例えば第6図に示す如く3行×3列
の画素より成る正方矩形状のウィンドウ60であってもよ
く、またその他の形状であってもよい。
In this embodiment, a rectangular window 60 composed of 2 rows × 5 columns of pixels is set. However, the window shape is not limited to this. For example, as shown in FIG. The window 60 may be a rectangular window 60 composed of pixels, or may have another shape.

各画素A0〜A7の明るさデータd0〜d7は非合法パターン
検出部12へ出力されると共に、特定画素A1の明るさデー
タd1については非合法パターンヒストグラム生成部13お
よび明るさヒストグラム生成部14にも出力される。
Brightness data d 0 to d 7 of the respective pixels A 0 to A 7 together with the output to the illegal pattern detecting section 12, illegal pattern histogram generation unit 13 and the brightness for the brightness data d 1 of the specific pixel A 1 It is also output to the histogram generation unit 14.

非合法パターン検出部12は、ウィンドウ60内の画像が
合法パターンであるのか、非合法パターンであるのかを
判別するためのものであって、それが非合法パターンで
ある場合には「1」のフラグを出力し、合法パターンで
ある場合には「0」のフラグを出力する。図示例の非合
法パターン検出部12は、第2図に示す如く、各明るさデ
ータd0〜d7をラッチする8個のラッチ回路35〜42と、特
定画素A1の明るさデータd1とその他の画素A0およびA2
A7の明るさデータd0およびd2〜d7とを大小比較する7個
の比較回路43〜49とを含んでいる。これら比較回路43〜
49は、特定の画素A1の明るさデータd1をしきい値として
前記ウィンドウ60の各画素A0およびA2〜A7の明るさデー
タd0およびd2〜d7を2値化するためのものであって、各
明るさデータdi(ただしi=0,2,3,‥‥,7)がdi≧d1
ときは「1」、di<d1のときは「0」の各2値データfi
をそれぞれ出力する。なお特定画素A1の2値データf1
常に「1」とする。
The illegal pattern detection unit 12 is for determining whether the image in the window 60 is a legal pattern or an illegal pattern. When the image is an illegal pattern, the illegal pattern detection unit 12 outputs “1”. A flag is output, and if the pattern is a legal pattern, a flag of “0” is output. Illegal pattern detector 12 of the illustrated embodiment, as shown in FIG. 2, the eight latch circuits 35-42 which latch each luminance data d 0 to d 7, luminance data d 1 of the specific pixel A 1 And other pixels A 0 and A 2 ~
It contains seven comparison circuit 43 to 49 to magnitude comparing the brightness data d 0 and d 2 to d 7 of A 7. These comparison circuits 43 to
49, the brightness data d 0 and d 2 to d 7 of the respective pixels A 0 and A 2 to A 7 of the window 60 brightness data d 1 specific pixel A 1 as a threshold for binarizing The brightness data d i (i = 0, 2, 3, ‥‥, 7) is “1” when d i ≧ d 1 and “1” when d i <d 1. 0 ”binary data f i
Are output. Note binary data f 1 of the specific pixel A 1 is always "1".

第7図は、ウィンドウ60内の各画素A0〜A7の明るさデ
ータd0〜d7が2値化されて2値データf0〜f7に変換され
る過程を示している。
Figure 7 shows the process of being converted brightness data d 0 to d 7 of the respective pixels A 0 to A 7 in the window 60 is binarized into binary data f 0 ~f 7.

前記の2値データfi(i=0,2,3,‥‥,7)は検出ロジ
ック部50へ出力され、この検出ロジック部50はこれら2
値データfiによってウィンドウ60内の画像が非合法パタ
ーンであるか否かを判断し、否合法パターンであれば
「1」のフラグを、合法パターンであれば「0」のフラ
グを、それぞれ出力する。ここで合法パターンとは滑ら
かな画像上に頻繁に現れる第8図に示すような2値パタ
ーンを意味し、また非合法パターンと滑らかでない画像
上に頻繁に現れる第9図に示すような2値パターンを意
味するものである。なお第8,9図中、斜線部は「1」の
2値データをもつ画素を示し、第9図の2値パターンで
は「1」の画素領域の内側に「0」の孔部61が生じてい
る。
The binary data f i (i = 0, 2, 3,..., 7) is output to the detection logic unit 50, and the detection logic unit 50
Determines whether or not the image in the window 60 is illegal pattern by the value data f i, if not legally pattern flag of "1", the flag of "0" if legal patterns, respectively output I do. Here, the legal pattern means a binary pattern which frequently appears on a smooth image as shown in FIG. 8, and an illegal pattern and a binary pattern which frequently appears on an unsmooth image as shown in FIG. It means a pattern. 8 and 9, hatched portions indicate pixels having binary data of “1”, and in the binary pattern of FIG. 9, a hole 61 of “0” is formed inside the pixel region of “1”. ing.

つぎの式は、第10図(1)〜(6)に示す6種の2
値パターンを合法パターンに想定して、2値パターンが
合法パターンか、非合法パターンかを判断してその判断
結果をフラグとして出力するフラグ生成ロジックであ
る。
The following equations are the two types of 2 shown in FIGS. 10 (1) to (6).
This is a flag generation logic that assumes a value pattern as a legal pattern, determines whether the binary pattern is a legal pattern or an illegal pattern, and outputs the determination result as a flag.

flag=!(!f0&f2&!f3&f4&f5&f6♯!f0&f2&!f3
!f4&f5&f6♯!f0&f2&!f3&!f4&!f5&f6&f7♯f0&!
f2&f4& f5&f6&!f7♯f0&!f0&f4& f5&!f6&!f7♯f0&!f2&f3&f4&!f5&!f6♯!f7) …… なお上式中、!はNOT演算を、&はAND演算を、♯はOR
演算を、それぞれ示している。
flag =! (! F 0 & f 2 & ! F 3 & f 4 & f 5 & f 6 ♯! F 0 & f 2 &! F 3 &
! f 4 & f 5 & f 6 ♯! f 0 & f 2 &! f 3 &! f 4 &! f 5 & f 6 & f 7 ♯f 0 &!
f 2 & f 4 & f 5 & f 6 &! f 7 ♯f 0 &! f 0 & f 4 & f 5 &! f 6 &! f 7 ♯f 0 &! f 2 & f 3 & f 4 &! f 5 &! f 6 ♯! f 7 ) …… In the above formula,! Is NOT operation, & is AND operation, ♯ is OR
The operations are shown respectively.

上記検出ロジック部50が非合法パターンを検出して
「1」のフラグを出力する都度、非合法パターンヒスト
グラム生成部13はこのフラグの発生度数を計数して、非
合法パターンのヒストグラムを生成する。
Each time the detection logic unit 50 detects an illegal pattern and outputs a flag of “1”, the illegal pattern histogram generation unit 13 counts the frequency of occurrence of this flag and generates a histogram of the illegal pattern.

第3図は、非合法パターンヒストグラム生成部13の具
体例を示しており、カウンタ51,メモリ52,タイミング制
御部53を備えている。このメモリ52は前記ウィンドウ走
査部11のラッチ回路27より明るさデータd1が与えられる
アドレス入力ピンAと、カウンタ51の計数データが与え
られるデータ入力ピンDとを備えており、非合法パター
ンの検出フラグが発生する毎に、そのときの明るさデー
タd1に対応するアドレス領域のデータ(非合法パターン
の発生度数)がカウンタ51により書き替えられるように
なっている。従ってカウンタ51は非合法パターンの検出
フラグが発生すると、そのときの明るさデータd1に対応
するアドレスのメモリ52の領域より現在値(度数)を読
み取ってその値に1加算した後、その加算後の値で前記
アドレス領域の内容を書き替える。なお同図中、アクセ
スコントロール信号は初期時にメモリ52の各領域をゼロ
にクリアするための信号である。またメモリ52のR/Wは
リード・ライト,CSはチップセレクトを意味し、カウン
タ51のUPはアップカウント,OEはアウトプットイネーブ
ル,LDはロードを意味しており、タイミング制御部53は
非合法パターンの検出フラグやアクセスコントロール信
号に基づきこれら信号入力ピンに対し所定の信号を与え
て、上記非合法ヒストグラムの生成動作のタイミング等
を制御する。
FIG. 3 shows a specific example of the illegal pattern histogram generation unit 13, which includes a counter 51, a memory 52, and a timing control unit 53. The memory 52 is provided with an address input pins A brightness data d 1 from the latch circuit 27 of the window scanning unit 11 is provided, and a data input pin D of the count data is provided in the counter 51, the illegal pattern each time the detection flag is generated, the data of the address area corresponding to the brightness data d 1 (occurrence frequency of illegal pattern) is adapted to be rewritten by the counter 51 at that time. Thus the counter 51 when the detection flag illegal pattern occurs, after adding 1 to the value read brightness current value than the area of the memory 52 at the address corresponding to the data d 1 (power) at that time, the addition The contents of the address area are rewritten with the later value. In the figure, the access control signal is a signal for clearing each area of the memory 52 to zero at the initial stage. Also, R / W of the memory 52 means read / write, CS means chip select, UP of the counter 51 means up count, OE means output enable, LD means load, and the timing control unit 53 is illegal. A predetermined signal is applied to these signal input pins based on a pattern detection flag and an access control signal to control the timing of the illegal histogram generation operation and the like.

第4図は、明るさヒストグラム生成部14の具体例を示
しており、非合法ヒストグラム生成部13と同様、カウン
タ54,メモリ55,タイミング発生部56より構成されてい
る。このカウンタ54はウィンドウ走査部11のラッチ回路
27より明るさデータd1が与えられる毎に、その明るさデ
ータd1に対応するアドレスのメモリ55の領域より現在値
(明るさの度数)を読み取ってその値に1加算した後、
その加算後の値で前記アドレス領域の内容を書き替える
ものである。なおメモリ55,カウンタ54,タイミング制御
部56の各機能等は前記非合法パターンヒストグラム生成
部13のものと同様であり、ここではその説明を省略す
る。
FIG. 4 shows a specific example of the brightness histogram generation unit 14, which comprises a counter 54, a memory 55, and a timing generation unit 56, like the illegal histogram generation unit 13. This counter 54 is a latch circuit of the window scanning unit 11.
Each brightness data d 1 than 27 is given, after adding 1 to the value read current value (brightness of the power) than the area of the memory 55 at the address corresponding to the luminance data d 1,
The contents of the address area are rewritten with the value after the addition. The functions of the memory 55, the counter 54, the timing control unit 56, and the like are the same as those of the illegal pattern histogram generation unit 13, and a description thereof will be omitted.

このように非合法パターンヒストグラム生成部13はメ
モリ52上に非合法パターンヒストグラムfhist(k)を
生成する。ここでfhist(k)はしきい値kにおける非
合法パターンの発生度数を意味する。この実施例の場
合、非合法パターン検出部12で特定画素の明るさデータ
d1をしきい値として他の画素の明るさデータd0およびd2
〜d7によるパターンを評価して、その結果が式のflag
で表されるから、非合法パターンヒストグラムf
hist(k)はつぎの式に従って形成される。
In this way, the illegal pattern histogram generation unit 13 generates the illegal pattern histogram f hist (k) on the memory 52. Here, f hist (k) means the frequency of occurrence of illegal patterns at the threshold value k. In the case of this embodiment, the brightness data of a specific pixel is
Brightness data d 0 and d 2 of other pixels with d 1 as a threshold
To evaluate the pattern by ~d 7, the result is an expression flag
The illegal pattern histogram f
hist (k) is formed according to the following equation.

fhist(k)=fhist(k)+flag …… ただし非合法パターンヒストグラムの各要素はゼロで
初期化されているものとする。
f hist (k) = f hist (k) + flag However, it is assumed that each element of the illegal pattern histogram is initialized to zero.

また明るさヒストグラム生成部14はメモリ55上に明る
さヒストグラムhist(k)を生成する。ここでhist
(k)は明るさkの画素の発生度数を意味しており、こ
の明るさヒストグラムhist(k)は、同様につぎの式
に従って生成される。
The brightness histogram generator 14 generates a brightness histogram hist (k) on the memory 55. Here hist
(K) means the frequency of occurrence of a pixel of brightness k, and this brightness histogram hist (k) is similarly generated according to the following equation.

hist(k)=hist(k)+1 …… 第1図に戻って、画質ヒストグラム15は非合法パター
ンヒストグラムおよび明るさヒストグラムの生成が完了
した後、画質ヒストグラムqhist(k)を生成する。こ
の画質ヒストグラムqhist(k)は画質の評価基準、こ
の実施例では画質の悪さを示す基準を与えるもので、つ
ぎの式に従って生成される。
hist (k) = hist (k) +1 Returning to FIG. 1, the image quality histogram 15 generates an image quality histogram q hist (k) after the generation of the illegal pattern histogram and the brightness histogram is completed. The image quality histogram q hist (k) provides an evaluation standard for image quality, in this embodiment, a standard indicating poor image quality, and is generated according to the following equation.

(1) hist(k)=0のとき qhist(k)=Q0 …… (2) hist(k)≠0のとき なお上式中、Q0は定数(最大値)であり、q
hist(k)の値が大きいほど画質が悪いことを示してい
る。
(1) When hist (k) = 0 q hist (k) = Q 0 (2) When hist (k) ≠ 0 In the above equation, Q 0 is a constant (maximum value), and q
The larger the value of hist (k), the worse the image quality.

つぎに第1図のヒストグラム平滑処理部16は、必要に
応じて画質ヒストグラムqhist(k)を平滑化するため
のもので、その結果、第11図に示すような、平滑化され
た画質ヒストグラムs qhist(k)が生成される。
Next, the histogram smoothing processing section 16 in FIG. 1 is for smoothing the image quality histogram q hist (k) as necessary, and as a result, as shown in FIG. sq hist (k) is generated.

第11図において、横軸はk(しきい値)、縦軸はs q
hist(k)(画質の悪さ)であって、画質の悪さはしき
い値koptのとき最小となっている。
In FIG. 11, the horizontal axis is k (threshold), and the vertical axis is sq
hist (k) (bad image quality), and the bad image quality is minimum when the threshold value k opt is used.

最適しきい値探索部17は、平滑化された画質ヒストグ
ラムs qhist(k)の最小値を検索する手段であって、
このしきい値koptを最適しきい値として探索し、その探
索結果をCPUバス18を通じてマイクロコンピュータ10に
知らせるのである。
The optimum threshold value searching unit 17 is means for searching for the minimum value of the smoothed image quality histogram sq hist (k),
This threshold k opt is searched as the optimum threshold, and the search result is notified to the microcomputer 10 through the CPU bus 18.

上記実施例の構成は、濃淡画像のような多値画像につ
いて対象物と背景とをきれいに白黒に分離し得るほど、
すなわち輪郭が滑らかな2値画像が得られるほど、画質
が良好であるという考え方に基づくもので、最適しきい
値で2値化して得られた2値画像の輪郭部分は他のしき
い値で2値化された2値画像の輪郭部分より非合法パタ
ーンが少なくなる。この実施例では、2値画像の輪郭画
素の2値化前の明るさはその2値画像を得るのに用いた
しきい値に等しいという原理に基づいており、ある画素
が最適しきい値による2値画像の輪郭画素であれば、そ
の2値画像の生成のもとになった濃淡画像上において前
記の特定画素A1を中心するウィンドウ60内の画像を、前
記画素A1の明るさで2値化して得られる2値画像には、
非合法パターンが少なくなる。
The configuration of the above embodiment is such that a multi-valued image such as a grayscale image can be clearly separated into a black and white object and background.
That is, it is based on the idea that the image quality is better as the binary image having a smoother contour is obtained, and the contour portion of the binary image obtained by binarization with the optimum threshold value is determined by another threshold value. The number of illegal patterns is smaller than the outline portion of the binarized binary image. This embodiment is based on the principle that the brightness of an outline pixel of a binary image before binarization is equal to the threshold value used to obtain the binary image. if the contour pixel value image, the image in the window 60 to around a specific pixel a 1 of the on grayscale images was based generation of the binary image, with the brightness of the pixel a 1 2 In the binary image obtained by binarization,
Fewer illegal patterns.

換言すれば、濃淡画像上において画素A1を中心とする
ウィンドウ60内の画像を、画素A1の明るさで2値化して
得られる2値画像において非合法パターンが少なくなる
というということは、前記画素A1の明るさでウィンドウ
60内の画像を2値化すると、ウィンドウ60内の画像は最
適な2値画像になることを意味する。前記画質ヒストグ
ラムqhist(k)は、このような考え方に基づくもので
あり、合法パターンが少ない、つまり非合法パターンが
多いウィンドウ60内での画素A1の明るさは、ウィンドウ
60を画像全体に広げた場合でもその明るさで2値化する
と、非合法パターンが多くなるということになる。な
お、ウィンドウ60内の着目画素の明るさが全体画像中に
は一様な分布をしているとは限らないので、非合法パタ
ーンヒストグラムfhist(k)を明るさのヒストグラムh
ist(k)のデータを用いて正規化し、画質ヒストグラ
ムqhist(k)を算出しているのである。
In other words, the fact that that the image in the window 60 centered on the pixel A 1 on the gray image, illegal pattern is reduced in the binary image obtained by binarizing the brightness of the pixel A 1 is window brightness of the pixel a 1
When the image in the window 60 is binarized, it means that the image in the window 60 becomes an optimal binary image. The image quality histogram q hist (k) is based on such a concept, and the brightness of the pixel A 1 in the window 60 with few legal patterns, that is, with many illegal patterns, is determined by the window
Even if 60 is spread over the entire image, binarizing with the brightness means that illegal patterns increase. Since the brightness of the pixel of interest in the window 60 does not always have a uniform distribution in the entire image, the illegal pattern histogram f hist (k) is represented by the brightness histogram h
The image quality histogram q hist (k) is calculated by normalizing using the data of ist (k).

なお上記実施例では、ウィンドウ60内の画像につき特
定位置の画素A1の明るさデータd1を抽出して明るさヒス
トグラムを生成すると共に、その明るさデータd1をしき
い値としてウィンドウ60内の画像を2値化処理している
が、これに限らず、例えばウィンドウ60内の複数個の画
素につき明るさデータの平均値を求めて明るさヒストグ
ラムを生成すると共に、その平均値をしきい値としてウ
ィンドウ60内の画像を2値化処理してもよい。
Note that, in the above embodiment, the extracted brightness data d 1 of the pixel A 1 of the specific position per image in the window 60 produces a brightness histogram, the window 60 in the luminance data d 1 as a threshold value Is binarized, but the invention is not limited to this. For example, a brightness histogram is generated by calculating an average value of brightness data for a plurality of pixels in the window 60, and the average value is thresholded. The image in the window 60 may be binarized as a value.

つぎに上記実施例の動作を説明すると、画像メモリ24
には対象物と背景とから成る濃淡画像が格納されてい
る。この濃淡画像は図示しない撮像装置により撮像され
たもので、この濃淡画像を2値化するに先立ち、この実
施例の装置によって2値化しきい値が算出される。
Next, the operation of the above embodiment will be described.
Stores a shaded image composed of an object and a background. The grayscale image is captured by an imaging device (not shown), and before the binary image is binarized, the binarization threshold value is calculated by the device of this embodiment.

まず非合法パターンヒストグラム生成部13のメモリ52
と明るさヒストグラム生成部14のメモリ55とをゼロにク
リアした後、ウィンドウ走査部11は濃淡画像上にウィン
ドウ60を設定してラスタ走査する。すなわちウィンドウ
走査部11において、アドレスジェネレータ19は画像メモ
リ24の各画素のアドレスを順次生成して、そのアドレス
に対応する画素の明るさデータを画像バス20を介して第
1のシフトレジスタ25へ出力させる。これら明るさデー
タは第1のシフトレジスタ25,第1群のラッチ回路26〜2
9,第2のシフトレジスタ30,第2群のラッチ回路31〜34
へ順送りされ、第1群および第2群の各ラッチ回路26〜
28,31〜34と第2のシフトレジスタ30とからウィンドウ6
0内の画素A0〜A7の明るさデータd0〜d7が取り出される
ことになる。
First, the memory 52 of the illegal pattern histogram generation unit 13
After clearing the memory 55 of the brightness histogram generation unit 14 to zero, the window scanning unit 11 performs a raster scan by setting the window 60 on the grayscale image. That is, in the window scanning unit 11, the address generator 19 sequentially generates the address of each pixel in the image memory 24, and outputs the brightness data of the pixel corresponding to the address to the first shift register 25 via the image bus 20. Let it. These brightness data are stored in a first shift register 25 and a first group of latch circuits 26 to 2.
9, the second shift register 30, the second group of latch circuits 31 to 34
To the latch circuits 26 to 26 of the first and second groups.
From window 28, 31 to 34 and second shift register 30, window 6
Brightness data d 0 to d 7 of the pixel A 0 to A 7 in the 0 is to be retrieved.

非合法パターン検出部12はこれら明るさd0〜d7を取り
込み、特定の画素A1の明るさデータd1をしきい値として
ウィンドウ60内の各画素を2値化した後、その2値パタ
ーンが非合法パターンに該当するか否かを判断する。も
し非合法パターンであれば検出フラグ「1」が出力さ
れ、非合法パターンヒストグラム生成部13において明る
さ(しきい値)毎の非合法パターンの発生度数が計数さ
れて、非合法パターンヒストグラムが生成される。同様
に明るさヒストグラム生成部14では各明るさの度数が計
数されて明るさヒストグラムが生成される。これらヒス
トグラムの生成が完了すると、つぎの画質ヒストグラム
生成部15において両ヒストグラムを用いて画質ヒストグ
ラムが算出される。この画質ヒストグラムは必要に応じ
てヒストグラム平滑処理部16で平滑化された後、最適し
きい値探索部17がこの平滑化された画質ヒストグラムよ
り最適のしきい値を探索してその探索結果をマイクロコ
ンピュータ10へ出力する。
Illegal pattern detector 12 fetches these brightness d 0 to d 7, after binarizing the pixels in the window 60 brightness data d 1 specific pixel A 1 as a threshold value, the binary It is determined whether the pattern corresponds to an illegal pattern. If the pattern is an illegal pattern, a detection flag “1” is output, and the frequency of occurrence of the illegal pattern for each brightness (threshold) is counted in the illegal pattern histogram generation unit 13 to generate an illegal pattern histogram. Is done. Similarly, the brightness histogram generation unit 14 counts the frequency of each brightness and generates a brightness histogram. When the generation of these histograms is completed, the next image quality histogram generation unit 15 calculates an image quality histogram using both histograms. This image quality histogram is smoothed by a histogram smoothing processing unit 16 as needed, and then an optimum threshold value searching unit 17 searches for an optimum threshold value from the smoothed image quality histogram, and the search result is micro-scaled. Output to computer 10.

上記の実施例は、最適しきい値をハード的に算出して
いるが、この発明はこれに限らず、最適しきい値をソフ
ト的に算出することも可能である。
In the above embodiment, the optimum threshold value is calculated by hardware, but the present invention is not limited to this, and the optimum threshold value can be calculated by software.

第12図は、この場合のマイクロコンピュータ(図示せ
ず)による制御手順を示すものであるが、このマイクロ
コンピュータはCPUを制御主体とし、このCPUがROMに格
納されたプログラムを解読実行し、RAMに対するデータ
の読み書きを行いつつ第12図の手順を順次実行してゆく
ことは勿論である。
FIG. 12 shows a control procedure by a microcomputer (not shown) in this case. This microcomputer has a CPU as a control main body, and the CPU decodes and executes a program stored in a ROM, and executes a program stored in a RAM. Of course, the procedure shown in FIG. 12 is sequentially executed while reading and writing data from and to.

第12図のステップ1(図中、「ST1」で示す)および
ステップ2において、CPUはRAM等に生成する明るさヒス
トグラムや非合法パターンヒストグラムをゼロにクリア
した後、つぎのステップ3でウィンドウを濃淡画像の初
期位置にセットする。ついでCPUはウィンドウ内の各画
素をアクセスし、ウィンドウ内の特定画素の明るさをし
きい値としてウィンドウ内の画像を2値化する(ステッ
プ4,5)。
In step 1 (indicated by “ST1” in the figure) and step 2 in FIG. 12, the CPU clears the brightness histogram and the illegal pattern histogram generated in the RAM or the like to zero, and then sets the window in the next step 3 Set to the initial position of the grayscale image. Next, the CPU accesses each pixel in the window and binarizes the image in the window using the brightness of a specific pixel in the window as a threshold (steps 4 and 5).

つぎにCPUはRAMより前記しきい値の明るさに対応する
明るさヒストグラムの度数を読み出して1加算し、この
加算結果でRAMの内容を書き替える(ステップ6)。
Next, the CPU reads the frequency of the brightness histogram corresponding to the brightness of the threshold from the RAM, adds 1 to the frequency, and rewrites the contents of the RAM with the addition result (step 6).

つぎのステップ7は、ウィンドウ内の2値パターンが
合法パターンであるか、非合法パターンであるか否かを
判定しており、もし非合法パターンであれば、CPUはRAM
より前記しきい値の明るさに対応する非合法パターンヒ
ストグラムの度数を読み出して1加算し、この加算結果
でRAMの内容を書き替える(ステップ8)。
The next step 7 is to determine whether the binary pattern in the window is a legal pattern or an illegal pattern.
Then, the frequency of the illegal pattern histogram corresponding to the brightness of the threshold value is read and added by 1, and the contents of the RAM are rewritten with the addition result (step 8).

つぎのステップ9はウィンドウによる濃淡画像の走査
を完了したか否かを判定しており、もしその判定が“N
O"のとき、CPUはステップ10でウィンドウの位置をラス
タ走査的に変更した後、ステップ4へ戻って同様の手順
を繰り返し実行する。
In the next step 9, it is determined whether or not scanning of the grayscale image by the window has been completed.
In the case of "O", the CPU changes the position of the window in a raster scan manner in step 10 and then returns to step 4 to repeatedly execute the same procedure.

かくてウィンドウによる走査が完了すると、ステップ
9が“YES"となり、CPUはステップ11で明るさヒストグ
ラムと非合法パターンヒストグラムとから画質ヒストグ
ラムを算出した後、ステップ12でこの画質ヒストグラム
より最適なしきい値を算出する。
When the scanning by the window is completed, "YES" is determined in step 9 and the CPU calculates an image quality histogram from the brightness histogram and the illegal pattern histogram in step 11, and then, in step 12, an optimum threshold value based on the image quality histogram. Is calculated.

<発明の効果> この発明は上記の如く、多値画像上に所定形状のウィ
ンドウを設定して走査し、各走査位置毎にウィンドウ内
の画像につき抽出された明るさレベルにより多値画像に
おいて各明るさレベルにかかるウィンドウの数を示す情
報を生成すると共に、前記抽出された明るさレベル毎
に、このレベルをしきい値とした場合に得られる2値パ
ターンが合法パターンまたは非合法パターンと一致する
度合いに関わる情報を生成し、さらにこれらの情報を用
いて、画質の評価値を与える第3の情報を生成するよう
にしたから、対象物の形状や大きさが未知であっても、
ウィンドウによる1回の走査で多値画像の画質を評価し
て、その評価値を基に照明やその他の撮像条件を最適に
制御でき、評価対象に適した多値画像を得ることが可能
となる。また第2の発明では、前記した第3の情報に基
づき最良の画質を与える最適しきい値を決定するように
したから、対象物の大きさが未知であってもしきい値の
決定が可能である。さらにウィンドウによる1回の走査
により、多値画像の評価およびしきい値の決定が可能で
あり、高速かつ安定して最適なしきい値を決定できる
等、発明目的を達成した顕著な効果を奏する。
<Effects of the Invention> As described above, the present invention sets and scans a window of a predetermined shape on a multi-valued image, and scans each multi-valued image based on the brightness level extracted for the image in the window at each scanning position. Information indicating the number of windows corresponding to the brightness level is generated, and for each of the extracted brightness levels, a binary pattern obtained when this level is set as a threshold matches a legal pattern or an illegal pattern. Since the information relating to the degree of the image quality is generated, and the third information for giving the evaluation value of the image quality is generated using the information, even if the shape and size of the object are unknown,
The image quality of a multi-valued image is evaluated by one scan using a window, and illumination and other imaging conditions can be optimally controlled based on the evaluation value, and a multi-valued image suitable for the evaluation object can be obtained. . Further, in the second invention, the optimum threshold value that gives the best image quality is determined based on the third information, so that the threshold value can be determined even if the size of the object is unknown. is there. Furthermore, a single scan with a window enables evaluation of a multi-valued image and determination of a threshold value, and has a remarkable effect of attaining the object of the invention, such as being able to quickly and stably determine an optimum threshold value.

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

第1図はこの発明にかかる多値画像評価装置が用いられ
たしきい値決定装置の回路ブロック図、第2図は非合法
パターン検出部の具体例を示す回路ブロック図、第3図
は非合法パターンヒストグラム生成部の具体例を示す回
路ブロック図、第4図は明るさヒストグラム生成部の具
体例を示す回路ブロック図、第5図は濃淡画像上に設定
されるウィンドウの概念を示す説明図、第6図はウィン
ドウの他の実施例を示す説明図、第7図はウィンドウ内
の画像の2値化過程を示す説明図、第8図は合法パター
ンの一例を示す説明図、第9図は非合法パターンの一例
を示す説明図、第10図はこの実施例で想定された合法パ
ターンを示す説明図、第11図は平滑化された画質ヒスト
グラムを示す説明図、第12図はしきい値をソフト的に算
出する場合の手順を示すフローチャート、第13図〜第16
図は従来の2値化しきい値算出方法の原理を示す説明図
である。 11……ウィンドウ走査部 12……非合法パターン検出部 13……非合法パターンヒストグラム生成部 14……明るさヒストグラム生成部 15……画質ヒストグラム生成部 17……最適しきい値探索部
FIG. 1 is a circuit block diagram of a threshold value determination device using the multi-valued image evaluation device according to the present invention, FIG. 2 is a circuit block diagram showing a specific example of an illegal pattern detection unit, and FIG. FIG. 4 is a circuit block diagram illustrating a specific example of a legal pattern histogram generation unit, FIG. 4 is a circuit block diagram illustrating a specific example of a brightness histogram generation unit, and FIG. 5 is an explanatory diagram illustrating a concept of a window set on a grayscale image. , FIG. 6 is an explanatory diagram showing another embodiment of the window, FIG. 7 is an explanatory diagram showing a binarization process of an image in the window, FIG. 8 is an explanatory diagram showing an example of a legal pattern, FIG. Is an explanatory diagram showing an example of an illegal pattern, FIG. 10 is an explanatory diagram showing a legal pattern assumed in this embodiment, FIG. 11 is an explanatory diagram showing a smoothed image quality histogram, and FIG. 12 is a threshold diagram. The procedure for calculating the value by software To the flowchart, FIG. 13, second 16
FIG. 1 is an explanatory diagram showing the principle of a conventional binarization threshold value calculation method. 11 window scanning unit 12 illegal pattern detection unit 13 illegal pattern histogram generation unit 14 brightness histogram generation unit 15 image quality histogram generation unit 17 optimal threshold value search unit

Claims (7)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】多値画像の画質を評価する多値画像評価装
置であって、 多値画像上に所定形状のウィンドウを設定して走査する
ウィンドウ走査手段と、 各走査位置毎にウィンドウ内の画像につき所定の条件を
用いて明るさレベルを抽出し、その抽出結果により前記
多値画像において各明るさレベルにかかるウィンドウの
数を示す第1の情報を生成する第1の情報生成手段と、 各走査位置におけるウィンドウ内の画像につき、前記所
定の条件により抽出された明るさレベルをしきい値とし
て得られる2値パターンが画像の滑らかさを判別するた
めの合法パターンまたは非合法パターンに一致するか否
かを判別した後、この判別結果と前記しきい値とを対応
づけることにより、明るさの各レベル毎に、そのレベル
をしきい値として得られる2値パターンが合法パターン
または非合法パターンに一致する度合いを示す第2の情
報を生成する第2の情報生成手段と、 前記ウィンドウ走査手段による走査が終了したとき、第
1,第2の各情報生成手段により生成された情報を用い
て、画質の評価値を与える第3の情報を生成する第3の
情報生成手段とを備えて成る多値画像評価装置。
1. A multi-valued image evaluation apparatus for evaluating the image quality of a multi-valued image, comprising: a window scanning means for setting and scanning a window of a predetermined shape on the multi-valued image; First information generation means for extracting a brightness level using predetermined conditions for an image, and generating first information indicating the number of windows corresponding to each brightness level in the multi-valued image based on the extraction result; For the image in the window at each scanning position, the binary pattern obtained using the brightness level extracted under the predetermined condition as a threshold value matches a legal pattern or an illegal pattern for determining the smoothness of the image. After the determination as to whether or not each of the brightness levels is a threshold value, the result of the determination is associated with the threshold value. When the second information generation means over down to generate a second information indicating a degree of matching the legal pattern or illegal pattern, the scanning by the window scanning means has been completed, the
1. A multi-valued image evaluation device comprising: a third information generation unit that generates third information that gives an image quality evaluation value using information generated by each of the second information generation units.
【請求項2】前記ウィンドウ走査手段は、縦横複数個の
画素より成る矩形上のウィンドウを多値画像上に設定し
て走査する手段である特許請求の範囲第1項記載の多値
画像評価装置。
2. A multi-value image evaluation apparatus according to claim 1, wherein said window scanning means is means for setting and scanning a rectangular window comprising a plurality of pixels in a vertical and horizontal direction on a multi-value image. .
【請求項3】前記第1の情報生成手段は、各走査位置毎
にウィンドウ内の特定位置の画素の明るさを抽出し、各
抽出結果により多値画像における明るさのヒストグラム
を生成する手段である特許請求の範囲第1項記載の多値
画像評価装置。
3. The first information generating means extracts a brightness of a pixel at a specific position in a window for each scanning position, and generates a histogram of brightness in a multi-valued image based on each extraction result. The multi-value image evaluation device according to claim 1.
【請求項4】前記第1の情報生成手段は、各走査位置毎
にウィンドウ内の複数個の画素の明るさの平均値を抽出
し、各抽出結果により多値画像における明るさのヒスト
グラムを生成する手段である特許請求の範囲第1項記載
の多値画像評価装置。
4. The first information generating means extracts an average value of brightness of a plurality of pixels in a window for each scanning position, and generates a brightness histogram of a multi-valued image based on each extraction result. 2. The multivalued image evaluation device according to claim 1, wherein the multivalued image evaluation device is a means for performing the operation.
【請求項5】前記第3の情報生成手段は、前記多値画像
について、第1,第2の各情報生成手段により生成された
情報を用いて、明るさの各レベルと画質の評価値とを対
応づけた画質ヒストグラムを生成する手段である特許請
求の範囲第1項記載の多値画像評価装置。
5. The information generating means according to claim 1, wherein said third information generating means uses the information generated by said first and second information generating means for said multi-valued image to calculate each level of brightness and an evaluation value of image quality. 2. The multi-valued image evaluation device according to claim 1, wherein said multi-valued image evaluation device is means for generating an image quality histogram in which the image quality histogram is associated.
【請求項6】多値画像を処理するしきい値を決定するし
きい値決定装置であって、 多値画像上に所定形状のウィンドウを設定して走査する
ウィンドウ走査手段と、 各走査位置毎にウィンドウ内の画像につき所定の条件を
用いて明るさレベルを抽出し、その抽出結果により前記
多値画像において各明るさレベルにかかるウィンドウの
数を示す第1の情報を生成する第1の情報生成手段と、 各走査位置におけるウィンドウ内の画像につき、前記所
定の条件により抽出された明るさレベルをしきい値とし
て得られる2値パターンが画像の滑らかさを判別するた
めの合法パターンまたは非合法パターンに一致するか否
かを判別した後、この判別結果と前記しきい値とを対応
づけることにより、明るさの各レベル毎に、そのレベル
をしきい値として得られる2値パターンが合法パターン
または非合法パターンに一致する度合いを示す第2の情
報を生成する第2の情報生成手段と、 前記ウィンドウ走査手段による走査が終了したとき、第
1,第2の各情報生成手段により生成された情報を用い
て、画質の評価値を与える第3の情報を生成する第3の
情報生成手段と 前記第3の情報に基づき最良の画質を与える最適しきい
値を決定する最適しきい値決定手段とを備えて成るしき
い値決定装置。
6. A threshold value determining device for determining a threshold value for processing a multi-valued image, comprising: a window scanning means for setting and scanning a window of a predetermined shape on the multi-valued image; First information for extracting a brightness level using a predetermined condition for an image in a window, and generating first information indicating the number of windows corresponding to each brightness level in the multi-valued image based on the extraction result. Generating means, for the image in the window at each scanning position, a binary pattern obtained by using the brightness level extracted under the predetermined condition as a threshold value to determine the smoothness of the image; After determining whether or not the pattern matches the pattern, the result of the determination is associated with the threshold value to obtain the level as a threshold value for each brightness level. Binary pattern and a second information generating means for generating a second information indicating a degree of matching the legal pattern or illegal pattern, when scanned by the window scanning means is completed, the
A third information generating means for generating third information for giving an image quality evaluation value by using information generated by each of the second information generating means; and providing the best image quality based on the third information. A threshold value determining device comprising: an optimum threshold value determining means for determining an optimum threshold value.
【請求項7】前記第3の情報生成手段は、前記多値画像
について、第1,第2の各情報生成手段により生成された
情報を用いて、明るさの各レベルと画質の評価値とを対
応づけた画質ヒストグラムを生成する手段であり、 前記最適しきい値決定手段は、前記画質ヒストグラムに
より画質が最も良好であることを示す評価値に対応する
しきい値を最適しきい値として決定する手段である特許
請求の範囲第6項記載のしきい値決定装置。
7. The third information generating means, for the multi-valued image, uses information generated by the first and second information generating means to calculate each level of brightness and an evaluation value of image quality. The optimum threshold value determining means determines a threshold value corresponding to an evaluation value indicating that the image quality is the best from the image quality histogram as an optimum threshold value. 7. The threshold value determination device according to claim 6, wherein the threshold value determination device is means for performing the threshold value determination.
JP62208849A 1987-08-22 1987-08-22 Multi-value image evaluation device and threshold value determination device using the device Expired - Lifetime JP2646569B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62208849A JP2646569B2 (en) 1987-08-22 1987-08-22 Multi-value image evaluation device and threshold value determination device using the device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62208849A JP2646569B2 (en) 1987-08-22 1987-08-22 Multi-value image evaluation device and threshold value determination device using the device

Publications (2)

Publication Number Publication Date
JPS6451586A JPS6451586A (en) 1989-02-27
JP2646569B2 true JP2646569B2 (en) 1997-08-27

Family

ID=16563124

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62208849A Expired - Lifetime JP2646569B2 (en) 1987-08-22 1987-08-22 Multi-value image evaluation device and threshold value determination device using the device

Country Status (1)

Country Link
JP (1) JP2646569B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04227581A (en) * 1990-06-08 1992-08-17 Omron Corp Binarizing-threshold calculation device for image
JP4771887B2 (en) * 2006-08-09 2011-09-14 ▲うぇ▼▲ちん▼科技股▲ふん▼有限公司 Passive and interactive immediate image recognition methods
JP2010219858A (en) * 2009-03-17 2010-09-30 Seiko Epson Corp Noise component removing device, and medium having noise component removing program recorded thereon

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS58163075A (en) * 1982-03-20 1983-09-27 Toshiyuki Sakai Picture quality deciding method of binary linear graphic picture
JPS61225976A (en) * 1985-03-30 1986-10-07 Toshiba Corp Binary-coding system for picture signal

Also Published As

Publication number Publication date
JPS6451586A (en) 1989-02-27

Similar Documents

Publication Publication Date Title
Chen et al. An approach to boundary detection for 3D point clouds based on DBSCAN clustering
Rosenfeld Computer vision: basic principles
CN114418957A (en) Global and local binary pattern image crack segmentation method based on robot vision
Nedzved et al. Morphological segmentation of histology cell images
JP2686274B2 (en) Cell image processing method and apparatus
CN101084527B (en) method and system for processing video data
US8983199B2 (en) Apparatus and method for generating image feature data
US20050139782A1 (en) Face image detecting method, face image detecting system and face image detecting program
JPH0693250B2 (en) Character information extraction method for optical reader
JP2646569B2 (en) Multi-value image evaluation device and threshold value determination device using the device
JPS61141087A (en) Image processing method and device
CN111311696B (en) License plate authenticity detection method based on hyperspectral unmixing technology
JP2002174603A (en) Defect classifying method
JPH10285399A (en) Image binarization method
CN116596921A (en) A method and system for sorting incinerator slag
CN116452503A (en) Method and device for identifying probe and electronic equipment
Wang et al. Image analysis and segmentation using gray connected components
JP3113785B2 (en) Image classification device
CN114742850A (en) UGNX model analysis-based electrode shape automatic identification implementation method
JP2628863B2 (en) Visual recognition device
CN119273678B (en) Visual high-precision detection method and detection device for transport semitrailer axle
JPH06261210A (en) Threshold determining method
JPH03237571A (en) Device for calculating binarizing threshold of image
JP3091356B2 (en) Moving object detection method and apparatus
JP3947581B2 (en) Image processing device