JP2596613B2 - Threshold value determination device - Google Patents

Threshold value determination device

Info

Publication number
JP2596613B2
JP2596613B2 JP1204115A JP20411589A JP2596613B2 JP 2596613 B2 JP2596613 B2 JP 2596613B2 JP 1204115 A JP1204115 A JP 1204115A JP 20411589 A JP20411589 A JP 20411589A JP 2596613 B2 JP2596613 B2 JP 2596613B2
Authority
JP
Japan
Prior art keywords
density
pixel
threshold value
value
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP1204115A
Other languages
Japanese (ja)
Other versions
JPH0368084A (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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP1204115A priority Critical patent/JP2596613B2/en
Publication of JPH0368084A publication Critical patent/JPH0368084A/en
Application granted granted Critical
Publication of JP2596613B2 publication Critical patent/JP2596613B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)

Description

【発明の詳細な説明】 [産業上の利用分野] この発明は、画像内の対象物を背景から分離するため
の代表的な処理である2値化処理に際して、濃淡画像を
2値化するときの最適しきい値を決定する装置に関する
ものである。
DETAILED DESCRIPTION OF THE INVENTION [Industrial Application Field] The present invention relates to a method of binarizing a grayscale image in a binarization process which is a typical process for separating an object in an image from a background. And an apparatus for determining an optimum threshold value.

[従来の技術] 従来、この種のしきい値の決定に関しては、濃度ヒス
トグラムに基づく方法が一般的であった。しかし、この
方法によれば、対象が小さい画像や低コントラストな画
像などに対して適切なしきい値が決定できないという問
題がある為、しきい値を変えながら2値化したときの各
2値画像から計測した特徴量をもとに、2値化結果の良
否を表わす評価関数を算出した後、しきい値に対する評
価関数の変化状態から判断して最適なしきい値を決定す
る方法によるものが、本発明者により既に提案されてい
る(特願平1−121719号,平成1年5月16日出願)。
[Related Art] Conventionally, a method based on a density histogram has been generally used for determining such a threshold value. However, according to this method, there is a problem that an appropriate threshold value cannot be determined for an image having a small object or an image having a low contrast. After calculating an evaluation function indicating the quality of the binarization result based on the feature amount measured from the above, a method of determining an optimum threshold value by judging from a change state of the evaluation function with respect to the threshold value, It has already been proposed by the present inventors (Japanese Patent Application No. 1-121719, filed on May 16, 1999).

本発明はこれの改良に関するものであるので、先ず、
前記の先願発明の構成について説明する。例えば、しき
い値Tを変えながら2値化したときの各2値画像から、
特徴量として、隣接数(2値画像のある点が‘1'である
とき、その8近傍でこの点に隣接している‘1'の点の
数)の総和A(T)と‘1'の点の総数,すなわち面積S
(T)を求め、評価関数として、R(T)=A(T)/S
(T)で定義される平均隣接数を算出し、これを用いて
最適なしきい値を決定するものは、例えば第5図のよう
な構成で実現できる。
Since the present invention relates to the improvement of this, first,
The configuration of the above-mentioned prior application invention will be described. For example, from each binary image when binarized while changing the threshold T,
As the feature quantity, the sum A (T) of adjacent numbers (the number of '1' points adjacent to this point in the vicinity of 8 when a certain point in the binary image is '1') and '1' The total number of points, ie the area S
(T) is obtained, and as an evaluation function, R (T) = A (T) / S
The calculation of the average number of neighbors defined by (T) and the determination of the optimum threshold value using the calculated number can be realized, for example, by the configuration shown in FIG.

図において、(6)はそれぞれのしきい値Tに対して
濃淡画像を2値画像に変換するしきい値処理部、(7)
は上記しきい値処理部(6)の出力である2値画像から
前記隣接数の総和A(T)と面積S(T)を計測する特
徴抽出部、(5)は上記特徴抽出部(7)から得られた
特徴量A(T)とS(T)をもとに,評価関数である平
均隣接数R(T)を算出し、しきい値Tに対する平均隣
接数R(T)の変化状態から判断して、最適なしきい値
を決定するしきい値決定部である。
In the figure, (6) is a threshold value processing unit for converting a grayscale image into a binary image for each threshold value T, (7)
Is a feature extraction unit that measures the sum A (T) and area S (T) of the number of neighbors from the binary image output from the threshold processing unit (6), and (5) is a feature extraction unit (7). ), The average number of neighbors R (T), which is an evaluation function, is calculated based on the feature amounts A (T) and S (T) obtained from This is a threshold value determining unit that determines an optimal threshold value based on the state.

次に動作について説明する。 Next, the operation will be described.

先ず、変化させるしきい値の下限値T1,上限値T2を定
める。通常は、濃淡画像の濃度の最小値と最大値をそれ
ぞれT1,T2とすればよい。そして、区間[T1,T2]にお
いて、しきい値Tを変えながら以下の(I),(II)の
処理を行なった後、(III)で最適しきい値を決定す
る。
First, the lower limit value T 1 and the upper limit value T 2 of the threshold to be changed are determined. Normally, the minimum and maximum values of the density of the grayscale image may be set to T 1 and T 2 , respectively. Then, in the section [T 1 , T 2 ], the following processes (I) and (II) are performed while changing the threshold T, and then the optimum threshold is determined in (III).

(I)しきい値処理部(6)では、それぞれのしきい値
Tに対して濃淡画像を2値化し、‘0'または‘1'の値を
もつ点から成る2値画像を得る。
(I) The threshold value processing section (6) binarizes the grayscale image with respect to each threshold value T to obtain a binary image including points having a value of '0' or '1'.

(II)特徴抽出部(7)では、しきい値処理部(6)の
出力結果である2値画像から、隣接数の総和A(T)
と、面積S(T)を求める。いま、隣接数がiである
‘1'の点の個数をai(T),(i=0,…,8)とすると、
A(T)及びS (T)は次のように表わされる。
(II) The feature extraction unit (7) calculates the sum A (T) of the number of neighbors from the binary image which is the output result of the threshold processing unit (6).
And the area S (T). Now, assuming that the number of points of '1' where the number of neighbors is i is a i (T), (i = 0,..., 8),
A (T) and S (T) are represented as follows.

(III)しきい値決定部(5)では、特徴抽出部(7)
で求められた隣接数の総和A(T)と面積S(T)をも
とに、R(T)=A(T)/S(T)で定義される平均隣
接数を算出する。
(III) In the threshold value determining section (5), the feature extracting section (7)
The average number of neighbors defined by R (T) = A (T) / S (T) is calculated based on the sum A (T) of the number of neighbors and the area S (T) obtained in the above.

最適なしきい値とは、2値画像上の対象領域(‘1'の
連結成分)が「まとまった(ぎざぎざしていない)」領
域として抽出されるしきい値であると考えられ、平均隣
接数R(T)は領域のまとまりの良さを表わす評価関数
になっている。すなわち、領域のまとまりが良いこと
は、内部点の比率が高く、境界点の比率が低いことであ
ると考えられる。第6図に示すように、内部点では隣接
数は8であり、境界点では、その近傍の形状に応じて隣
接数は0〜7の値をとるので、内部点の比率が高い(領
域のまとまりが良い)ほど、平均隣接数は高い値を示す
ことになる。一般に、画像中の対象及び背景が第7図の
ような濃度分布をもつ場合、しきい値Tに対する平均隣
接数R(T)の変化は第8図のようになるので、平均隣
接数が極大となるしきい値を最適しきい値として決定す
る。
The optimum threshold value is considered to be a threshold value at which the target area (connected component of '1') on the binary image is extracted as a “coarse (not jagged)” area, and the average number of neighbors is considered. R (T) is an evaluation function that indicates the goodness of unity of the area. In other words, it is considered that the goodness of the unity of the area means that the ratio of the internal points is high and the ratio of the boundary points is low. As shown in FIG. 6, the number of neighbors at the interior point is 8, and at the boundary point, the number of neighbors takes a value of 0 to 7 according to the shape of the neighborhood, so that the ratio of the interior points is high (the The better the unity, the higher the average number of neighbors. In general, when the object and the background in the image have a density distribution as shown in FIG. 7, the change in the average number of neighbors R (T) with respect to the threshold value T is as shown in FIG. Is determined as the optimum threshold.

[発明が解決しようとする課題] 従来装置は以上のように構成されているので、変化さ
せる全てのしきい値に対して、実際に2値化して特徴量
(隣接数の総和と面積)を計測しなければならないた
め、変化させるしきい値の数に比例した処理時間が必要
となる。また、リアルタイム処理等の要求により処置時
間を短縮するためには、変化させるしきい値の数(例え
ば256段階で表現された濃淡画像では最悪256個)の同一
回路を並列に配置する必要があり、回路が大規模になる
などの問題点があった。
[Problem to be Solved by the Invention] Since the conventional device is configured as described above, for all the threshold values to be changed, the threshold value is actually binarized and the feature amount (sum and area of the number of neighbors) is calculated. Since the measurement has to be performed, a processing time proportional to the number of thresholds to be changed is required. Further, in order to reduce the treatment time due to a request for real-time processing or the like, it is necessary to arrange in parallel the same number of threshold values to be changed (for example, the worst 256 in a gray scale image expressed in 256 levels). However, there is a problem that the circuit becomes large-scale.

この発明は上記のような問題点を解決するためになさ
れたもので、変化させるしきい値の数に依存しない処理
量で、実際に2値化しなくても、しきい値決定のための
特徴量が計測できる装置を得ることを目的とする。
SUMMARY OF THE INVENTION The present invention has been made to solve the above problems, and has a processing amount independent of the number of threshold values to be changed. The aim is to obtain a device that can measure quantities.

[課題を解決するための手段] この発明に係るしきい値決定装置は、濃淡画像中の注
目点の画素濃度、および当該注目点を中心画素としてこ
の中心画素に隣接する8つの近傍画素の濃度を抽出する
局所データ抽出部(1)と、前記中心画素に隣接する8
つの近傍画素の濃度の順位1〜8を大きい順に決定し、
かつ前記中心画素に対しては順位0を付与する順位付け
部(2)と、前記順位付け部において決定された各順位
の画素の濃度と前記中心画素の濃度とを比較して小さい
方の濃度値を出力する最小値選択部(3)と、前記濃淡
画像のすべての注目点について、前記最小値選択部の前
記各順位毎の出力値から画素濃度を変数とするヒストグ
ラムを作成するヒストグラム計数部(4)と、前記順位
0のヒストグラムの特定画素濃度T以上の総和から、画
素濃度がT以上である前記中心画素の数の総和S(T)
を求めるとともに、前記順位が1から8までの各ヒスト
グラムの特定画素濃度T以上の総和から、画素濃度がT
以上である中心画素に対応した近傍画素のうち画素濃度
がT以上である近傍画素の数の総和A(T)を求めて、
前記A(T)を前記S(T)で除算することにより、前
記濃淡画像を画素濃度Tで2値化した時の2値濃度が
‘1'である中心画素に対応した近傍画素のうち2値濃度
が‘1'である画素の数,すなわち隣接数の平均値R
(T)を求め、この平均隣接数R(T)の濃度Tに対す
る変化状態に基づいて2値画像化のしきい値を決定する
しきい値決定部(5)とを備えたものである。
[Means for Solving the Problems] A threshold value determining apparatus according to the present invention provides a pixel density of a point of interest in a grayscale image, and densities of eight neighboring pixels adjacent to the center pixel with the point of interest as a center pixel. And a local data extraction unit (1) for extracting
The order of density 1 to 8 of two neighboring pixels is determined in descending order,
A ranking unit (2) for assigning a rank 0 to the center pixel; and a smaller density obtained by comparing the density of the pixel of each rank determined by the ranking unit with the density of the center pixel. A minimum value selecting unit (3) for outputting a value, and a histogram counting unit for generating a histogram using a pixel density as a variable from the output value of each rank of the minimum value selecting unit for all points of interest in the grayscale image. (4) and the sum S (T) of the number of the central pixels having a pixel density of T or more from the total sum of the specific pixel density T or more of the histogram of the rank 0.
From the sum of the specific pixel densities T or more of the histograms having the ranks 1 to 8, the pixel density T
The sum A (T) of the number of neighboring pixels having a pixel density of T or more among the neighboring pixels corresponding to the central pixel described above is obtained,
By dividing the A (T) by the S (T), two of the neighboring pixels corresponding to the center pixel whose binary density is “1” when the grayscale image is binarized by the pixel density T The number of pixels whose value density is '1', that is, the average value R of the number of neighbors
(T), and a threshold value determining unit (5) for determining a threshold value for binary imaging based on a change state of the average number of adjacent pixels R (T) with respect to the density T.

[作用] この発明において、まず、局所データ抽出部(1)で
は、濃淡画像中の注目点の画素濃度、および当該注目点
を中心画素としてこの中心画素に隣接する8つの近傍画
素の濃度が抽出される。そして、順位付け部(2)で
は、前記中心画素に隣接する8つの近傍画素について濃
度の順位1〜8を大きい順に付与され、かつ前記中心画
素に対しては順位0が付与される。最小値選択部(3)
は、各順位の画素の濃度と前記中心画素の濃度とを比較
して小さい方の濃度値を出力する。ヒストグラム計数部
(4)は、前記濃淡画像のすべての注目点について、前
記最小値選択部の前記各順位毎の出力値から画素濃度を
変数とするヒストグラムを作成する。
[Operation] In the present invention, first, the local data extraction unit (1) extracts the pixel density of a point of interest in a grayscale image and the density of eight neighboring pixels adjacent to the center pixel using the point of interest as a center pixel. Is done. Then, the ranking section (2) assigns the order of density 1 to 8 in descending order to the eight neighboring pixels adjacent to the center pixel, and assigns the order 0 to the center pixel. Minimum value selector (3)
Compares the density of the pixel of each rank with the density of the central pixel and outputs the smaller density value. A histogram counting unit (4) creates a histogram using a pixel density as a variable from the output value of each rank of the minimum value selecting unit for all the attention points of the grayscale image.

そして、しきい値決定部(5)は、前記順位0のヒス
トグラムの特定画素濃度T以上の総和から、画素濃度が
T以上である前記中心画素の数の総和S(T)を求める
(この総和から、画素濃度がT以上である前記中心画素
の数の総和S(T)を求める(この総和S(T)は面積
に相当する)。また、前記順位が1から8までの各ヒス
トグラムの特定画素濃度T以上の総和から、画素濃度が
T以上である中心画素に対応した近傍画素のうち画素濃
度がT以上である近傍画素の数の総和A(T)を求め
る。さらに、前記A(T)を前記S(T)で除算するこ
とにより、前記濃淡画像を画素濃度Tで2値化した時の
2値濃度が‘1'である中心画素に対応した近傍画素のう
ち2値濃度が‘1'である画素の数,すなわち隣接数の平
均値R(T)を求める。つまり、しきい値決定部(5)
では、特徴量の算出にあたって、中心画素の2値濃度が
‘1'であるもののみに着目する。そして、この平均隣接
数R(T)の濃度Tに対する変化状態に基づいて2値画
像化のしきい値を決定する。
Then, the threshold value determining unit (5) obtains a total sum S (T) of the number of the central pixels having the pixel density of T or more from the total sum of the specific pixel density T or more of the histogram of the rank 0 (this sum). , The sum S (T) of the number of the central pixels having a pixel density equal to or higher than T is obtained (this sum S (T) corresponds to the area), and the histograms having the ranks 1 to 8 are specified. From the sum total of the pixel densities T or more, a total sum A (T) of the number of neighboring pixels whose pixel density is T or more among the neighboring pixels corresponding to the central pixel whose pixel density is T or more is obtained. ) Is divided by the above S (T), so that the binary density of the neighboring pixels corresponding to the central pixel whose binary density is “1” when the grayscale image is binarized by the pixel density T is “1”. The number of 1 'pixels, that is, the average value R (T) of the number of adjacent pixels is obtained. Ri, the threshold decision unit (5)
In the calculation of the feature amount, attention will be paid only to the case where the binary density of the central pixel is “1”. Then, a threshold value for binary imaging is determined based on the state of change of the average adjacent number R (T) with respect to the density T.

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

第1図は実施例の全体構成を示すブロック図であり、
図において、(1)は濃淡画像から注目点の濃度G0と,
その8近傍の点の濃度G1,…,G8を抽出する局所データ
抽出部、(2)は順位信号jが0のとき,注目点の濃度
G0を出力Z0とし、順位信号jが1〜8のとき、8近傍の
点の濃度G1,…,G8のうち大きい方からj番目の値を出
力Zj(j=1,…,8)とする順位付け部、(3)は順位付
け部(2)の出力Zj(j=0,…,8)と注目点の濃度G0
を比較し、小さい方の値Fj(j=0,…,8)を出力する最
小値選択部、(4)は最小値選択部(3)の出力である
Fj(j=0,…,8)に対して、その出現頻度を計数するヒ
ストグラム計数部、(5)はヒストグラム計数部(4)
よりFj(j=0,…,8)に対して得られる9種類のヒスト
グラムから、しきい値Tで2値化したときの2値画像に
おける隣接数の総和A(T)及び面積S(T)を求め、
平均隣接数R(T)を算出した後、しきい値Tに対する
平均隣接数R(T)の変化状態から判断して、最適なし
きい値を決定するしきい値決定部である。
FIG. 1 is a block diagram showing the overall configuration of the embodiment.
In the figure, (1) shows the density G 0 of the point of interest from the grayscale image,
The local data extraction unit extracts the densities G 1 ,..., G 8 of the eight neighboring points.
The G 0 and output Z 0, when order signal j is 1-8, concentration G 1 of 8 near points, ..., outputs j-th value from the larger of the G 8 Z j (j = 1, ... , 8), and (3) compares the output Z j (j = 0,..., 8) of the ranking unit (2) with the density G 0 of the target point, and determines the smaller value F j A minimum value selection unit that outputs (j = 0,..., 8), and (4) is an output of the minimum value selection unit (3).
A histogram counter for counting the frequency of occurrence of F j (j = 0,..., 8), and (5) a histogram counter (4)
From the nine types of histograms obtained for F j (j = 0,..., 8), the total sum A (T) of the number of adjacent pixels and the area S ( T)
After calculating the average number of neighbors R (T), the threshold value determination unit determines an optimum threshold value by judging from a change state of the average number of neighbors R (T) with respect to the threshold value T.

次に動作について説明する。 Next, the operation will be described.

先ず、局所データ抽出部(1)は、例えば第2図のよ
うに、9個のラッチ(110)と2個のシフトレジスタ(1
20)とから構成され、信号として入力される濃淡画像
(130)から注目点の濃度G0(140)と,その8近傍の点
の濃度G1(151)〜G8(158)を順次抽出していく。
First, as shown in FIG. 2, for example, the local data extraction unit (1) includes nine latches (110) and two shift registers (1).
20), and sequentially extracts the density G 0 (140) of the point of interest and the density G 1 (151) to G 8 (158) of the eight neighboring points from the grayscale image (130) input as a signal. I will do it.

次に、順位付け部(2)は、例えば第3図に示すよう
に、順位信号j(240)が1〜8のときに8近傍の点の
濃度G1(151)〜G8(158)の中の大きい方からj番目の
値を出力する順位付け回路(210)と、順位信号j(24
0)が0かどうかを判定するゼロ判定回路(220)と、順
位信号j(240)が0のときは注目的の濃度G0(140)
を,順位信号j(240)が1〜8のときは順位付け回路
(210)の出力を選択するセレクタ(230)から構成さ
れ、このセレクタ(230)の出力が順位付け部(2)の
出力Zj(250)となる。
Next, as shown in FIG. 3, for example, as shown in FIG. 3, when the ranking signal j (240) is 1 to 8, the densities G 1 (151) to G 8 (158) of points near 8 are obtained. And a ranking circuit (210) that outputs the j-th value from the larger one, and a ranking signal j (24
(0) is 0, and a zero determination circuit (220). When the rank signal j (240) is 0, the density G 0 (140) of interest.
And a selector (230) for selecting the output of the ranking circuit (210) when the ranking signal j (240) is 1 to 8, and the output of this selector (230) is the output of the ranking unit (2). Z j (250).

次に、最小値選択部(3)は、順位付け部(2)の出
力Zj(j=0,…,8)と、局所データ抽出部(1)から送
られてくる注目点の濃度G0とを比較し、小さい方の値Fj
(j=0,…,8)を出力する。従って、順位信号jを0か
ら8まで変えることによって、最小値選択部(3)から
はFj(j=0,…,8)が出力され、その出現頻度をヒスト
グラム計数部(4)で計数することにより、9種類のヒ
ストグラムが得られることになる。なお、Z0はG0そのも
のであり、F0はZ0とG0の小さい方の値であるから、F0
G0そのものとなる。すなわち、F0に対するヒストグラム
は通常の濃度ヒストグラムである。
Next, the minimum value selecting section (3) outputs the output Z j (j = 0,..., 8) of the ranking section (2) and the density G of the target point sent from the local data extracting section (1). 0 and compare the smaller value F j
(J = 0,..., 8) is output. Therefore, by changing the rank signal j from 0 to 8, F j (j = 0,..., 8) is output from the minimum value selecting unit (3), and its appearance frequency is counted by the histogram counting unit (4). By doing so, nine types of histograms are obtained. Note that Z 0 is G 0 itself, and F 0 is the smaller value of Z 0 and G 0 , so F 0 is also
G 0 itself. That is, a histogram for F 0 is the normal density histogram.

いま、Fj(j=0,…,8)に対するヒストグラム,すな
わちFjが濃度値iをとる頻度を、Hj(i),(i=0,
…,N−1;j=0,…,8)で表わすことにする。ここに、N
は濃淡画像を表わす濃度レベルの数(例えば256)であ
る。すると、FjのヒストグラムHj(i)において、濃度
がしきい値T以上の総数SHj(T)は で表わされる。このSHj(T)は、濃淡画像をしきい値
Tで2値化したときの2値画像において、隣接数がj以
上の注目点の総数を表わしている。なぜなら、Fjは注目
点の8近傍において大きい方からj番目の濃度Zjと注目
点の濃度G0との小さい方の値であるから、注目点はFj
上の濃度値をもち、8近傍においてもFj以上の濃度値を
もつものがj個以上存在することは保証される。従っ
て、Fjをしきい値として2値化すれば、注目点は‘1'
に,8近傍のうちj個以上は‘1'に2値化されるので、こ
の注目点は隣接数がj以上になるわけである。
Now, the histogram for F j (j = 0,..., 8), that is, the frequency at which F j takes the density value i is represented by H j (i), (i = 0,
…, N−1; j = 0,…, 8). Where N
Is the number of density levels (for example, 256) representing a grayscale image. Then, in the histogram H j (i) of F j , the total number SH j (T) whose density is equal to or greater than the threshold value T is Is represented by This SH j (T) represents the total number of points of interest whose adjacent number is j or more in a binary image obtained by binarizing a grayscale image with a threshold value T. This is because, F j is because it is smaller value of the density G 0 of the target point and j th concentration Z j from the largest in 8 near the target point, the point of interest has a density value of more than F j, 8 Even in the vicinity, it is guaranteed that there are j or more objects having a density value equal to or greater than F j . Therefore, if binarization is performed using F j as a threshold, the point of interest is “1”.
In addition, since j or more of the eight neighborhoods are binarized to '1', the number of neighbors in this point of interest is j or more.

このように、SHj(T)が、濃淡画像をしきい値Tで
2値化したときの2値画像において、隣接数がj以上の
注目点の総数を表わしているという性質を用いると、隣
接数がiである注目点の個数をaiとして SH0(T)=a0+a1+a2+a3+a4+a5+a6+a7+a8
(4) SH1(T)=a1+a2+a3+a4+a5+a6+a7+a8 (5) SH2(T)=a2+a3+a4+a5+a6+a7+a8 (6) SH3(T)=a3+a4+a5+a6+a7+a8 (7) SH4(T)=a4+a5+a6+a7+a8 (8) SH5(T)=a5+a6+a7+a8 (9) SH6(T)=a6+a7+a8 (10) SH7(T)=a7+a8 (11) SH8(T)=a8 (12) が成立する。上記(5)〜(12)式の両辺をそれぞれ全
部加えると、 となり、(1)式と(13)式の右辺は同じであるので、 が成立する。
As described above, by using the property that SH j (T) represents the total number of points of interest whose adjacent number is j or more in a binary image obtained by binarizing a grayscale image with a threshold value T, SH 0 (T) = a 0 + a 1 + a 2 + a 3 + a 4 + a 5 + a 6 + a 7 + a 8 , where a i is the number of attention points having the adjacent number i.
(4) SH 1 (T) = a 1 + a 2 + a 3 + a 4 + a 5 + a 6 + a 7 + a 8 (5) SH 2 (T) = a 2 + a 3 + a 4 + a 5 + a 6 + a 7 + a 8 (6 ) SH 3 (T) = a 3 + a 4 + a 5 + a 6 + a 7 + a 8 (7) SH 4 (T) = a 4 + a 5 + a 6 + a 7 + a 8 (8) SH 5 (T) = a 5 + a 6 + a 7 + a 8 ( 9) SH 6 (T) = a 6 + a 7 + a 8 (10) SH 7 (T) = a 7 + a 8 (11) SH 8 (T) = a 8 (12) is satisfied . When both sides of the above equations (5) to (12) are all added, And the right-hand sides of Equations (1) and (13) are the same. Holds.

また、(2)式と(4)式の右辺も同じであるので、 S(T)=SH0(T) (15) が成立する。つまり、隣接数の総和A(T)及び面積S
(T)は、FjのヒストグラムHj(i)から得られること
がわかる。
In addition, since the right side of the equations (2) and (4) is the same, S (T) = SH 0 (T) (15) holds. That is, the sum A (T) of the adjacent numbers and the area S
It can be seen that (T) is obtained from the histogram H j (i) of F j .

しきい値決定部(5)では、ヒストグラム計数部
(4)から得られる9種類のヒストグラムHj(i),
(i=0,…,N−1;J=O,…,8)をもとに、しきい値Tを
変えながら(14),(15)式によりA(T),S(T)を
求め、平均隣接数R(T)=A(T)/S(T)を算出す
る。その後、しきい値Tに対する平均隣接数R(T)の
変化状態から判断して、最適なしきい値を決定する。
In the threshold value determining unit (5), nine types of histograms H j (i), obtained from the histogram counting unit (4),
Based on (i = 0,..., N−1; J = O,..., 8), A (T) and S (T) are calculated by equations (14) and (15) while changing the threshold T. Then, the average adjacent number R (T) = A (T) / S (T) is calculated. Thereafter, an optimum threshold value is determined by judging from the state of change of the average number of neighbors R (T) with respect to the threshold value T.

なお、上記実施例では、Fj(j=0,…,8)のヒストグ
ラムを順位信号jを0から8まで変えながら計数する場
合について説明したが、第4図に示すように、順位付け
部(2),最小値選択部(3)及びヒストグラム計数部
(4)から成る点線で囲まれた部分を9個並列に配置
し、各順位付け部(2)に0〜8の順位信号をそれぞれ
与えることによって、Fj(j=0,…,8)に対する9種類
のヒストグラムが同時に得られるようにすることもでき
る。このように、変化させるしきい値の数Nだけの並列
回路を必要とせず、N》9のとき,小規模な回路で、リ
アルタイム処理が容易に実現できる。
In the above embodiment, the case where the histogram of F j (j = 0,..., 8) is counted while changing the rank signal j from 0 to 8 has been described. However, as shown in FIG. (2) Nine parts surrounded by a dotted line consisting of a minimum value selecting unit (3) and a histogram counting unit (4) are arranged in parallel, and the ranking signals (0) to (8) are assigned to each ranking unit (2). By giving, nine types of histograms for F j (j = 0,..., 8) can be obtained simultaneously. In this way, it is not necessary to provide parallel circuits of the number N of threshold values to be changed, and when N >> 9, real-time processing can be easily realized with a small-scale circuit.

[発明の効果] 以上のように、この発明によれば、抽出部により濃淡
画面から抽出された3×3領域の濃度値に対して、順位
付け部と選択部において0〜8までの順位付けされた値
を出力し、その出現頻度を計数部により計数して得られ
る9種類のヒストグラムから隣接数の総和A(T)と面
積S(T)を求めて平均隣接数R(T)を算出するよう
にしたので、従来例で、変化させる全てのしきい値に対
して実際に2値化して,隣接数の総和A(T)と面積S
(T)を求める場合のように、変化させるしきい値の数
(例えば256段階)に比例した処理時間を必要とせず、
順位信号を0から8まで変えたときの9種類のヒストグ
ラムを得るための9回分の演算で済み、処理時間が大幅
に短縮できる効果がある。
[Effects of the Invention] As described above, according to the present invention, the ranking unit and the selection unit rank 0 to 8 the density values of the 3 × 3 area extracted from the grayscale screen by the extraction unit. The calculated value is output, and the appearance frequency is counted by the counting unit, and the total number A of adjacent numbers A (T) and the area S (T) are obtained from nine types of histograms to calculate the average number of adjacent numbers R (T). Therefore, in the conventional example, all the threshold values to be changed are actually binarized, and the total number A (T) of the number of neighbors and the area S
As in the case of calculating (T), processing time proportional to the number of thresholds to be changed (for example, 256 steps) is not required,
Nine calculations for obtaining nine types of histograms when the rank signal is changed from 0 to 8 are sufficient, and the processing time is greatly reduced.

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

第1図はこの発明の一実施例の全体構成を示すブロック
図、第2図は実施例における局所データ抽出部を示す詳
細構成図、第3図は実施例における順位付け部を示す詳
細構成図、第4図はこの発明の他の実施例を示すブロッ
ク構成図、第5図は従来例を示すブロック構成図、第6
図は隣接数の説明図、第7図,第8図はしきい値に対す
る平均隣接数の変化の様子を示す説明図である。 (1)は局所データ抽出部、(2)は順位付け部、
(3)は最小値選択部、(4)はヒストグラム計数部、
(5)はしきい値決定部。 なお、図中、同一符号は同一、又は相当部分を示す。
FIG. 1 is a block diagram showing an entire configuration of an embodiment of the present invention, FIG. 2 is a detailed configuration diagram showing a local data extracting unit in the embodiment, and FIG. 3 is a detailed configuration diagram showing a ranking unit in the embodiment. FIG. 4 is a block diagram showing another embodiment of the present invention, FIG. 5 is a block diagram showing a conventional example, and FIG.
FIG. 7 is an explanatory diagram of the number of neighbors, and FIGS. 7 and 8 are explanatory diagrams showing how the average number of neighbors changes with respect to the threshold value. (1) is a local data extraction unit, (2) is a ranking unit,
(3) is a minimum value selector, (4) is a histogram counter,
(5) is a threshold value determination unit. In the drawings, the same reference numerals indicate the same or corresponding parts.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】濃淡画像を2値画像化するためのしきい値
を決定するしきい値決定装置において、 濃淡画像中の注目点の画素濃度、および当該注目点を中
心画素としてこの中心画素に隣接する8つの近傍画素の
濃度を抽出する局所データ抽出部と、 前記中心画素に隣接する8つの近傍画素の濃度の順位1
〜8を大きい順に決定し、かつ前記中心画素に対しては
順位0を付与する順位付け部と、 前記順位付け部において決定された各順位の画素の濃度
と前記中心画素の濃度とを比較して小さい方の濃度値を
出力する最小値選択部と、 前記濃淡画像のすべての注目点について、前記最小値選
択部の前記各順位毎の出力値から画素濃度を変数とする
ヒストグラムを作成するヒストグラム計数部と、 前記順位0のヒストグラムの特定画素濃度T以上の総和
から、画素濃度がT以上である前記中心画素の数の総和
S(T)を求めるとともに、前記順位が1から8までの
各ヒストグラムの特定画素濃度T以上の総和から、画素
濃度がT以上である中心画素に対応した近傍画素のうち
画素濃度がT以上である近傍画素の数の総和A(T)を
求めて、前記A(T)を前記S(T)で除算することに
より、前記濃淡画像を画素濃度Tで2値化した時の2値
濃度が‘1'である中心画素に対応した近傍画素のうち2
値濃度が‘1'である画素の数,すなわち隣接数の平均値
R(T)を求め、この平均隣接数R(T)の濃度Tに対
する変化状態に基づいて2値画像化のしきい値を決定す
るしきい値決定部とを備えたことを特徴とするしきい値
決定装置。
1. A threshold value determining apparatus for determining a threshold value for converting a grayscale image into a binary image, comprising: a pixel density of a point of interest in the grayscale image; A local data extraction unit for extracting the density of eight neighboring pixels adjacent to each other, and a first rank of the density of eight neighboring pixels adjacent to the central pixel.
8 is determined in descending order, and a ranking unit that assigns rank 0 to the center pixel, and compares the density of the pixel of each rank determined by the ranking unit with the density of the center pixel. A minimum value selection unit that outputs a smaller density value, and a histogram that creates a histogram using a pixel density as a variable from the output value of each rank of the minimum value selection unit for all points of interest in the grayscale image. A counting unit for calculating a total sum S (T) of the number of the central pixels having a pixel density of T or more from a total sum of the specific pixel density T or more of the histogram of the rank 0, and From the sum total of the specific pixel densities T or more in the histogram, the sum A (T) of the number of neighboring pixels whose pixel densities are T or more among the neighboring pixels corresponding to the central pixel whose pixel density is T or more is calculated. ( ) Is divided by the S (T), 2 of the neighboring pixels are binary density corresponding to the center pixel is "1" when binarizing the grayscale image at a pixel density T
The number of pixels whose value density is “1”, that is, the average value R (T) of the number of neighbors is obtained, and the threshold value for binary imaging is determined based on the change state of the average number of neighbors R (T) with respect to the density T. A threshold value determining unit for determining the threshold value.
JP1204115A 1989-08-07 1989-08-07 Threshold value determination device Expired - Fee Related JP2596613B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1204115A JP2596613B2 (en) 1989-08-07 1989-08-07 Threshold value determination device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1204115A JP2596613B2 (en) 1989-08-07 1989-08-07 Threshold value determination device

Publications (2)

Publication Number Publication Date
JPH0368084A JPH0368084A (en) 1991-03-25
JP2596613B2 true JP2596613B2 (en) 1997-04-02

Family

ID=16485063

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1204115A Expired - Fee Related JP2596613B2 (en) 1989-08-07 1989-08-07 Threshold value determination device

Country Status (1)

Country Link
JP (1) JP2596613B2 (en)

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH087785B2 (en) * 1989-05-16 1996-01-29 松下電器産業株式会社 Binarization processor

Also Published As

Publication number Publication date
JPH0368084A (en) 1991-03-25

Similar Documents

Publication Publication Date Title
US5157740A (en) Method for background suppression in an image data processing system
US5668898A (en) Device for detecting the inclination of image
NL8105256A (en) DEVICE FOR DYNAMICALLY ADJUSTING A BLACK / WHITE DISCRIMINATION THRESHOLD WHEN PROCESSING IMAGES WITH GRAYNESS VALUES.
EP0712093A2 (en) Image processing apparatus
JPH0693250B2 (en) Character information extraction method for optical reader
US5278919A (en) Image area determining apparatus
TWI591545B (en) Fingerprint image detecting device and method thereof
JPS59192944A (en) Classifying method of pattern defect
US6668070B2 (en) Image processing device, image processing method, and storage medium
JP2596613B2 (en) Threshold value determination device
JP2840347B2 (en) Board mounting inspection equipment
JP2761285B2 (en) Threshold value determination device
JP2843185B2 (en) Threshold value determination method and device
JPH0620054A (en) Method and apparatus for decision of pattern data
JPH06261210A (en) Threshold determining method
JPH10269352A (en) Image processor and method
JP2646569B2 (en) Multi-value image evaluation device and threshold value determination device using the device
JP3150778B2 (en) Threshold determination device
JP4299908B2 (en) Object boundary determination method and apparatus
JP3091356B2 (en) Moving object detection method and apparatus
JPH08251405A (en) Device for discriminating attribute of image area
JPH1163936A (en) Grain diameter measuring equipment
JP2709301B2 (en) Striation light extraction circuit
JPH08161484A (en) Binarization circuit
JPH1070652A (en) Image area attribute discrimination device

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees