JP3150778B2 - Threshold determination device - Google Patents

Threshold determination device

Info

Publication number
JP3150778B2
JP3150778B2 JP24716792A JP24716792A JP3150778B2 JP 3150778 B2 JP3150778 B2 JP 3150778B2 JP 24716792 A JP24716792 A JP 24716792A JP 24716792 A JP24716792 A JP 24716792A JP 3150778 B2 JP3150778 B2 JP 3150778B2
Authority
JP
Japan
Prior art keywords
threshold
pixels
value
density
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
JP24716792A
Other languages
Japanese (ja)
Other versions
JPH0678153A (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 JP24716792A priority Critical patent/JP3150778B2/en
Publication of JPH0678153A publication Critical patent/JPH0678153A/en
Application granted granted Critical
Publication of JP3150778B2 publication Critical patent/JP3150778B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

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

【0001】[0001]

【産業上の利用分野】この発明は、画像中の対象物体を
背景から分離するための代表的な処理である2値化処理
に際して、濃淡画像を2値化するときの最適な閾値を決
定する閾値決定装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention determines an optimal threshold value for binarizing a grayscale image in a binarization process which is a typical process for separating a target object in an image from a background. The present invention relates to a threshold value determining device.

【0002】[0002]

【従来の技術】図25は従来の閾値決定装置を示す構成
図であり、図において、1は濃淡画像、2は濃淡画像1
における各濃度の出現頻度をカウントするヒストグラム
処理部、3はヒストグラム処理部2の処理結果に基づい
て閾値を決定する閾値決定処理部、4はヒストグラム処
理部2及び閾値決定処理部3から構成された閾値決定装
置、5は閾値決定装置4により決定された閾値に基づい
て濃淡画像を2値化処理し、2値化画像を得る2値化処
理部である。
2. Description of the Related Art FIG. 25 is a block diagram showing a conventional threshold value determining apparatus. In FIG.
The histogram processing unit 3 counts the frequency of appearance of each density in. The threshold processing unit 3 determines a threshold value based on the processing result of the histogram processing unit 2, and the histogram processing unit 4 includes the histogram processing unit 2 and the threshold determination processing unit 3. The threshold value determination devices 5 and 5 are binarization processing units that binarize the grayscale image based on the threshold value determined by the threshold value determination device 4 to obtain a binary image.

【0003】次に動作について説明する。例えば、諧調
数m(値0からm−1の値を持つ)の濃淡画像1が、ヒ
ストグラム処理部2に入力されると、各濃度値t毎に、
当該濃度を有する画素の数がカウントされ、各濃度毎の
出現頻度Htが求められる。
Next, the operation will be described. For example, when a grayscale image 1 having the number of gradations m (having a value of 0 to m-1) is input to the histogram processing unit 2, for each density value t,
The number of pixels having the density is counted, and the appearance frequency Ht for each density is obtained.

【0004】次に、閾値決定処理部3では、例えば、P
タイル法、モード法、判別分析法等の手段を用いて閾値
が決定される。まず、Pタイル法では、濃度ヒストグラ
ムの濃度の大きい方からの累積度数Ptが、予め設定さ
れている値Pパーセント以上となる濃度レベルを閾値と
して決定する。
Next, in the threshold value determination processing section 3, for example, P
The threshold value is determined using a means such as a tile method, a mode method, and a discriminant analysis method. First, in the P tile method, a density level at which the cumulative frequency Pt from the higher density of the density histogram is equal to or greater than a preset value P percent is determined as a threshold value.

【0005】[0005]

【数1】 (Equation 1)

【0006】モード法では、濃度ヒストグラムの形状が
双方性を示すことを前提として、2つの山の間の谷部分
を見つけ、この濃度を閾値として決定する。また、判別
分析法では、濃度ヒストグラムをある濃度で2分割した
場合、2つに分けられた濃度ヒストグラムのクラス間の
分散が最大となる濃度を閾値として決定する。
In the mode method, on the premise that the shape of the density histogram indicates bilaterality, a valley between two peaks is found, and this density is determined as a threshold. Further, in the discriminant analysis method, when the density histogram is divided into two by a certain density, the density at which the variance between the classes of the density histogram divided into two is the maximum is determined as the threshold value.

【0007】以上のような方法で求めた閾値tを用い
て、2値化処理部5が、濃淡画像1に対して、閾値t以
上の濃度を有する画素を1に、そうでない画素を0にす
る処理を行い、2値画像を得る。
Using the threshold value t obtained by the above-described method, the binarization processing unit 5 sets a pixel having a density equal to or greater than the threshold value t to 1 and a pixel not having the density to 0 in the grayscale image 1. To obtain a binary image.

【0008】[0008]

【発明が解決しようとする課題】従来の閾値決定装置は
以上のように構成されているので、Pタイル法を用いた
場合、濃淡画像内での対象物体の占める割合を予め分か
っている必要があり、モード法を用いた場合、濃度ヒス
トグラムが滑らかでないときや谷部分が顕著でないとき
には閾値の決定が困難であり、判別分析法を用いた場
合、画像内に占める対象物体と背景の割合が極端に異な
るときや対象物体と背景の濃度差が小さいときには適切
な閾値を決定できないなどの問題点があった。また、い
ずれを用いても、対象物体が存在しない画像に対して求
めた閾値は、対象物体が存在しないと判断した上で求め
た閾値でないため、意味のない値となるなどの問題点が
あった。
Since the conventional threshold value determining apparatus is configured as described above, when the P tile method is used, it is necessary to know in advance the ratio of the target object in the grayscale image. In the case of using the mode method, it is difficult to determine the threshold value when the density histogram is not smooth or the valley portion is not conspicuous, and when the discriminant analysis method is used, the ratio of the target object and the background in the image is extremely large. However, when the difference is different or when the density difference between the target object and the background is small, an appropriate threshold cannot be determined. Also, no matter which method is used, the threshold value obtained for an image in which the target object does not exist is not meaningful because it is not the threshold value obtained after determining that the target object does not exist. Was.

【0009】この発明は上記のような問題点を解消する
ためになされたもので、画像内に占める対象物体と背景
の割合が極端に異なる等の条件が厳しい場合や対象物体
が存在しない場合でも、最適な閾値を決定できる閾値決
定装置を得ることを目的とする。
The present invention has been made in order to solve the above-mentioned problems, and can be applied to a case where conditions such as an extremely different ratio of a target object and a background in an image are severe or a case where no target object exists. It is an object of the present invention to obtain a threshold value determining device capable of determining an optimum threshold value.

【0010】[0010]

【課題を解決するための手段】請求項1の発明に係る閾
値決定装置は、各閾値毎に、第の計数部により計数さ
れた画素数に対して第の計数部により計数された画素
数の割合を演算し、その割合が閾値の変化によって極大
値となる値があれば、割合が極大値になるときの閾値を
最適な閾値として選定し、極大値となる値がなければ、
割合が零になるときの閾値を最適な閾値として選定する
ようにしたものである。
According to a first aspect of the present invention, there is provided a threshold value determining apparatus for each threshold value, wherein the number of pixels counted by the first counting section is compared with the number of pixels counted by the second counting section. Calculate the ratio of the number, if there is a value whose ratio becomes a local maximum due to the change of the threshold, select the threshold when the ratio becomes the local maximum as the optimal threshold, and if there is no value that becomes the local maximum,
The threshold at which the ratio becomes zero is selected as the optimum threshold.

【0011】また、請求項2の発明に係る閾値決定装置
は、対象物体の画素の数の最大値及び最小値を設定する
設定部を設け、第1の計数部により計数された画素数
が、該設定部により設定された最小値より大きく、か
つ、最大値より小さい場合に限り、演算部により演算さ
れた画素数の割合が閾値の変化によって極大値となる値
があれば、割合が極大値になるときの閾値を最適な閾値
として選定し、極大値となる値がなければ、割合が零に
なるときの閾値を最適な閾値として選定するようにした
ものである。
Further, the threshold value determining apparatus according to the second aspect of the present invention further comprises a setting unit for setting a maximum value and a minimum value of the number of pixels of the target object, wherein the number of pixels counted by the first counting unit is: Only when the ratio is larger than the minimum value set by the setting unit and smaller than the maximum value, if the ratio of the number of pixels calculated by the calculation unit has a maximum value due to a change in the threshold, the ratio is the maximum value Is selected as the optimum threshold, and if there is no value that has the maximum value, the threshold at which the ratio becomes zero is selected as the optimum threshold.

【0012】さらに、請求項3の発明に係る閾値決定装
置は、第1のヒストグラム処理部の処理結果に基づいて
各閾値毎に、当該閾値より濃い濃度を有する画素の数を
計数する第1の計数処理部と、濃淡画像における各画素
を順次注目画素とし、その注目画素とその近傍画素の中
で最も濃度の低い画素の濃度値をその注目画素の濃度値
に変更する最小値フィルタ処理部と、その最小値フィル
タ処理部により濃度値を変更された濃淡画像における各
濃度毎の画素の数を計数する第2のヒストグラム処理部
と、その第2のヒストグラム処理部の処理結果に基づい
て各閾値毎に、当該閾値より濃い濃度を有する画素の数
を計数する第2の計数処理部とを設けたものである。
Further, the threshold value determining apparatus according to the third aspect of the present invention, for each threshold value, counts the number of pixels having a density higher than the threshold value for each threshold value based on the processing result of the first histogram processing unit. A count processing unit, and a minimum value filter processing unit that sequentially sets each pixel in the grayscale image as a target pixel, and changes a density value of a pixel having the lowest density among the target pixel and its neighboring pixels to a density value of the target pixel. A second histogram processing unit that counts the number of pixels for each density in the grayscale image whose density value has been changed by the minimum value filter processing unit, and a threshold value based on the processing result of the second histogram processing unit. And a second counting section for counting the number of pixels having a density higher than the threshold value for each time.

【0013】[0013]

【作用】請求項1の発明における閾値決定装置は、演算
部により演算された画素数の割合が閾値の変化によって
極大値となる値があれば、割合が極大値になるときの閾
値を最適な閾値として選定し、極大値となる値がなけれ
ば、割合が零になるときの閾値を最適な閾値として選定
する閾値決定処理部を設けたことにより、画像内に占め
る対象物体と背景の割合に影響されずに、閾値が選定さ
れる。
According to a first aspect of the present invention, there is provided a threshold value determining apparatus that, when there is a value at which the ratio of the number of pixels calculated by the calculation unit has a maximum value due to a change in the threshold value, sets a threshold value at which the ratio becomes a maximum value to an optimum value. If the threshold is selected as a threshold, and if there is no maximum value, by providing a threshold determination processing unit that selects the threshold when the ratio becomes zero as the optimal threshold, the ratio of the target object and the background in the image Without being affected, a threshold is chosen.

【0014】また、請求項2の発明における閾値決定装
置は、対象物体の画素の数の最大値及び最小値を設定す
る設定部を設けるとともに、第1の計数部により計数さ
れた画素数が、該設定部により設定された最小値より大
きく、かつ、最大値より小さい場合に限り、演算部によ
り演算された画素数の割合が閾値の変化によって極大値
となる値があれば、割合が極大値になるときの閾値を最
適な閾値として選定し、極大値となる値がなければ、割
合が零になるときの閾値を最適な閾値として選定する閾
値決定処理部を設けたことにより、画像内に、抽出した
い対象物体と抽出したくない物体が存在する場合に、抽
出したい対象物体だけを切り出すことのできる閾値が選
定される。
Further, the threshold value determining apparatus according to the second aspect of the present invention includes a setting unit for setting a maximum value and a minimum value of the number of pixels of the target object, and the number of pixels counted by the first counting unit is: Only when the ratio is larger than the minimum value set by the setting unit and smaller than the maximum value, if the ratio of the number of pixels calculated by the calculation unit has a maximum value due to a change in the threshold, the ratio is the maximum value Is selected as an optimal threshold when there is no maximum value, and by providing a threshold determination processing unit that selects a threshold when the ratio becomes zero as an optimal threshold, the In the case where there are a target object to be extracted and an object not to be extracted, a threshold value capable of cutting out only the target object to be extracted is selected.

【0015】さらに、請求項3の発明における閾値決定
装置は、第1のヒストグラム処理部の処理結果に基づい
て各閾値毎に、当該閾値より濃い濃度を有する画素の数
を計数する第1の計数処理部と、第2のヒストグラム処
理部の処理結果に基づいて各閾値毎に、当該閾値より濃
い濃度を有する画素の数を計数する第2の計数処理部と
を設けたことにより、2値化処理せずに閾値を高速に求
められる。
Further, the threshold value determining apparatus according to the third aspect of the present invention includes a first counting means for counting the number of pixels having a density higher than the threshold value for each threshold value based on the processing result of the first histogram processing unit. A binarization process is provided by providing a processing unit and a second counting unit that counts the number of pixels having a density higher than the threshold value for each threshold value based on the processing result of the second histogram processing unit. The threshold can be obtained at high speed without any processing.

【0016】[0016]

【実施例】実施例1.以下、この発明の一実施例を図に
ついて説明する。図1はこの発明の一実施例による閾値
決定装置を示す構成図であり、図において、従来のもの
と同一符号は同一または相当部分を示すので説明を省略
する。6は濃度値を示す閾値t(t=0,1,2,,・
・・,9)を順次変化させ、各閾値毎に濃淡画像(諧調
数m=10)を2値化処理して2値画像を得る2値化処
理部である。
[Embodiment 1] An embodiment of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing a threshold value determining apparatus according to an embodiment of the present invention. In the figure, the same reference numerals as those in the related art denote the same or corresponding parts, and a description thereof will be omitted. 6 is a threshold value t (t = 0, 1, 2,.
., 9) are sequentially changed, and a binarization processing section is provided to obtain a binary image by binarizing a grayscale image (number of gradations m = 10) for each threshold value.

【0017】7は2値化処理部6の処理結果に基づいて
各閾値毎に、当該閾値より濃い濃度を有する画素の数を
計数し、面積Stを求める面積計数部(第1の計数
部)、8は2値化処理部6の処理結果に基づいて各閾値
毎に、当該閾値より濃い濃度を有する画素のうち、当該
閾値より濃い濃度を有する画素に囲まれた画素の数を計
数し、内部点数Itを求める内部点数計数部(第2の計
数部)である。
An area counting section (first counting section) 7 counts the number of pixels having a density higher than the threshold value for each threshold value based on the processing result of the binarization processing section 6 and obtains the area St. , 8 counts the number of pixels surrounded by pixels having a density higher than the threshold among pixels having a density higher than the threshold for each threshold based on the processing result of the binarization processing unit 6, An internal point counting unit (second counting unit) for obtaining the internal point It.

【0018】9は各閾値毎に、面積計数部7により求め
られた面積Stに対して内部点数計数部8により求めら
れた内部点数Itの割合、即ち、評価関数Et=It/
Stを演算する評価関数計算部(演算部)、10は評価
関数計算部9により演算された評価関数Etが閾値tの
変化によって極大値となる値があれば、評価関数Etが
極大値になるときの閾値を最適な閾値として選定し、極
大値となる値がなければ、評価関数Etが零になるとき
の閾値を最適な閾値として選定する閾値決定処理部であ
る。
Reference numeral 9 denotes a ratio of the internal point It calculated by the internal point counter 8 to the area St calculated by the area counter 7 for each threshold value, that is, an evaluation function Et = It /
The evaluation function calculation unit (calculation unit) 10 that calculates St has a value at which the evaluation function Et calculated by the evaluation function calculation unit 9 has a maximum value due to a change in the threshold value t, and the evaluation function Et has a maximum value. This is a threshold determination processing unit that selects the threshold value at this time as an optimal threshold value, and if there is no maximum value, selects the threshold value at which the evaluation function Et becomes zero as the optimal threshold value.

【0019】次に動作について説明する。まず、2値化
処理部6が、濃淡画像1を閾値tに対して、閾値t以上
の濃度を有する画素を1に、そうでない画素を0にする
2値化処理を行い、2値画像を得る。次に、面積計数部
7では、全画面において、1の値を有する画素の数を計
数することにより、面積Stを求める。
Next, the operation will be described. First, the binarization processing unit 6 performs a binarization process of setting a pixel having a density equal to or higher than the threshold t to 1 and a pixel having a density not higher than 0 to 0 with respect to the threshold image t, and obtain. Next, the area counting unit 7 calculates the area St by counting the number of pixels having a value of 1 in the entire screen.

【0020】一方、内部点数計数部8では、1の値を有
する画素のうち、その画素を囲む画素(近傍画素)もす
べて1の値を有するものを計数し、内部点数Itを求め
る。ここで、近傍画素とは、例えば図2において、画素
eを注目画素とした場合(画素eは1の値を有してい
る)、画素eの上下、左右、斜めに位置する画素、即
ち、a,b,c,d,f,g,h,iの画素のことであ
る。従って、内部点数計数部8は、a,b,c,d,
f,g,h,iの画素のすべてが1の値を有すれば、カ
ウントする。
On the other hand, the internal point counting section 8 has a value of 1
Of surrounding pixels (neighboring pixels)
Those having a value of 1 are all counted to obtain the internal score It. Here, for example, in FIG. 2, when the pixel e is a target pixel in FIG. 2 (the pixel e has a value of 1 ), the pixels located vertically, horizontally, and obliquely to the pixel e, Pixels a, b, c, d, f, g, h, and i. Therefore, the internal point counting unit 8 calculates a, b, c, d,
If all of the pixels of f, g, h, and i have a value of 1 , counting is performed.

【0021】次に、評価関数計算部9では、上記で求め
た面積Stと内部点数Itを用いて、閾値tにおける評
価関数Et=It/Stを計算する。ここまでの動作を
以下画面例を参照しつつ説明する。
Next, the evaluation function calculator 9 calculates an evaluation function Et = It / St at the threshold value t using the area St and the number of internal points It obtained above. The operation up to this point will be described below with reference to a screen example.

【0022】まず、図3は諧調数がm=10、サイズが
10*10の濃淡画像であり、この画像は背景に対象物
体が含まれる一般的な濃淡画像である。この濃淡画像に
対して、閾値を0から9まで順次上げてゆき、2値化処
理した結果を図4から図13に示す。
First, FIG. 3 shows a gray-scale image having a number of gradations of m = 10 and a size of 10 * 10. This image is a general gray-scale image including a target object in the background. FIGS. 4 to 13 show the results of the binarization process by sequentially increasing the threshold value from 0 to 9 for this grayscale image.

【0023】例えば、閾値t=4で2値化した場合、図
3の濃淡画面に対して、閾値t=4以上に値を有する画
素を計数し、面積S4=42を得る(図8参照)。そし
て、内部点(注目画素及びその近傍画素のすべてが4以
上の値を有する注目画素)の数を計数し、I4=17を
得る(図8参照)。但し、内部点は、面積S4からその
周囲の1画素からなる境界点を差し引いても求められ
る。以上の操作を閾値t=0から9まで行い、評価関数
Et=It/Stを閾値毎に計算する。その閾値に対す
る評価関数をグラフ化したものを図14に示す。
For example, when binarization is performed with the threshold value t = 4, pixels having values equal to or greater than the threshold value t = 4 are counted on the gray scale screen of FIG. 3 to obtain an area S4 = 42 (see FIG. 8). . Then, the number of internal points (the target pixel in which all the target pixel and its neighboring pixels have a value of 4 or more) is counted, and I4 = 17 is obtained (see FIG. 8). However, the internal point can be obtained by subtracting a boundary point composed of one pixel around the area S4 from the area S4. The above operation is performed from the threshold values t = 0 to 9, and the evaluation function Et = It / St is calculated for each threshold value. FIG. 14 shows a graph of the evaluation function with respect to the threshold value.

【0024】以下に、図14に示した評価関数グラフよ
り最適な閾値を求める閾値決定処理部10の動作につい
て説明する。図14に示したように評価関数グラフは、
閾値t=0で最大値E0=1.0をとり、閾値を上げる
に従って減少し、いったん増加した後再び減少し最後は
0となる。図14において、閾値t=6で、評価関数グ
ラフは極大点となるので、閾値t=6を最適の閾値とし
て選定する(もし、図14に極大点がない場合は、Et
=0となる閾値tを最適の閾値として選定する)ことに
なるが、極大点となる閾値を選定する理由は下記の通り
である。
Hereinafter, the operation of the threshold value determination processing section 10 for obtaining the optimum threshold value from the evaluation function graph shown in FIG. 14 will be described. As shown in FIG. 14, the evaluation function graph is
It takes the maximum value E0 = 1.0 at the threshold value t = 0, decreases as the threshold value is increased, increases once, decreases again, and finally becomes zero. In FIG. 14, since the evaluation function graph becomes a maximum point when the threshold value is t = 6, the threshold value t = 6 is selected as an optimum threshold value (if there is no maximum point in FIG.
= 0 is selected as the optimal threshold), but the reason for selecting the threshold that is the maximum point is as follows.

【0025】図3のように対象物体が存在する濃淡画像
の場合、閾値t=0で2値化したときは、すべての点が
抽出され、また抽出されたすべての点は内部点にもなる
ため、評価関数はt=0で最大値(E0=1.0)とな
る。次に、閾値を上げていくと、背景部分に抽出されな
い領域が出始め、抽出される物体のまとまりの良さを示
す評価関数は減少する。更に、閾値を上げていくと、対
象物体だけがまとまり良く抽出されだすため、評価関数
は増加する。また更に閾値を上げていくと、対象物体自
体に抽出されない部分が出始めるため、対象物体のまと
まりが悪くなって評価関数が減少し、内部点がなくなる
時点で評価関数は0となる。上記より、評価関数が極大
値をとるとき、対象物体のまとまりが一番良くなるのが
わかる。従って、この閾値で2値化すれば、対象物体が
一番まとまり良く抽出できる。
In the case of a grayscale image in which a target object exists as shown in FIG. 3, when binarization is performed with the threshold value t = 0, all points are extracted, and all extracted points are also internal points. Therefore, the evaluation function reaches the maximum value (E0 = 1.0) at t = 0. Next, when the threshold value is increased, a region that is not extracted starts to appear in the background portion, and the evaluation function indicating the goodness of unity of the extracted object decreases. Further, as the threshold value is increased, only the target object is extracted in a coherent manner, so that the evaluation function increases. Further, when the threshold value is further increased, a portion that is not extracted starts to appear in the target object itself, so that the unity of the target object deteriorates, the evaluation function decreases, and the evaluation function becomes 0 when there are no more internal points. From the above, it can be seen that the unity of the target object is best when the evaluation function takes the maximum value. Therefore, if binarization is performed using this threshold value, the target object can be extracted in the best unity.

【0026】一方、対象物体が存在しない場合には、背
景が崩れる一方で、まとまり良く抽出される対象物体が
ないため、評価関数には極大値が存在せず、単調減少し
最後には0となる。よって、評価関数に極大値がない場
合には、評価関数Etが0となる値を閾値として選定す
る。これは、濃淡画像に抽出すべき対象物体が存在しな
いと判断した上での最適な閾値であり、この場合、その
後に2値化処理しなくても対象物体が存在しないことが
分かる。
On the other hand, when the target object does not exist, the background collapses, but there is no target object to be extracted in a coherent manner. Therefore, the evaluation function does not have a maximum value, monotonically decreases, and finally becomes 0. Become. Therefore, when the evaluation function has no local maximum value, a value at which the evaluation function Et becomes 0 is selected as the threshold value. This is an optimal threshold value after it is determined that there is no target object to be extracted in the grayscale image. In this case, it can be seen that the target object does not exist without performing the binarization process thereafter.

【0027】実施例2.図15はこの発明の他の実施例
による閾値決定装置を示す構成図であり、図において、
11は対象物体の画素の数の最大値(最大面積Sx)及
び最小値(最小面積Sn)を設定する設定部、12は対
象物体の最大面積Sxを設定する最大面積設定部、13
は対象物体の最小面積Snを設定する最小面積設定部、
14は面積計数部7により求められた面積Stが、設定
部11により設定された最小面積Snより大きく、か
つ、最大面積Sxより小さい場合に限り、評価関数計算
部9により演算された評価関数Etが閾値tの変化によ
って極大値となる値があれば、評価関数Etが極大値に
なるときの閾値を最適な閾値として選定し、極大値とな
る値がなければ、評価関数Etが零になるときの閾値を
最適な閾値として選定する閾値決定処理部である。
Embodiment 2 FIG. FIG. 15 is a block diagram showing a threshold value determining device according to another embodiment of the present invention.
11 is a setting unit for setting the maximum value (maximum area Sx) and the minimum value (minimum area Sn) of the number of pixels of the target object, 12 is a maximum area setting unit for setting the maximum area Sx of the target object, 13
Is a minimum area setting unit for setting the minimum area Sn of the target object;
Reference numeral 14 denotes an evaluation function Et calculated by the evaluation function calculation unit 9 only when the area St obtained by the area counting unit 7 is larger than the minimum area Sn set by the setting unit 11 and smaller than the maximum area Sx. If there is a value that has a maximum value due to a change in the threshold value t, the threshold value at which the evaluation function Et becomes a maximum value is selected as an optimal threshold value. If there is no value that has a maximum value, the evaluation function Et becomes zero. This is a threshold value determination processing unit that selects a threshold value at this time as an optimal threshold value.

【0028】次に動作について説明する。濃淡画像1を
入力して評価関数Et=It/Stを評価関数計算部9
にて求めるところまでは、実施例1と同様である。この
実施例では、抽出したい対象物体の面積Sが、最小面積
Sn以上最大面積Sx以下の場合を考える。 Sn ≦ S ≦ Sx ・・・(2)
Next, the operation will be described. The grayscale image 1 is input and the evaluation function Et = It / St is calculated by the evaluation function calculation unit 9
The process is the same as that of the first embodiment up to the point determined by. In this embodiment, a case is considered where the area S of the target object to be extracted is not less than the minimum area Sn and not more than the maximum area Sx. Sn ≦ S ≦ Sx (2)

【0029】即ち、最大面積設定部12と最小面積設定
部13にて、予め、最大面積Sxと最小面積Snが設定
されており、閾値決定処理部14では、例えば、閾値t
で2値化して抽出された面積Stと、予め設定された最
大・最小面積のSx,Snとを比較し、式(2)を満足
する場合だけ、評価関数計算部9の出力結果を評価し最
適な閾値を選定する。
That is, the maximum area Sx and the minimum area Sn are set in advance in the maximum area setting section 12 and the minimum area setting section 13, and the threshold value determination processing section 14 sets, for example, a threshold value t
The area St extracted by binarization is compared with the preset maximum and minimum areas Sx and Sn, and only when the expression (2) is satisfied, the output result of the evaluation function calculator 9 is evaluated. Choose the optimal threshold.

【0030】このように、式(2)を満足する場合のみ
評価関数計算部9の出力結果を評価するようにしている
ので、濃淡画像内に抽出したい対象物体と抽出したくな
い物体が存在する場合、抽出したい物体だけをうまく切
り出すための閾値を選定できる効果を奏する。
As described above, since the output result of the evaluation function calculation unit 9 is evaluated only when the expression (2) is satisfied, there are a target object to be extracted and an object not to be extracted in the grayscale image. In this case, there is an effect that a threshold for properly cutting out only an object to be extracted can be selected.

【0031】実施例3.図16はこの発明の他の実施例
による閾値決定装置を示す構成図であり、図において、
15は濃淡画像1における各濃度毎の画素の数を計数す
るヒストグラム処理部(第1のヒストグラム処理部)、
16はヒストグラム処理部15の処理結果に基づいて各
閾値毎に、当該閾値より濃い濃度を有する画素の数を計
数する累積処理部(第1の計数処理部)である。
Embodiment 3 FIG. FIG. 16 is a block diagram showing a threshold value determining device according to another embodiment of the present invention.
Reference numeral 15 denotes a histogram processing unit (first histogram processing unit) for counting the number of pixels for each density in the grayscale image 1;
Reference numeral 16 denotes an accumulation processing unit (first counting processing unit) that counts the number of pixels having a density higher than the threshold value for each threshold value based on the processing result of the histogram processing unit 15.

【0032】また、17は濃淡画像1における各画素を
順次注目画素とし、その注目画素とその近傍画素の中で
最も濃度の低い画素の濃度値をその注目画素の濃度値に
変更する最小値フィルタ処理部、18は最小値フィルタ
処理部17により濃度値を変更された濃淡画像1におけ
る各濃度毎の画素の数を計数するヒストグラム処理部
第2のヒストグラム処理部)、19はヒストグラム処
理部18の処理結果に基づいて各閾値毎に、当該閾値よ
り濃い濃度を有する画素の数を計数する累積処理部(第
2の計数処理部)である。
Reference numeral 17 denotes a minimum value filter for sequentially setting each pixel in the grayscale image 1 as a target pixel, and changing a density value of a pixel having the lowest density among the target pixel and its neighboring pixels to a density value of the target pixel. A processing unit 18 is a histogram processing unit ( second histogram processing unit) that counts the number of pixels for each density in the grayscale image 1 whose density value has been changed by the minimum value filtering unit 17, and 19 is a histogram processing unit 18. Is a cumulative processing unit (second counting processing unit) that counts, for each threshold value, the number of pixels having a density higher than the threshold value based on the processing result.

【0033】次に動作について説明する。10諧調(濃
度値0から9)の濃淡画像1は、ヒストグラム処理部1
5に入力され、濃度値t(0から9)毎の頻度Ht(画
素数)が求められる。累積処理部16では、濃度ヒスト
グラムの濃度値t以上の濃度頻度が蓄積される。即ち、
ヒストグラム処理部15の処理結果に基づいて各閾値t
毎に、当該閾値tより濃い濃度を有する画素の数が計数
される。この濃度値t以上の累積された頻度数は、濃淡
画像1を閾値tで2値化して抽出した対象物体の面積S
tと等しくなる。
Next, the operation will be described. The grayscale image 1 of 10 gradations (density values 0 to 9) is converted to a histogram processing unit 1
5, the frequency Ht (the number of pixels) for each density value t (0 to 9) is obtained. The accumulation processing unit 16 accumulates density frequencies equal to or higher than the density value t of the density histogram. That is,
Each threshold t based on the processing result of the histogram processing unit 15
Each time, the number of pixels having a density higher than the threshold value t is counted. The accumulated frequency number equal to or greater than the density value t is determined by the area S of the target object extracted by binarizing the grayscale image 1 with the threshold value t.
t.

【0034】[0034]

【数2】 (Equation 2)

【0035】一方、濃淡画像1は、最小値フィルタ処理
部17にも入力され、注目画素とその近傍画素のうちの
最小値が求められる。即ち、濃淡画素1における各画素
を順次注目画素とし、その注目画素とその近傍画素の中
で最も濃度の低い画素の濃度値をその注目画素の濃度値
に変更される。例えば、図3において、i(横方向)が
3で、j(縦方向)が4の画素を注目画素eとした場
合、注目画素eとその近傍画素a,b,c,d,f,
g,h,iの中で最も濃度の低い画素は、iが2で、j
が4の画素であり、その濃度値は”1”であるため、注
目画素eの濃度値は、”1”に 変更される(図20参
照)。
On the other hand, the grayscale image 1 is also input to the minimum value filter processing unit 17, and the minimum value of the target pixel and its neighboring pixels is obtained. That is, each pixel in the gray-scale pixel 1 is sequentially set as a target pixel, and the density value of a pixel having the lowest density among the target pixel and its neighboring pixels is changed to the density value of the target pixel. For example, in FIG. 3, when a pixel whose i (horizontal direction) is 3 and whose j (vertical direction) is 4 is a target pixel e, the target pixel e and its neighboring pixels a, b, c, d, f, and
The pixel with the lowest density among g, h, and i has i = 2 and j
Is a pixel of 4 and its density value is “1”, so that the density value of the target pixel e is changed to “1” (see FIG. 20).

【0036】そして、最小値フィルタ処理部17により
濃度値を変更された濃淡画像1は、ヒストグラム処理部
18に入力され、濃度値t(0から9)毎の頻度NHt
(画素数)が求められる。また、累積処理部19では、
濃度ヒストグラムの濃度値t以上の濃度頻度が蓄積され
る。即ち、ヒストグラム処理部18の処理結果に基づい
て各閾値t毎に、当該閾値tより濃い濃度を有する画素
の数が計数される。蓄積された頻度数は、濃淡画像1を
閾値tで2値化して抽出した対象物体の内部点数Itと
等しくなる。
The grayscale image 1 whose density value has been changed by the minimum value filter processing unit 17 is input to the histogram processing unit 18 and the frequency NHt for each density value t (0 to 9)
(The number of pixels) is obtained. In addition, in the accumulation processing unit 19,
Density frequencies equal to or higher than the density value t of the density histogram are accumulated. That is, the number of pixels having a density higher than the threshold value t is counted for each threshold value t based on the processing result of the histogram processing unit 18. The accumulated frequency number is equal to the internal score It of the target object extracted by binarizing the grayscale image 1 with the threshold value t.

【0037】[0037]

【数3】 (Equation 3)

【0038】評価関数計算部9にて、この面積Stと内
部点数Itを用いて評価関数Etを計算し、閾値決定処
理部10にて、最適な閾値を求める処理は上記実施例1
と同様であるため、説明を省略する。
The evaluation function calculator 9 calculates the evaluation function Et using the area St and the number of internal points It, and the threshold determination processor 10 calculates the optimum threshold value in the first embodiment.
Therefore, the description is omitted.

【0039】ここで、図18(a)を用いて最小値フィ
ルタ処理部17の動作を詳細に説明する。濃淡画像1
は、1画素ずつ、j=0からi=9へ、次にj=1のi
=0からi=9へ、・・・j=9のi=0からi=9へ
と順々に、最小値フィルタ処理部17に入力される。画
素記憶部111に近傍画素gが入力された場合を考え
る。この時には、1行遅延線101には画素gのある1
行前の画像データが記憶されており、画素記憶部112
には近傍画素d(gの1行上の画素)、画素記憶部11
3には近傍画素a(gの2行上の画素)が各々記憶され
ることになる。最小値選択部114aでは、画素gとd
のうちの小さい方のデータと画素aとを比較し、小さい
方のデータを出力し、画素記憶部115に記憶する。
Here, the operation of the minimum value filter processing section 17 will be described in detail with reference to FIG. Shade image 1
Is one pixel at a time from j = 0 to i = 9, then i = 1
= 0 to i = 9,..., J = 9, and sequentially input to the minimum value filter processing unit 17 from i = 0 to i = 9. Consider a case in which a neighboring pixel g is input to the pixel storage unit 111. At this time, the one-line delay line 101
The image data of the previous row is stored, and the pixel storage unit 112
Indicates a neighboring pixel d (a pixel on one line above g), a pixel storage unit 11
3 stores the neighboring pixels a (pixels on the second row of g). In the minimum value selection unit 114a, the pixels g and d
Is compared with the pixel a, and the smaller data is output and stored in the pixel storage unit 115.

【0040】ここで、最小値選択部114a〜dの動作
を図19を用いて説明する。濃淡画像xとyが比較部1
21に入力される、そこでは、2つのデータを比較し、
その結果によりc=0又は1を出力し、選択部122の
選択信号入力sへ送られる。選択部122にも濃淡画像
xとyが入力され、選択信号入力sの値によって濃淡画
像x又はyを出力する。比較部121の入力条件と出力
結果、選択部122の入力条件と出力結果は図19の表
に示した通りである。例えば、xよりyの方が小さい場
合を考えると、比較部121の出力結果は、c=0とな
り、選択部122の出力は、b側に入力されるデータy
が選ばれ出力される。よって、データの値の小さな方が
選択出力されることになる。また、逆の場合も同様であ
る。
Here, the operation of the minimum value selectors 114a to 114d will be described with reference to FIG. The grayscale images x and y are the comparison unit 1
21 where the two data are compared,
According to the result, c = 0 or 1 is output and sent to the selection signal input s of the selection unit 122. The grayscale images x and y are also input to the selection unit 122, and the grayscale images x or y are output according to the value of the selection signal input s. The input conditions and output results of the comparison unit 121 and the input conditions and output results of the selection unit 122 are as shown in the table of FIG. For example, when y is smaller than x, the output result of the comparison unit 121 is c = 0, and the output of the selection unit 122 is the data y input to the b side.
Is selected and output. Therefore, the smaller data value is selectively output. The same applies to the opposite case.

【0041】引き続き、図18(b)を用いて最小値フ
ィルタ処理部17の動作を詳細に説明する。この図は、
濃淡画像1が順次入力され、画素記憶部111に近傍画
素iが入力された時点のものである。この場合、画素記
憶部112には近傍画素f(iの1行上の画素)、画素
記憶部113には近傍画素c(iの2行上の画素)が各
々記憶されることになる。
Next, the operation of the minimum value filter processing unit 17 will be described in detail with reference to FIG. This figure is
This is the time when the grayscale image 1 is sequentially input and the neighboring pixel i is input to the pixel storage unit 111. In this case, the pixel storage unit 112 stores the neighboring pixel f (pixel on the first row of i), and the pixel storage unit 113 stores the neighboring pixel c (pixel on the second row of i).

【0042】そして、最小値選択部114aと114b
により、画素i,f,cの内の最小値が選択され、画素
記憶部115に記憶される。この時、以前に記憶してい
た画素a,d,gの最小値は画素記憶部117に記憶さ
れ、また、画素b,e,hの最小値は画素記憶部115
に記憶される。そして、この3つのデータの最小値は、
最小値選択部114dなどにより求められる。以上の処
理によって、注目画素eとその近傍画素a,b,c,
d,f,g,h,iの最小値が求められることになる。
Then, the minimum value selection units 114a and 114b
, The minimum value of the pixels i, f, and c is selected and stored in the pixel storage unit 115. At this time, the previously stored minimum values of the pixels a, d, and g are stored in the pixel storage unit 117, and the minimum values of the pixels b, e, and h are stored in the pixel storage unit 115.
Is stored. And the minimum value of these three data is
It is obtained by the minimum value selection unit 114d and the like. By the above processing, the pixel of interest e and its neighboring pixels a, b, c,
The minimum values of d, f, g, h, and i will be obtained.

【0043】実施例4. 上記実施例においては、評価関数Etは、内部点数Et
は内部点数Itと面積Stの比で定義したが、図22に
示すように、内部点数Itの代わりに外部点数Otを用
いるようにしてもよい。この場合、評価関数計算部22
では、評価関数Etの代わりに、Ft=St/Otを用
いる。この評価関数Ftは、上記実施例の評価関数Et
と同様の形状を示すため、これ以外の処理は上記実施例
と同様である。なお、外部点数は、2値化処理により抽
出された対象物体において、その周囲に1画素を増加さ
せたものであり(内部点数の逆)、例えば、注目画素に
1つでも1の点があれば注目画素を1に変えることで求
めることができる。また、高速処理を行なうために、濃
淡画像1において、注目画素とその近傍画素の最大値を
とる最大値フィルタ処理部を設ける構成としてもよいこ
とはいうまでもない。
Embodiment 4 FIG. In the above embodiment, the evaluation function Et is the internal score Et.
Is defined by the ratio of the internal point It to the area St, but as shown in FIG. 22, the external point Ot may be used instead of the internal point It. In this case, the evaluation function calculator 22
Then, Ft = St / Ot is used instead of the evaluation function Et. This evaluation function Ft is equal to the evaluation function Et of the above embodiment.
Since other shapes are shown, the other processes are the same as those in the above embodiment. The external score is obtained by increasing one pixel around the target object extracted by the binarization processing (inverse of the internal score). For example, it can be obtained by changing the target pixel to 1. Needless to say, in order to perform high-speed processing, the grayscale image 1 may be provided with a maximum value filter processing unit that takes the maximum value of the pixel of interest and its neighboring pixels.

【0044】実施例5.また、図23に示すように、内
部点数計数部8と外部点数計数部21を設け、評価関数
として、Gt=It/Otを用いるようにしてもよく、
上記実施例と同様の効果を奏する。
Embodiment 5 FIG. Further, as shown in FIG. 23, an internal point counting section 8 and an external point counting section 21 may be provided, and Gt = It / Ot may be used as an evaluation function.
The same effects as in the above embodiment can be obtained.

【0045】実施例6.上記実施例3では、2つのヒス
トグラム処理部15、18と、2つの累積処理部16、
19から構成されているものについて説明したが、図2
4に示すように、ヒストグラム処理部と累積処理部を共
用できるように構成してもよく、上記実施例3と同様の
効果を奏する。なお、選択処理部24は、ヒストグラム
処理を行なう画像データとして、濃淡画像1、または最
小値フィルタ処理を施した後の濃淡画像1を選択し、ヒ
ストグラム25へ送出するものである。
Embodiment 6 FIG. In the third embodiment, two histogram processing units 15, 18 and two accumulation processing units 16,
19 has been described, but FIG.
As shown in FIG. 4, the histogram processing unit and the accumulation processing unit may be configured to be shared, and the same effects as in the third embodiment can be obtained. The selection processing unit 24 selects the grayscale image 1 or the grayscale image 1 that has been subjected to the minimum value filter process as the image data to be subjected to the histogram processing, and sends it to the histogram 25.

【0046】[0046]

【発明の効果】以上のように、請求項1の発明によれ
ば、各閾値毎に、第の計数部により計数された画素数
に対して第の計数部により計数された画素数の割合を
演算し、その割合が閾値の変化によって極大値となる値
があれば、割合が極大値になるときの閾値を最適な閾値
として選定し、極大値となる値がなければ、割合が零に
なるときの閾値を最適な閾値として選定するように構成
したので、画像内に占める対象物体と背景の割合が極端
に異なる等の条件が厳しい場合や対象物体が存在しない
場合でも、最適な閾値を決定できるなどの効果がある。
As is evident from the foregoing description, according to the first aspect of the present invention, for each threshold, the number of pixels counted by the second counting unit relative to the number of pixels counted by the first counting portion The ratio is calculated, and if there is a value at which the ratio has a local maximum value due to a change in the threshold value, the threshold at which the ratio becomes the local maximum value is selected as the optimal threshold value. Is set as the optimal threshold, the optimal threshold is set even when conditions such as the ratio of the target object and the background occupying in the image are extremely different or when the target object does not exist. The effect is that it can be determined.

【0047】また、請求項2の発明によれば、対象物体
の画素の数の最大値及び最小値を設定する設定部を設
け、第1の計数部により計数された画素数が、該設定部
により設定された最小値より大きく、かつ、最大値より
小さい場合に限り、演算部により演算された画素数の割
合が閾値の変化によって極大値となる値があれば、割合
が極大値になるときの閾値を最適な閾値として選定し、
極大値となる値がなければ、割合が零になるときの閾値
を最適な閾値として選定するように構成したので、上記
請求項1の効果に加え、画像内に、抽出したい対象物体
と抽出したくない物体が存在する場合に、抽出したい対
象物体だけを切り出すことのできる閾値を選定できるな
どの効果がある。
According to the second aspect of the present invention, a setting unit for setting the maximum value and the minimum value of the number of pixels of the target object is provided, and the number of pixels counted by the first counting unit is set to the setting unit. If the ratio of the number of pixels calculated by the calculation unit has a maximum value due to a change in the threshold value only when the ratio is a maximum value and is smaller than the maximum value set by Is selected as the optimal threshold,
If there is no maximum value, the threshold at which the ratio becomes zero is selected as the optimal threshold. In addition to the effect of claim 1, the target object to be extracted is extracted from the image. When there is an object that the user does not want to extract, there is an effect that a threshold value for extracting only the target object to be extracted can be selected.

【0048】さらに、請求項3の発明によれば、第1の
ヒストグラム処理部の処理結果に基づいて各閾値毎に、
当該閾値より濃い濃度を有する画素の数を計数する第1
の計数処理部と、濃淡画像における各画素を順次注目画
素とし、その注目画素とその近傍画素の中で最も濃度の
低い画素の濃度値をその注目画素の濃度値に変更する最
小値フィルタ処理部と、その最小値フィルタ処理部によ
り濃度値を変更された濃淡画像における各濃度毎の画素
の数を計数する第2のヒストグラム処理部と、その第2
のヒストグラム処理部の処理結果に基づいて各閾値毎
に、当該閾値より濃い濃度を有する画素の数を計数する
第2の計数処理部とを設けた構成にしたので、2値化処
理をしなくても高速に最適な閾値を求めることができる
などの効果がある。
Further, according to the third aspect of the present invention, based on the processing result of the first histogram processing unit, for each threshold value,
A first method for counting the number of pixels having a density higher than the threshold value
And a minimum value filter processing unit that sequentially sets each pixel in the grayscale image as a target pixel, and changes the density value of the lowest density pixel among the target pixel and its neighboring pixels to the density value of the target pixel. A second histogram processing unit that counts the number of pixels for each density in the grayscale image whose density value has been changed by the minimum value filter processing unit;
And a second counting unit that counts the number of pixels having a density higher than the threshold value for each threshold based on the processing result of the histogram processing unit. However, there is an effect that an optimum threshold can be obtained at high speed.

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

【図1】この発明の一実施例による閾値決定装置を示す
構成図である。
FIG. 1 is a configuration diagram showing a threshold value determining device according to an embodiment of the present invention.

【図2】近傍画素の説明図である。FIG. 2 is an explanatory diagram of neighboring pixels.

【図3】濃淡画像例を示す画像濃淡図である。FIG. 3 is an image shading diagram showing an example of a shading image.

【図4】2値化処理後の面積と内部点を説明する説明図
である。
FIG. 4 is an explanatory diagram illustrating an area and internal points after a binarization process.

【図5】2値化処理後の面積と内部点を説明する説明図
である。
FIG. 5 is an explanatory diagram illustrating an area and internal points after a binarization process.

【図6】2値化処理後の面積と内部点を説明する説明図
である。
FIG. 6 is an explanatory diagram illustrating an area and internal points after a binarization process.

【図7】2値化処理後の面積と内部点を説明する説明図
である。
FIG. 7 is an explanatory diagram illustrating an area and internal points after a binarization process.

【図8】2値化処理後の面積と内部点を説明する説明図
である。
FIG. 8 is an explanatory diagram illustrating an area and internal points after a binarization process.

【図9】2値化処理後の面積と内部点を説明する説明図
である。
FIG. 9 is an explanatory diagram illustrating an area and internal points after a binarization process.

【図10】2値化処理後の面積と内部点を説明する説明
図である。
FIG. 10 is an explanatory diagram illustrating an area and internal points after a binarization process.

【図11】2値化処理後の面積と内部点を説明する説明
図である。
FIG. 11 is an explanatory diagram illustrating an area and internal points after a binarization process.

【図12】2値化処理後の面積と内部点を説明する説明
図である。
FIG. 12 is an explanatory diagram illustrating areas and internal points after binarization processing.

【図13】2値化処理後の面積と内部点を説明する説明
図である。
FIG. 13 is an explanatory diagram illustrating an area and internal points after the binarization processing.

【図14】評価関数を示すグラフ図である。FIG. 14 is a graph showing an evaluation function.

【図15】この発明の他の実施例による閾値決定装置を
示す構成図である。
FIG. 15 is a configuration diagram showing a threshold value determining device according to another embodiment of the present invention.

【図16】この発明の他の実施例による閾値決定装置を
示す構成図である。
FIG. 16 is a configuration diagram showing a threshold value determining device according to another embodiment of the present invention.

【図17】近傍画素の説明図である。FIG. 17 is an explanatory diagram of neighboring pixels.

【図18】最小値フィルタ処理部を示す構成図である。FIG. 18 is a configuration diagram illustrating a minimum value filter processing unit.

【図19】最小値フィルタ処理部の最小値選択部を示す
構成図である。
FIG. 19 is a configuration diagram illustrating a minimum value selection unit of the minimum value filter processing unit.

【図20】2値化処理後の濃淡画像例を示す画像濃淡図
である。
FIG. 20 is an image shading diagram showing an example of a shading image after the binarization processing.

【図21】評価関数を示すグラフ図である。FIG. 21 is a graph showing an evaluation function.

【図22】この発明の他の実施例による閾値決定装置を
示す構成図である。
FIG. 22 is a configuration diagram showing a threshold value determining device according to another embodiment of the present invention.

【図23】この発明の他の実施例による閾値決定装置を
示す構成図である。
FIG. 23 is a configuration diagram showing a threshold value determining device according to another embodiment of the present invention.

【図24】この発明の他の実施例による閾値決定装置を
示す構成図である。
FIG. 24 is a configuration diagram showing a threshold value determining device according to another embodiment of the present invention.

【図25】従来の閾値決定装置を示す構成図である。FIG. 25 is a configuration diagram showing a conventional threshold value determination device.

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

1 濃淡画像 6 2値化処理部 7 面積計数部(第1の計数部) 8 内部点数計数部(第2の計数部) 9、22、23 評価関数計算部(演算部) 10、14 閾値決定処理部 11 設定部 15 ヒストグラム処理部(第1のヒストグラム処理
部) 16 累積処理部(第1の計数部) 17 最小値フィルタ処理部 18 ヒストグラム処理部(第2のヒストグラム処理
部) 19 累積処理部(第2の計数部) 21 外部点数計数部(第2の計数部)
DESCRIPTION OF REFERENCE NUMERALS 1 Shading image 6 Binary processing section 7 Area counting section (first counting section) 8 Internal point counting section (second counting section) 9, 22, 23 Evaluation function calculation section (calculation section) 10, 14, determination of threshold Processing unit 11 setting unit 15 histogram processing unit (first histogram processing unit) 16 accumulation processing unit (first counting unit) 17 minimum value filter processing unit 18 histogram processing unit (second histogram processing unit) 19 accumulation processing unit (Second counting section) 21 External point counting section (Second counting section)

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 平2−24787(JP,A) 特開 昭57−26966(JP,A) 特開 昭62−3391(JP,A) 特開 平5−115005(JP,A) 特開 平6−326871(JP,A) (58)調査した分野(Int.Cl.7,DB名) H04N 1/40 - 1/409 H04N 1/46 H04N 1/60 G06T 1/00 460 ────────────────────────────────────────────────── ─── Continuation of the front page (56) References JP-A-2-24787 (JP, A) JP-A-57-26966 (JP, A) JP-A-62-23391 (JP, A) JP-A-5-296 115005 (JP, A) JP-A-6-326871 (JP, A) (58) Fields investigated (Int. Cl. 7 , DB name) H04N 1/40-1/409 H04N 1/46 H04N 1/60 G06T 1/00 460

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 濃度値を示す閾値を順次変化させ、各閾
値毎に濃淡画像を2値化処理して2値画像を得る2値化
処理部と、上記2値化処理部の処理結果に基づいて各閾
値毎に、当該閾値より濃い濃度を有する画素の数を計数
する第1の計数部と、上記2値化処理部の処理結果に基
づいて各閾値毎に、当該閾値より濃い濃度を有する画素
のうち、当該閾値より濃い濃度を有する画素に囲まれた
画素の数を計数する第2の計数部と、各閾値毎に、上記
の計数部により計数された画素数に対して上記第
の計数部により計数された画素数の割合を演算する演算
部と、上記演算部により演算された画素数の割合が閾値
の変化によって極大値となる値があれば、割合が極大値
になるときの閾値を最適な閾値として選定し、極大値と
なる値がなければ、割合が零になるときの閾値を最適な
閾値として選定する閾値決定処理部とを備えた閾値決定
装置。
1. A binarization processing unit for sequentially changing a threshold value indicating a density value, binarizing a grayscale image for each threshold value to obtain a binary image, and a processing result of the binarization processing unit. A first counting unit that counts the number of pixels having a density higher than the threshold for each threshold based on the threshold, and a density higher than the threshold for each threshold based on the processing result of the binarization processing unit. A second counting unit that counts the number of pixels surrounded by pixels having a darker density than the threshold, among the pixels that have the threshold, and for each threshold, the number of pixels counted by the first counting unit The second
If there is a calculation unit that calculates the ratio of the number of pixels counted by the counting unit, and if the ratio of the number of pixels calculated by the calculation unit has a maximum value due to a change in the threshold, when the ratio becomes a maximum value And a threshold determination processing unit that selects a threshold when the ratio becomes zero as an optimal threshold if there is no maximum value.
【請求項2】 濃度値を示す閾値を順次変化させ、各閾
値毎に濃淡画像を2値化処理して2値画像を得る2値化
処理部と、上記2値化処理部の処理結果に基づいて各閾
値毎に、当該閾値より濃い濃度を有する画素の数を計数
する第1の計数部と、上記2値化処理部の処理結果に基
づいて各閾値毎に、当該閾値より濃い濃度を有する画素
のうち、当該閾値より濃い濃度を有する画素に囲まれた
画素の数を計数する第2の計数部と、各閾値毎に、上記
の計数部により計数された画素数に対して上記第
の計数部により計数された画素数の割合を演算する演算
部と、対象物体の画素の数の最大値及び最小値を設定す
る設定部と、上記第1の計数部により計数された画素数
が、上記設定部により設定された最小値より大きく、か
つ、最大値より小さい場合に限り、上記演算部により演
算された画素数の割合が閾値の変化によって極大値とな
る値があれば、割合が極大値になるときの閾値を最適な
閾値として選定し、極大値となる値がなければ、割合が
零になるときの閾値を最適な閾値として選定する閾値決
定処理部とを備えた閾値決定装置。
2. A binarization processing section for sequentially changing a threshold value indicating a density value, binarizing a grayscale image for each threshold value to obtain a binary image, and a processing result of the binarization processing section. A first counting unit that counts the number of pixels having a density higher than the threshold for each threshold based on the threshold, and a density higher than the threshold for each threshold based on the processing result of the binarization processing unit. A second counting unit that counts the number of pixels surrounded by pixels having a darker density than the threshold, among the pixels that have the threshold, and for each threshold, the number of pixels counted by the first counting unit The second
A calculating unit that calculates the ratio of the number of pixels counted by the counting unit, a setting unit that sets the maximum value and the minimum value of the number of pixels of the target object, and the number of pixels counted by the first counting unit. Only when the ratio is larger than the minimum value set by the setting unit and smaller than the maximum value, if the ratio of the number of pixels calculated by the calculation unit has a maximum value due to a change in the threshold, the ratio is A threshold determination processing unit that selects a threshold when the local maximum value is obtained as an optimal threshold, and if there is no maximum local value, selects a threshold when the ratio becomes zero as an optimum threshold value. .
【請求項3】 濃淡画像における各濃度毎の画素の数を
計数する第1のヒストグラム処理部と、上記第1のヒス
トグラム処理部の処理結果に基づいて各閾値毎に、当該
閾値より濃い濃度を有する画素の数を計数する第1の計
数処理部と、上記濃淡画像における各画素を順次注目画
素とし、その注目画素とその近傍画素の中で最も濃度の
低い画素の濃度値をその注目画素の濃度値に変更する最
小値フィルタ処理部と、上記最小値フィルタ処理部によ
り濃度値を変更された濃淡画像における各濃度毎の画素
の数を計数する第2のヒストグラム処理部と、上記第2
のヒストグラム処理部の処理結果に基づいて各閾値毎
に、当該閾値より濃い濃度を有する画素の数を計数する
第2の計数処理部と、各閾値毎に、上記第の計数部に
より計数された画素数に対して上記第の計数部により
計数された画素数の割合を演算する演算部と、上記演算
部により演算された画素数の割合が閾値の変化によって
極大値となる値があれば、割合が極大値になるときの閾
値を最適な閾値として選定し、極大値となる値がなけれ
ば、割合が零になるときの閾値を最適な閾値として選定
する閾値決定処理部とを備えた閾値決定装置。
3. A first histogram processing unit for counting the number of pixels for each density in a grayscale image, and a density darker than the threshold for each threshold based on a processing result of the first histogram processing unit. A first counting unit for counting the number of pixels having the target pixel, and sequentially setting each pixel in the grayscale image as a target pixel, and determining a density value of a pixel having the lowest density among the target pixel and its neighboring pixels. A minimum value filter processing section for changing to a density value, a second histogram processing section for counting the number of pixels for each density in the grayscale image whose density value has been changed by the minimum value filter processing section,
A second counting unit that counts the number of pixels having a density higher than the threshold value for each threshold value based on the processing result of the histogram processing unit, and a first counting unit that counts the number of pixels for each threshold value. A calculating unit that calculates the ratio of the number of pixels counted by the second counting unit to the number of pixels obtained, and a value in which the ratio of the number of pixels calculated by the calculating unit reaches a maximum value due to a change in the threshold. For example, a threshold determination processing unit that selects a threshold when the ratio reaches a local maximum value as an optimal threshold, and selects a threshold when the ratio becomes zero as an optimal threshold if there is no value that reaches a local maximum value. Threshold determination device.
JP24716792A 1992-08-25 1992-08-25 Threshold determination device Expired - Fee Related JP3150778B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP24716792A JP3150778B2 (en) 1992-08-25 1992-08-25 Threshold determination device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP24716792A JP3150778B2 (en) 1992-08-25 1992-08-25 Threshold determination device

Publications (2)

Publication Number Publication Date
JPH0678153A JPH0678153A (en) 1994-03-18
JP3150778B2 true JP3150778B2 (en) 2001-03-26

Family

ID=17159440

Family Applications (1)

Application Number Title Priority Date Filing Date
JP24716792A Expired - Fee Related JP3150778B2 (en) 1992-08-25 1992-08-25 Threshold determination device

Country Status (1)

Country Link
JP (1) JP3150778B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010219932A (en) * 2009-03-17 2010-09-30 Nippon Hoso Kyokai <Nhk> Image processing apparatus and image processing program

Also Published As

Publication number Publication date
JPH0678153A (en) 1994-03-18

Similar Documents

Publication Publication Date Title
JP3083918B2 (en) Image processing device
JPH03206572A (en) Automatizing system for gradation conversion
KR100207426B1 (en) Apparatus for sorting texture using size and direction of pattern
JP2001118062A (en) Automatic dynamic range compressing method
EP2034436A1 (en) Method for non-photorealistic rendering
JPH04302580A (en) Method and apparatus for segmentation of digital image
Sun et al. Segmentation of complex food images by stick growing and merging algorithm
JP3150778B2 (en) Threshold determination device
CN111445435A (en) No-reference image quality evaluation method based on multi-block wavelet transform
JP3100383B2 (en) Character region separation method and apparatus
JPH10285399A (en) Binarization method for image
CN112529786A (en) Image processing apparatus and method, and non-transitory computer-readable storage medium
JP2003085553A (en) Noise reduction circuit
JP3267107B2 (en) Background image creation method and image processing apparatus
EP1612725A1 (en) Image processing method and image processing device
JP2761285B2 (en) Threshold value determination device
JPH07107268A (en) Image processing device
JPH10124665A (en) Method for processing picture and device therefor
CN116385316B (en) Multi-target image dynamic capturing method and related device
JP3462960B2 (en) Image processing method
JP2511068B2 (en) Character string detector
JP4741289B2 (en) Image processing apparatus and image processing method
JP2797655B2 (en) Image processing method and apparatus
JP2843185B2 (en) Threshold value determination method and device
JP2596613B2 (en) Threshold value determination device

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080119

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090119

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100119

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100119

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110119

Year of fee payment: 10

LAPS Cancellation because of no payment of annual fees