JPH01184583A - System for deciding binarization threshold value - Google Patents
System for deciding binarization threshold valueInfo
- Publication number
- JPH01184583A JPH01184583A JP63008462A JP846288A JPH01184583A JP H01184583 A JPH01184583 A JP H01184583A JP 63008462 A JP63008462 A JP 63008462A JP 846288 A JP846288 A JP 846288A JP H01184583 A JPH01184583 A JP H01184583A
- Authority
- JP
- Japan
- Prior art keywords
- image
- value
- histogram
- boundary
- binarization
- 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.)
- Granted
Links
- 238000004364 calculation method Methods 0.000 claims abstract description 56
- 238000003708 edge detection Methods 0.000 claims abstract description 28
- 230000001186 cumulative effect Effects 0.000 claims description 67
- 238000000034 method Methods 0.000 claims description 32
- 238000001514 detection method Methods 0.000 abstract description 4
- 230000008602 contraction Effects 0.000 description 10
- 238000010586 diagram Methods 0.000 description 10
- 238000007796 conventional method Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 2
- 238000001914 filtration Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000009825 accumulation Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000000873 masking effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Landscapes
- Image Input (AREA)
- Facsimile Image Signal Circuits (AREA)
Abstract
Description
【発明の詳細な説明】
〔概 要〕
二値化のいき値決定方式に関し、
仮のいき値を設定せずに最適ないき値を高速に決定する
ことの可能な二値化のいき値決定方式を提供することを
目的とし、
濃淡画像を処理する画像処理システムにおいて、原画像
を入力し画像中の対象物の輪郭の候補点を検出するエツ
ジ検出部と、前記画像を入力し各画素毎にその画素を含
む近傍画素から成るウィンド内の画素の濃淡値を大きさ
の順にならべたときにある定められた順位の濃淡値にそ
の画素の濃淡値を置換する順序フィルタと、原画像と前
記順序フィルタから出力される画像のうち所定の二つの
画像を対象として、画像の全領域における前記二つの画
像の濃淡値の累積ヒストグラムと前記エツジ検出部で検
出されたエツジ画素群によって占められるエツジ画像領
域における前記二つの画像の濃淡値の累積ヒストグラム
を算出する累積算出部と、前記累積算出部によって計算
される画像の全領域における二つの累積ヒストグラムの
濃淡値毎の差によって得られる画像の全領域における境
界画素数ヒストグラムと前記累積算出部によって計算さ
れる前記エツジ画像領域における二つの累積ヒストグラ
ムの濃淡値毎の差によって得られるエツジ画像領域にお
ける境界画素数ヒストグラムとを算出する境界領域画素
数算出部と、前記境界領域画素数算出部によって計算さ
れる前記画像の全領域における境界画素数ヒストグラム
と前記エツジ画像領域における境界画素数ヒストグラム
を用いて濃淡値毎にその濃淡値をいき値として二値化し
たときの二値画像の境界画素と前記エツジ検出部で検出
されるエツジ画素群との一致の度合いを算出してその度
合いが最大である濃淡値を出力する最適いき値決定部を
有し、前記最適いき値決定部の出力を二値化のいき値と
するように構成する。[Detailed Description of the Invention] [Summary] Regarding the binarization threshold determination method, there is provided a binarization threshold determination method that can quickly determine an optimal threshold without setting a temporary threshold. The purpose of the present invention is to provide an edge detection unit that inputs an original image and detects candidate points for the contour of an object in the image, and an edge detection unit that inputs the original image and detects candidate points for the outline of an object in the image, and an order filter that replaces the gray value of a pixel with a gray value of a predetermined rank when the gray value of a pixel in a window consisting of neighboring pixels including the pixel is arranged in order of size; For two predetermined images among the images output from the ordered filter, an edge image occupied by the cumulative histogram of the grayscale values of the two images in the entire area of the image and the edge pixel group detected by the edge detection section. a cumulative calculation unit that calculates a cumulative histogram of gray values of the two images in the area; and a total area of the image obtained by the difference for each gray value of the two cumulative histograms in the entire area of the image calculated by the cumulative calculation unit. a boundary area pixel number calculation unit that calculates a boundary pixel number histogram in the edge image area obtained by the difference for each gray value between the two cumulative histograms in the edge image area calculated by the cumulative calculation unit; Then, using the histogram of the number of boundary pixels in the entire area of the image and the histogram of the number of boundary pixels in the edge image area calculated by the boundary area pixel number calculation unit, binarize each gray value using the gray value as a threshold value. an optimal threshold determination unit that calculates the degree of coincidence between the boundary pixels of the binary image and the edge pixel group detected by the edge detection unit when The output of the optimum threshold value determining section is configured to be a threshold value for binarization.
本発明は、濃淡画像の特定な図形を処理する画像処理に
係り、特に、二値化のいき値決定方式に関する。TECHNICAL FIELD The present invention relates to image processing for processing a specific figure in a grayscale image, and particularly to a threshold value determination method for binarization.
撮像カメラ等から入力されるアナログ画像をAD変換し
てできるディジタル画像は、二次元の静止画像であり、
画素が格子上に存在する濃淡画像として表現される。各
画素の濃淡値は例えば0から25誌までのいずれかのレ
ベルに対応し、2進表示では8ビツトで表現される。与
えられた濃淡画像内の特定な物体や図形に対して認識等
を高速に実行するディジタル画像処理は、例えばベルト
コンベア上に運ばれて来た物体を視覚ロボットが認識し
拾い上げる等のファクトリ・オートメーション技術に極
めて重要となる。濃淡画像中の対象物を認識する場合に
、原画像を成るいき値で二値化して得られる二値図形が
利用されるが、この場合、最適ないき値を高速に決定す
ることが要求される。A digital image created by AD converting an analog image input from an imaging camera etc. is a two-dimensional still image.
It is expressed as a grayscale image in which pixels are arranged on a grid. The gray value of each pixel corresponds to any level from 0 to 25, for example, and is expressed in 8 bits in binary representation. Digital image processing, which performs high-speed recognition of specific objects and figures in a given grayscale image, is used in factory automation, such as when a visual robot recognizes and picks up an object carried on a conveyor belt. Becomes extremely important for technology. When recognizing objects in grayscale images, binary figures obtained by binarizing the original image using threshold values are used, but in this case, it is required to quickly determine the optimal threshold value. Ru.
従来の二値化のいき値決定方式は、原画像から対象物の
輪郭の候補、すなわちエツジを抽出したエツジ画像と、
原画像を成るいき値で二値化して得られる二値図形の境
界を抽出した境界画像の一致度をすべてのいき値に対し
て算出し、−政変が最大であるようないき値を採用して
いた。The conventional binarization threshold determination method uses an edge image in which candidates for the outline of the object, that is, edges are extracted from the original image;
The degree of coincidence of the boundary image extracted from the boundary of the binary figure obtained by binarizing the original image using the threshold values is calculated for all threshold values, and the threshold value at which the -political change is maximum is adopted. was.
第2図は従来方式の処理フローである。同図において、
濃淡値の勾配算出部20は各画素における微分の大きさ
を算出するもの、エツジ検出部21はその微分の大きさ
が所定のいき値以上となる画素を検出するもの、いき値
仮設定部22は例えば、0から255までの256個の
いずれかの整数値を仮のいき値として設定するもの、い
き値処理部23は仮に設定されたいき値によって入力画
像を二値化するもの、境界点検出部24は二値化された
二値画像の境界、すなわち、画素値が1でありしかもそ
の8近傍の少なくとも一つの画素の画素値が0であるよ
うな画素から成る境界画像を検出するもの、−成度算出
部25はエツジ検出部21からのエツジ画像と境界点検
出部24からの境界画像の一致度を算出するもの、−政
変テーブル26は仮に設定されたいき値毎のエツジ画像
と境界画像の一致度を0から255までの全てのいき値
に対して保存するもの、最適いき値決定部27は一致度
テーブル26内に保存された一致度から一致度が最大で
あるようないき値を求めてその値を最適ないき値として
出力するものである。なお、−成度算出部25において
、−政変は次式の(1)または(2)によって算出され
る。FIG. 2 shows the processing flow of the conventional method. In the same figure,
A gray value gradient calculation unit 20 calculates the magnitude of the differential at each pixel, an edge detection unit 21 detects pixels for which the magnitude of the differential is greater than or equal to a predetermined threshold value, and a threshold temporary setting unit 22 For example, the threshold value processing unit 23 is one that sets one of 256 integer values from 0 to 255 as a temporary threshold value, the threshold processing unit 23 is one that binarizes the input image according to the temporarily set threshold value, and the boundary inspection The output unit 24 detects a boundary of a binarized binary image, that is, a boundary image consisting of pixels in which the pixel value is 1 and the pixel value of at least one pixel in the 8 neighboring pixels is 0. - The growth calculation unit 25 calculates the degree of coincidence between the edge image from the edge detection unit 21 and the boundary image from the boundary point detection unit 24. - The political change table 26 calculates the degree of coincidence between the edge image from the edge detection unit 21 and the boundary image from the boundary point detection unit 24. The optimum threshold determining unit 27 stores the matching degree of the boundary image for all threshold values from 0 to 255, and selects the threshold value that maximizes the matching degree from the matching degree stored in the matching degree table 26. It calculates the value and outputs that value as the optimal threshold value. In addition, in the -growth calculation unit 25, -political change is calculated by the following equation (1) or (2).
従って、この方式では、例えば0から255までの全て
の仮のいき値に対して、いき値処理部23と境界点検出
部24における二値化処理、および、−成度算出部25
における一致度算出処理が必要となるため、膨大な処理
時間を要するという問題が生じていた。Therefore, in this method, for example, all temporary threshold values from 0 to 255 are subjected to binarization processing in the threshold processing unit 23 and the boundary point detection unit 24, and -value calculation unit 25
Since the matching degree calculation process is required, a problem arises in that a huge amount of processing time is required.
本発明は、仮のいき値を設定せずに最適ないき値を高速
に決定することの可能な二値化のいき値決定方式を提供
することを目的とする。An object of the present invention is to provide a binarization threshold determination method that can quickly determine an optimal threshold without setting a temporary threshold.
第1図は本発明の構成図であり、
濃淡画像を処理する画像処理システムにおいて、原画像
10を入力し画像中の対象物の輪郭の候補点を検出する
エツジ検出部11と、前記画像10を入力し各画素毎に
その画素を含む近傍画素から成るウィンド内の画素の濃
淡値を大きさの順にならべたときにある定められた順位
の濃淡値にその画素の濃淡値を置換する順序フィルタ1
2と、原画像10と前記順序フィルタ12から出力され
る画像のうち所定の二つの画像を対象として、画像の全
領域における前記二つの画像の濃淡値の累積ヒストグラ
ムと前記エツジ検出部11で検出されたエツジ画素群1
10によって占められるエツジ画像領域における前記二
つの画像の濃淡値の累積ヒストグラムを算出する累積算
出部1と、前記累積算出部lによって計算される画像の
全領域における二つの累積ヒストグラムの濃淡値毎の差
によって得られる画像の全領域における境界画素数ヒス
トグラムと前記累積算出部1によって計算される前記エ
ツジ画像領域における二つの累積ヒストグラムの濃淡値
毎の差によって得られるエツジ画像領域における境界画
素数ヒストグラムとを算出する境界領域画素数算出部2
と、前記境界領域画素数算出部2によって計算される前
記画像の全領域における境界画素数ヒストグラムと前記
エツジ画像領域における境界画素数ヒストグラムを用い
て濃淡値毎にその濃淡値をいき値として二値化したとき
の二値画像の境界画素と前記エツジ検出部11で検出さ
れるエツジ画素群との一致の度合いを算出してその度合
いが最大である濃淡値を出力する最適いき値決定部19
を有し、前記最適いき値決定部の出力を二値化のいき値
とすることを特徴とする二値化のいき値決定方式を示す
ものである。FIG. 1 is a block diagram of the present invention, in which an image processing system for processing a grayscale image includes an edge detection section 11 that inputs an original image 10 and detects candidate points for the outline of an object in the image; An ordering filter that replaces the gray value of each pixel with a gray value of a predetermined rank when the gray values of pixels in a window consisting of neighboring pixels including that pixel are arranged in order of size. 1
2, for two predetermined images among the original image 10 and the image output from the order filter 12, a cumulative histogram of the grayscale values of the two images in the entire area of the image is detected by the edge detection unit 11. edge pixel group 1
a cumulative calculation unit 1 that calculates a cumulative histogram of gray values of the two images in an edge image area occupied by a histogram of the number of boundary pixels in the entire area of the image obtained by the difference, and a histogram of the number of boundary pixels in the edge image region obtained by the difference for each gray value of the two cumulative histograms in the edge image region calculated by the cumulative calculation unit 1; Boundary area pixel number calculation unit 2 that calculates
Then, using the boundary pixel number histogram in the entire area of the image and the boundary pixel number histogram in the edge image area calculated by the boundary area pixel number calculation unit 2, a binary value is calculated for each gray value using the gray value as a threshold value. an optimal threshold determining unit 19 that calculates the degree of coincidence between the boundary pixels of the binary image when converted into a binary image and the edge pixel group detected by the edge detection unit 11 and outputs a gray value having the maximum degree;
This shows a threshold value determination method for binarization, characterized in that the output of the optimum threshold value determination unit is used as the threshold value for binarization.
本発明では、例えば、順序フィルタ12として最小値フ
ィルタを用いるとすれば、原画像あるいは特定な領域の
画像の境界画素数は、ヒストグラム(各濃淡値に、その
濃淡値を闇値として二値化して得られる二値画像の境界
画素数を対応させるヒストグラム)、その画像の濃淡値
に関する累積ヒストグラム−その画像を最小値フィルタ
で処理してできる画像の濃淡値に関する累積ヒストグラ
ムより算出できることを利用している。In the present invention, for example, if a minimum value filter is used as the order filter 12, the number of boundary pixels of the original image or the image of a specific area can be calculated using a histogram (each gray value is binarized with that gray value as a dark value). A histogram that correlates the number of boundary pixels of a binary image obtained by using a minimum value filter), a cumulative histogram of gray values of that image, and a cumulative histogram of gray values of an image created by processing that image with a minimum value filter. There is.
次に本発明の実施例を図面を参照して説明する。 Next, embodiments of the present invention will be described with reference to the drawings.
まず画素の離散座標Xiにおける濃淡値f (xi )
の1次元曲線を用いていくつかの言葉を定義しながら、
画像処理におけるいくつかの性質をまず述べる。画像は
二次元であるから、位置(X+、yi)における濃淡値
はf(xt、yi)で表現されるべきであるが、ここで
は、簡単のために一次元で考える。First, the gray value f (xi) at the discrete coordinates Xi of the pixel
While defining some words using the one-dimensional curve of
First, some properties of image processing will be described. Since the image is two-dimensional, the grayscale value at the position (X+, yi) should be expressed as f(xt, yi), but here, for simplicity, it will be considered one-dimensional.
第1図(C)は原図形の濃淡面vAf(x)に対する2
値化処理の概念図である。離散座標x、における濃淡値
f(Xt)はOから255の間のいずれかの値をもつが
、いき値Tいによって、
f(x、)≧ThのときBい1)=1
f (xt ) <’l’hのときB (xt )
=0とすれば、図では、
x、<X、に対してB (xt ) =Ox1 ≦X≦
x2に対してB(xt)=1x2くxIに対してB (
xl)xQ
となり、原図形の2値化系列(B (Xt ) )はO
に示されるようになる。Figure 1 (C) shows 2 for the gradation plane vAf(x) of the original figure.
It is a conceptual diagram of value conversion processing. The gradation value f(Xt) at the discrete coordinate x has any value between O and 255, but depending on the threshold value T, when f(x,)≧Th, B1)=1 f(xt ) <'l'h when B (xt)
=0, then in the figure, for x, <X, B (xt) =Ox1 ≦X≦
B (xt) = 1x2 for x2 B (
xl)xQ, and the binarized sequence (B (Xt)) of the original figure is O
will be shown.
離散座標Xiにける濃淡値がf(Xt)でその近傍X1
−1 とX、。1における濃淡値がそれぞれ’ (X
s−1) 、f (Xt++ )としたとき、原図形
を最小値フィルタに通すと、Xiにおける濃淡値f(x
i)は
m i x (f (Xt−+)、f(xυ、f (x
t、+))に置換される。ここで、minは最小なもの
を選択することを意味する記号である。また、原図形を
最大値フィルタに通すと、Xiにおける濃淡値f(xL
)は
max (f(x、、)、f (x、) 、f (xz
−+))に置換される。ここでmaxは最大なものを選
択することを意味する記号である。今、第1図(C)の
原図形の離散曲線f (x、)を最小値フィルタに通
したとすれば、最小値フィルタ通過後の図形は点線の離
散曲線g (Xt )で示される。この曲線g (Xi
)を同じいき値T1で2値化すると、最小値フィルタ
通過後の図形の2値化系列(B−(xi))は、■に示
されたものとなる。The gray value at the discrete coordinate Xi is f(Xt) and its neighborhood X1
-1 and X,. The shading values at 1 are '(X
s-1), f (Xt++ ), when the original figure is passed through a minimum value filter, the gray value f(x
i) is m i x (f (Xt-+), f(xυ, f (x
t, +)). Here, min is a symbol that means to select the smallest one. In addition, when the original figure is passed through a maximum value filter, the gradation value f(xL
) is max (f(x,,), f(x,), f(xz
−+)). Here, max is a symbol that means to select the largest one. Now, if the discrete curve f (x,) of the original figure in FIG. 1(C) is passed through a minimum value filter, the figure after passing through the minimum value filter is represented by a dotted discrete curve g (Xt ). This curve g (Xi
) is binarized using the same threshold value T1, the binarized series (B-(xi)) of the figure after passing through the minimum value filter becomes the one shown in (2).
■に示される原図形の2値化系列(B (Xi ) )
において、近傍3点のビット(B (xi−+ )、B
(xt )、B (xt、 ) )のうち少なくとも
1つが0である場合に、
B (Xt ) =0
とすることを「収縮jといい、少なくとも1つが1であ
る場合に
B (Xi ) =1
とすることを「膨張」という。また、収縮処理を実行す
るフィルタを収縮用論理フィルタといい、膨張処理を実
行するフィルタを膨張用論理フィルタという。第1図(
C)の■に示される原図形の2値化系列(B (xt
) )を収縮フィルタに通すと、■に示される2値化系
列C(B(xt))が得られ、この系列は明らかに■の
最小値フィルタ通過後の2値化系列(B□ (Xi )
)に等価である。Binarized series of the original figure shown in ■ (B (Xi))
, the bits (B (xi−+), B
(xt), B (xt, )) is 0, B (Xt) = 0 is called "contraction j," and when at least one of them is 1, B (Xi) = 1 is called "expansion." Further, a filter that performs contraction processing is referred to as a logical contraction filter, and a filter that performs expansion processing is referred to as an expansion logical filter. Figure 1 (
The binarized series (B (xt
)) through a shrinkage filter, the binary series C(B(xt)) shown in ■ is obtained, and this series is clearly the binarized series (B□ (Xi )
) is equivalent to
すなわち、
(B、 (xi ) ) =C(Bt (xt )
)となる。That is, (B, (xi)) = C(Bt (xt)
).
また、原図形の2値化系列(B Ol ) )において
、
b (Xt ) =B (Xi−+ )
OB (xt )より生成される2値化系列(b
(xt ) )は境界2値図形である。ここで0は排
他的論理和である。Also, in the binarized series of the original figure (BOl)), b (Xt) = B (Xi-+)
Binarized sequence (b
(xt)) is a boundary binary figure. Here, 0 is exclusive OR.
これに従って第1図(C)において、■の2値化系列(
B(xt))からは、■に示される境界2値図形の系列
(b(Xi))が得られる。2値系列内のビット“1”
の数□を「面積」という。境界2値図形の系列(b (
Xt ) )のビット“1”の数、すなわち面積は「境
界画素数」という。第1図(C)では、系列(b (X
i ) )に対する境界画素数は2であり、明らかに
境界画素数=原図形の2値化系列(B (Xt ) )
の面席−最小値フィルタ通過後の図形の2値化系列(B
、(Xi))の面積
または、 ・
境界画素数=原図形の2値化系列の(B(x、))の面
積−原図形の2値化後収縮した2値系列C(B (Xi
’) )の面積
が成立する。In accordance with this, in Fig. 1(C), the binarized series of ■ (
B(xt)), a series of boundary binary figures (b(Xi)) shown in ■ is obtained. Bit “1” in binary sequence
The number □ is called "area". A series of boundary binary figures (b (
The number of bits "1" in Xt ) ), that is, the area, is referred to as the "number of boundary pixels." In FIG. 1(C), the series (b (X
The number of boundary pixels for i)) is 2, and it is clear that the number of boundary pixels = the binarized series of the original figure (B (Xt))
Binarized series of figures after passing through the face-minimum filter (B
, (Xi)) or, ・Number of boundary pixels = Area of (B(x,)) of the binarized series of the original figure - Binary series C(B (Xi)) contracted after the binarization of the original figure
') ) holds true.
そこで、本発明はすべての仮いき値に対して二値化、−
成度算出の処理を実行する従来の方式と異なり、高速に
しかも従来方式と同等の結果を得ることができる二値化
のいき値決定方式で、以下に示す画像的性質1と2がま
ず利用される。Therefore, the present invention binarizes all temporary threshold values, -
Unlike the conventional method that performs the process of calculating the image quality, this threshold determination method for binarization is fast and can obtain the same results as the conventional method. be done.
比!上
最小値フィルタ処理後、二値化して得られる図形(B、
(Xt )) と二値化した後収縮用論理フィルタを施
して得られる図形C(B(Xi))は同−である。ratio! After upper minimum filter processing, the figure obtained by binarization (B,
(Xt)) and the figure C(B(Xi)) obtained by applying a shrinkage logic filter after binarization are the same as -.
五I」工
図形の境界画素数は、境界画素数=原図形の面積−収縮
後の図形の面積より算出できる。The number of boundary pixels of a 5I construction figure can be calculated from the equation: number of boundary pixels = area of original figure - area of figure after contraction.
さらに、本発明では、後述する性質3.4.5が利用さ
れるが、これらの性質を述べる前に、濃淡値のヒストグ
ラムと濃淡値の累積ヒストグラムについて説明する。Further, in the present invention, property 3.4.5, which will be described later, is utilized, but before describing these properties, a histogram of gray values and a cumulative histogram of gray values will be explained.
第1図(d)は、濃淡値f(Xs)のヒストグラムであ
り、各濃淡値の度数(画素数)を示すものである。また
、第1図(e)は、濃淡値f(Xt)の累積ヒストグラ
ムであり、いき値T7を越える濃淡値の度数を示し、例
えば、第1図(d)のヒストグラムにおいて、いき値T
hを越える濃淡値の度数は面積Sで示され、第1図(e
)の累積ヒストグラムではTh0点においての値がSと
なる。第1図(C)上で考えると、このSは区間(Xt
、’Kg )内の座標点の数であるから、■の原図形
の2値化系列(B (Xi ) )の面積(“1”の数
)に等しい。FIG. 1(d) is a histogram of the gradation values f(Xs), and shows the frequency (number of pixels) of each gradation value. FIG. 1(e) is a cumulative histogram of the gray value f(Xt), and shows the frequency of gray values exceeding the threshold value T7. For example, in the histogram of FIG. 1(d), the threshold value T
The frequency of gray values exceeding h is indicated by the area S, and is shown in Figure 1 (e
), the value at the Th0 point is S. Considering on Figure 1 (C), this S is the interval (Xt
, 'Kg), it is equal to the area (number of "1") of the binarized series (B (Xi) ) of the original figure of ■.
従って、次の性質が成立する。Therefore, the following property holds.
牲jし支
濃淡画像を二値化して得られる図形の面積はいき値によ
って変化するが、いき値と面積の関係は面積に等価な原
画像の累積ヒストグラムによって表現できる。。Although the area of the figure obtained by binarizing the gray scale image changes depending on the threshold value, the relationship between the threshold value and the area can be expressed by the cumulative histogram of the original image, which is equivalent to the area. .
1亘工
濃淡画像を二値化して得られる図形の境界画素数は、い
き値によって変化するが、
境界画素数=原画像の累積ヒストグラム−最小値フィル
タ処理後の累積ヒストグラム
によって算出できる。The number of boundary pixels of a figure obtained by binarizing a one-step gray image varies depending on the threshold value, but can be calculated as follows: Number of boundary pixels = cumulative histogram of original image - cumulative histogram after minimum filter processing.
すなわち、以上をまとめると、
境界画素数=原図形の面積−収縮後の図形の面積原図形
の面積=原画像の累積ヒストグラム収縮後の図形の面積
−最小値フィルタ処理後の画像の累積ヒストグラム
境界画素数=原画像の累積ヒストグラム−最小値フィル
タ処理後の累積ヒストグラム
となる。In other words, to summarize the above, number of boundary pixels = area of original figure - area of figure after contraction Area of original figure = cumulative histogram of original image Area of figure after contraction - cumulative histogram boundary of image after minimum value filter processing Number of pixels = cumulative histogram of original image - cumulative histogram after minimum value filter processing.
さらに、次の性質も当然成立する。Furthermore, the following property also holds true.
社fl
あらかじめ設定されたある画像領域内での境界画素数は
性質4において、累積ヒストグラムの算出をその領域内
で実行する、すなわち、その領域以外をマスクすること
によって算出できる。According to property 4, the number of boundary pixels within a preset image area can be calculated by calculating a cumulative histogram within the area, that is, by masking areas other than the area.
また、エツジ画像と境界画像の一致度の定義は、(11
弐で示したように、
で与えられる。In addition, the definition of the degree of coincidence between the edge image and the boundary image is (11
As shown in Part 2, it is given by .
性質4、性質5より上式における分子は、エツジ画像領
域における原画像の境界画素数に等価であるからエツジ
かつ境界点である画素の総数=原画像のエツジ画像領域
における累積ヒストグラム−原画像に対して最小値フィ
ルタ処理を施した後の画像に対するエツジ画像領域にお
ける累積ヒストグラムによって全てのいき値に対して同
時に算出できる。From property 4 and property 5, the numerator in the above equation is equivalent to the number of boundary pixels of the original image in the edge image area, so the total number of pixels that are edges and boundary points = cumulative histogram in the edge image area of the original image - to the original image On the other hand, all the threshold values can be calculated simultaneously using the cumulative histogram in the edge image area for the image after the minimum value filter processing.
また、式(1)の分母は、第1図(f)の集合関係を示
す図を参照すれば、エツジであるか、または、境界点で
ある画素の総数(AUB)=エツジである画素の総数(
A)十境界点数(B)−エツジかつ境界点である画素の
総数(AnB)によって算出できる。ここでUとnは、
それぞれ集合の和と交わりを表す記号である。Also, referring to the diagram showing the set relationship in Figure 1(f), the denominator of equation (1) is the total number of pixels that are edges or boundary points (AUB) = number of pixels that are edges. Total number (
A) Number of ten boundary points (B) - Total number of pixels that are edges and boundary points (AnB). Here U and n are
These symbols represent the sum and intersection of sets, respectively.
なお、(2)式に従う場合は、分母は単に境界画素数で
あるので、同様に、
境界画素数=原画像の累積ヒストグラム−最小値フィル
タ処理後の累積ヒストグラム
より算出できる。Note that when formula (2) is followed, the denominator is simply the number of boundary pixels, so it can be similarly calculated from: Number of boundary pixels = Cumulative histogram of original image - Cumulative histogram after minimum value filter processing.
第1図(b)に本実施例の構成図を示す。同図において
、第1図(a)と同じものは同じ記号が用いられる。原
画像の各画素の濃淡値を表わす画像データはlOにより
入力される。濃淡値の勾配算出部110は各画素(Xt
、Fl )を中心とした近傍8画素から成る3×3の
ウィンド微分フィルタを用いて各画素(xi 、y!
)における濃淡値の勾配の大きさを算出する。FIG. 1(b) shows a configuration diagram of this embodiment. In this figure, the same symbols are used for the same parts as in FIG. 1(a). Image data representing the gray scale value of each pixel of the original image is input by lO. The gray value gradient calculation unit 110 calculates each pixel (Xt
, Fl ), each pixel (xi , y!
) is calculated.
例えば、濃淡値の勾配の大きさΔHは
より算出できる。ここで、例えば座標(X =、yz)
における濃淡値をf (Xi 、’/= )とすればX
方向の差分Δr (Xi、yt )はΔf(xl。For example, the magnitude ΔH of the gradient of the gray value can be calculated more easily. Here, for example, the coordinates (X =, yz)
If the gradation value at is f (Xi ,'/= ), then
The difference in direction Δr (Xi, yt ) is Δf(xl.
)’ i ) =f (Xt*+ 、
)’ i ) −f (Xt 、 )’
i )で与えられ、和Σは、3×3のウィンドに対す
るΔfの和を表わす。)' i ) =f (Xt*+ ,
)' i ) −f (Xt, )'
i ), and the sum Σ represents the sum of Δf for a 3×3 window.
比較部111では濃度勾配の大きさΔHが所定のいき値
TΔHよりも大きい画素を検出する。従うて、エツジ検
出部11でエツジ画像が検出できる。最小値フィルタ1
2は3×3のウィンドを走査して、画素毎にウィンド内
の9個の画素の濃淡値の最小値を算出し、各画素(xt
、yt )の濃淡値f (Xt 、yi )をウィン
ド内の最小な濃淡値g (Xi 、V五) (1次元で
は第1図(clのg(Xi)に相当)に置換する。The comparator 111 detects pixels whose density gradient magnitude ΔH is larger than a predetermined threshold value TΔH. Therefore, the edge detection section 11 can detect an edge image. Minimum filter 1
2 scans a 3×3 window, calculates the minimum gray value of the 9 pixels in the window for each pixel, and calculates each pixel (xt
, yt ) is replaced with the minimum gradation value g (Xi , V5) within the window (corresponding to g(Xi) in FIG. 1 (cl) in one dimension).
13.14.15.16は第1図(alの累積算出部に
相当する。13の累積ヒストグラム算出部1はまず、1
0から入力される原画像を走査して、累積ヒストグラム
を算出する。第1図(g)は累積ヒストグラム算出部1
の構成図である。13, 14, 15, and 16 correspond to the cumulative calculation unit in FIG.
A cumulative histogram is calculated by scanning the original image input from 0. FIG. 1(g) shows the cumulative histogram calculation unit 1.
FIG.
具体的には濃淡値レベルに対応する1から256の番地
を持つヒストグラムメモリ130を最初にオールゼロに
クリアしておき、入力画像10を走査して各画素(xi
、yi)の濃淡値「 (X4、ylに対応する番地の内
容に1を加算して行く。Specifically, the histogram memory 130, which has addresses 1 to 256 corresponding to the gray level, is first cleared to all zeros, and the input image 10 is scanned to obtain each pixel (xi
, yi) ``1 is added to the contents of the address corresponding to (X4, yl).
画像を全て走査し終わったときのヒストグラムメモリ1
30の内容が濃淡値のヒストグラムを表現している。つ
まり、N番地の内容は濃淡値がレベルNである画素の総
数を表している。すなわち、濃淡値ヒストグラム算出用
制御部131は入力した濃淡値Nでヒストグラムメモリ
130をアクセスし、読み出した内容に1を加えて再び
アドレスNに書き込む制御を実行する。つぎに、累積ヒ
ストグラム算出部132は濃淡値ヒストグラムを濃淡値
の高いほうから累積して、累積ヒストグラムを算出する
。具体的にはヒストグラムメモリ130の256番地の
内容はそのまま、255番地から出発して、1番地まで
N番地の内容=N番地の内容子N+1番地の内容・−−
−−−−−−−−−−−−−−−−−(4)の演算を順
次行なうことによって得られる。Histogram memory 1 when all images have been scanned
The contents of 30 represent a histogram of gray values. In other words, the contents of address N represent the total number of pixels whose gray value is level N. That is, the gradation value histogram calculation control unit 131 accesses the histogram memory 130 using the input gradation value N, adds 1 to the read content, and executes control to write the read content to address N again. Next, the cumulative histogram calculation unit 132 calculates a cumulative histogram by accumulating the gray value histograms from the highest gray value. Specifically, the contents of address 256 of the histogram memory 130 remain as they are, starting from address 255 and continuing up to address 1.Content of address N=Content of address N Content of address N+1・--
--------------------(4) is obtained by sequentially performing the calculation.
14の累積ヒストグラム算出部2は最小値フィルタ12
の出力に対して、13の累積ヒストグラム算出部1の処
理と同一の処理を行い、最小値フィルタ処理後の画像の
累積ヒストグラムすなわち、収縮後の図形の面積を算出
する。14 cumulative histogram calculation unit 2 is a minimum value filter 12
The same processing as that of the cumulative histogram calculation unit 1 of 13 is performed on the output of , and the cumulative histogram of the image after the minimum value filter processing, that is, the area of the figure after contraction is calculated.
15の累積ヒストグラム算出部3はエツジ検出部11で
検出されたエツジ画素と同一画素における原画像10の
濃淡値を入力し、累積ヒストグラム算出部1の処理と同
一の処理を行って、エツジ画像領域における原画像の累
積ヒストグラムを算出する。15, the cumulative histogram calculation unit 3 inputs the grayscale values of the original image 10 at the same pixels as the edge pixels detected by the edge detection unit 11, performs the same processing as the cumulative histogram calculation unit 1, and calculates the edge image area. Calculate the cumulative histogram of the original image at .
16の累積ヒストグラム算出部4はエツジ検出部11で
検出されたエツジ画素と同一画素における最小濃淡値g
(Xi % Y* )を最小値フィルタ12の出力よ
り入力し、累積ヒストグラム算出部1の処理と同一の処
理を行って、エツジ画像領域における最小値フィルタ処
理を施した後の画像の累積ヒストグラムを算出する。16 cumulative histogram calculation unit 4 calculates the minimum gray value g at the same pixel as the edge pixel detected by the edge detection unit 11.
(Xi % Y*) is input from the output of the minimum value filter 12, and the same processing as that of the cumulative histogram calculation unit 1 is performed to obtain the cumulative histogram of the image after minimum value filter processing in the edge image area. calculate.
17の境界画素数ヒストグラム算出部1は13の累積ヒ
ストグラム算出部1におけるヒストグラムメモリと14
の累積ヒストグラム算出部2におけるヒストグラムメモ
リの番地毎の差を算出し、性質4に従って原画像をある
いき値で二値化したときの境界画素数を算出する。同様
に、18の境界画素数ヒストグラム算出部2は15の累
積ヒストグラム算出部3におけるヒストグラムメモリと
16の累積ヒストグラム算出部4におけるヒストグラム
メモリの番地毎の差を算出し、性質4に従って、原画像
をあるいき値で二値化したときのエツジ画像領域におけ
る境界画素数を算出する。すなわち、17と18は第1
図+8)の境界領域画素数算出部2に相当する。The 17 boundary pixel number histogram calculation unit 1 has a histogram memory in the 13 cumulative histogram calculation unit 1 and the 14
The cumulative histogram calculation unit 2 calculates the difference between each address of the histogram memory, and calculates the number of boundary pixels when the original image is binarized with a certain threshold value according to Property 4. Similarly, the 18 boundary pixel number histogram calculation units 2 calculate the difference for each address between the histogram memory in the 15 cumulative histogram calculation units 3 and the histogram memory in the 16 cumulative histogram calculation units 4, and according to property 4, calculate the original image. The number of boundary pixels in the edge image area when binarized using a certain threshold value is calculated. That is, 17 and 18 are the first
This corresponds to the boundary area pixel number calculation unit 2 in Figure 8).
19の最適いき値決定部では、18の境界画素数ヒスト
グラム算出部2の出力における濃淡値毎の度数(境界画
素数)を分子とし、17の境界画素数ヒストグラム算出
部lの出力である境界点である画素の総数(B)と18
の境界画素数ヒストグラム算出部2の出力であるエツジ
かつ境界である画素の総数(AnB)とさらに工、ジで
ある画素の総数(A)を入力し、(A)+ (B)−(
AnB)を分母とし、その比を濃淡値毎に算出し、その
値が最大である濃淡値を最適ないき値として出力する。In the optimum threshold determination section 19, the frequency of each gray value (boundary pixel number) in the output of the boundary pixel number histogram calculation section 18 is used as the numerator, and the boundary point which is the output of the boundary pixel number histogram calculation section 17 is used as the numerator. The total number of pixels (B) and 18
Input the total number of pixels that are edges and boundaries (AnB), which is the output of the boundary pixel number histogram calculation unit 2, and the total number of pixels that are edges and edges (A), and calculate (A) + (B) - (
AnB) is used as the denominator, the ratio is calculated for each gray value, and the gray value with the maximum value is output as the optimal threshold value.
なお、本実施例は、例えば、最小値フィルタ12、累積
ヒストグラム算出部(112,3,4)は専用のハード
ウェアで実現し、17.18の境界点数ヒストグラム算
出部1.2および最適いき値決定部19はマイクロプロ
セッサによるアルゴリズムで実現できる。In this embodiment, for example, the minimum value filter 12 and the cumulative histogram calculation unit (112, 3, 4) are realized by dedicated hardware, and the boundary point number histogram calculation unit 1.2 of 17.18 and the optimal threshold The determining unit 19 can be realized by an algorithm using a microprocessor.
上述した性質l、2.3.4をそれぞれ拡張かつ一般化
すると次のようになる。Expanding and generalizing the above-mentioned properties 1 and 2.3.4, respectively, result in the following.
性質1
最大値(最小値)フィルタ処理後、二値化して得られる
図形と、二値化した後、収縮用論理フィルタを施して得
られる図形は同一である。Property 1: The figure obtained by binarizing after maximum value (minimum value) filter processing is the same as the figure obtained by applying a contraction logical filter after binarization.
性質2 図形の境界点数は、次の三方法で算出できる。Property 2 The number of boundary points of a figure can be calculated using the following three methods.
(1)原図形の面積−収縮後の図形の面積(2)膨張後
の図形の面積−原図形の面積(3)(膨張後の図形の面
積−収縮後の図形の面積)/2性質3
濃淡画像を二値化して得られる図形の面積はいき値によ
って変化するが、いき値と面積の関係は面積に等価な原
画像の累積ヒストグラムによって表現できる。(1) Area of the original figure - Area of the figure after contraction (2) Area of the figure after expansion - Area of the original figure (3) (Area of the figure after expansion - Area of the figure after contraction) / 2 Property 3 The area of a figure obtained by binarizing a grayscale image changes depending on the threshold value, but the relationship between the threshold value and the area can be expressed by the cumulative histogram of the original image, which is equivalent to the area.
性質4
濃淡画像を二値化して得られる図形の境界画素数はいき
値によって変化するが、いき値と境界画素数の関係は、
性質2の項で記載した3方法に応じて、
(1) 原画像の累積ヒストグラム−最小値フィルタ
処理後の累積ヒストグラム
(2)最大値フィルタ処理後の累積ヒストグラム−原画
像の累積ヒストグラム
(3) 最大値フィルタ処理後のヒストグラム−最小
値フィルタ処理後の累積ヒストグラム
によって算出できる。 ゛
前記性質4(2)に基づくものとしては、本実施例にお
いて最小値フィルタ12を最大値フィルタで置き換えれ
ばよい。また前記性質4(3)に基づくものとしては、
最大値フィルタと最小値フィルタの二つを設け、累積ヒ
ストグラム算出部1.3には最大値フィルタの出力を送
り、累積ヒストグラム算出部2.4には最小値フィルタ
の出力を送れば良い。Property 4 The number of boundary pixels of a figure obtained by binarizing a grayscale image changes depending on the threshold value, but the relationship between the threshold value and the number of boundary pixels is as follows.
According to the three methods described in the section of Property 2, (1) Cumulative histogram of the original image - Cumulative histogram after minimum value filter processing (2) Cumulative histogram after maximum value filter processing - Cumulative histogram of the original image (3) It can be calculated using the histogram after maximum value filtering and the cumulative histogram after minimum value filtering. ``Based on property 4(2), the minimum value filter 12 in this embodiment may be replaced with a maximum value filter. Also, based on property 4(3),
Two filters, a maximum value filter and a minimum value filter, may be provided, and the output of the maximum value filter may be sent to the cumulative histogram calculation section 1.3, and the output of the minimum value filter may be sent to the cumulative histogram calculation section 2.4.
なお、最大値フィルタや最小値フィルタの代わりにウィ
ンド内で二番目に大きい画素値や二番目に小さな画素値
を出力するフィルタを利用しても良い。この場合には、
孤立的な雑音に影響されない結果を得ることができる。Note that instead of the maximum value filter or the minimum value filter, a filter that outputs the second largest pixel value or second smallest pixel value within the window may be used. In this case,
It is possible to obtain results that are not affected by isolated noise.
また、ウィンドの形状としては、3×3以外に、中心画
素および、その画素と4連結の意味で連結している画素
からなるウィンドを用いることもできるし、ウィンド形
状を可変としてもよい。Further, as for the shape of the window, other than 3×3, a window consisting of a central pixel and pixels connected to that pixel in the sense of 4-connection may be used, or the window shape may be made variable.
また、エツジ検出部11では、濃淡値の勾配の大きさが
濃淡値の勾配の方向にそって極大となっている画素を検
出するものでもよい。また、エツジ検出部11は濃淡値
の二次の微分値を検出するガウシアンブラシアンの値が
正から負または負から正に変化する画素を検出するもの
でもよい。Further, the edge detection unit 11 may detect a pixel in which the magnitude of the gradient of the gradation value is maximum along the direction of the gradient of the gradation value. Further, the edge detection unit 11 may detect pixels in which the value of a Gaussian Brassian, which detects the second-order differential value of the gradation value, changes from positive to negative or from negative to positive.
さらに、他の実現形態としては、空間フィルタUtM淡
値の勾配算出部)、いき値処理(エツジ検出部)、順序
フィルタ(最小値フィルタ)、ヒストグラム算出(累積
ヒストグラム算出部)などの機能を専用のハードウェア
、あるいは汎用計算機上のソフトウェアとして備える画
像処理装置において、境界点ヒストグラム算出部、最適
いき値決定部の機能を付加し、さらに全体を制御するソ
フトウェアを備えることによっても実現できる。Furthermore, as another implementation form, functions such as spatial filter UtM gradient calculation unit), threshold processing (edge detection unit), order filter (minimum value filter), and histogram calculation (cumulative histogram calculation unit) are dedicated. This can also be realized by adding the functions of a boundary point histogram calculation section and an optimum threshold value determination section to an image processing apparatus provided as hardware or software on a general-purpose computer, and further providing software that controls the entire system.
本発明によれば、最適ないき値を従来よりも数十倍から
数百倍も高速に得ることができる。According to the present invention, the optimal threshold value can be obtained several tens to hundreds of times faster than conventional techniques.
第1図(a)は本発明の構成図、
第1図(blは本実施例の構成図、
第1図(C1は原図形の濃淡曲線f (x)に対する
2値化処理の概念図、
第1図(d)は濃淡値のヒストグラム、第1図(e)は
濃淡値の累積ヒストグラム、第1図(f)は集合関係を
示す図、
第1図(幻は累積ヒストグラム算出部1の構成図、第2
図は従来方式の処理フロー図である。
1・・・累積算出部、
2・・・境界領域画素数算出部、
11・・・エツジ検出部、
12・・・順序フィルタ、
19・・・最適いき値決定部。Figure 1 (a) is a block diagram of the present invention; Figure 1 (bl is a block diagram of the present embodiment; Figure 1 (C1 is a conceptual diagram of binarization processing for the gradation curve f (x) of the original figure); FIG. 1(d) is a histogram of gray values, FIG. 1(e) is a cumulative histogram of gray values, FIG. 1(f) is a diagram showing set relationships, Configuration diagram, 2nd
The figure is a processing flow diagram of a conventional method. DESCRIPTION OF SYMBOLS 1... Accumulation calculating unit, 2... Boundary area pixel number calculating unit, 11... Edge detecting unit, 12... Ordinal filter, 19... Optimal threshold determining unit.
Claims (1)
を検出するエッジ検出部(11)と、前記画像(10)
を入力し各画素毎にその画素を含む近傍画素から成るウ
ィンド内の画素の濃淡値を大きさの順にならべたときに
ある定められた順位の濃淡値にその画素の濃淡値を置換
する順序フィルタ(12)と、 原画像(10)と前記順序フィルタ(12)から出力さ
れる画像のうち所定の二つの画像を対象として、画像の
全領域における前記二つの画像の濃淡値の累積ヒストグ
ラムと前記エッジ検出部(11)で検出されたエッジ画
素群(110)によって占められるエッジ画像領域にお
ける前記二つの画像の濃淡値の累積ヒストグラムを算出
する累積算出部(1)と、 前記累積算出部(1)によって計算される画像の全領域
における二つの累積ヒストグラムの濃淡値毎の差によっ
て得られる画像の全領域における境界画素数ヒストグラ
ムと前記累積算出部(1)によって計算される前記エッ
ジ画像領域における二つの累積ヒストグラムの濃淡値毎
の差によって得られるエッジ画像領域における境界画素
数ヒストグラムとを算出する境界領域画素数算出部(2
)と、 前記境界領域画素数算出部(2)によって計算される前
記画像の全領域における境界画素数ヒストグラムと前記
エッジ画像領域における境界画素数ヒストグラムを用い
て濃淡値毎にその濃淡値をいき値として二値化したとき
の二値画像の境界画素と前記エッジ検出部(11)で検
出されるエッジ画素群との一致の度合いを算出してその
度合いが最大である濃淡値を出力する最適いき値決定部
(19)を有し、 前記最適いき値決定部の出力を二値化のいき値とするこ
とを特徴とする二値化のいき値決定方式。 2)前記順序フィルタ(12)は定められた順位が1位
、すなわち、最大値フィルタを用いることを特徴とする
請求項1記載の二値化のいき値決定方式。 3)前記順序フィルタ(12)は定められた順位が最後
位、すなわち、最小値フィルタを用いることを特徴とす
る請求項1記載の二値化のいき値決定方式。 4)前記順序フィルタ(12)として、定められた順位
が1位、すなわち、最大値フィルタと定められた順位が
最後位、すなわち、最小値フィルタの両者を備えること
を特徴とする請求項1記載の二値化のいき値決定方式。 5)前記順序フィルタ(12)は定めるべき順位が可変
であることを特徴とする請求項1記載の二値化のいき値
決定方式。 6)前記順序フィルタ(12)はウィンド形状が可変で
あることを特徴とする請求項1、2、3、4、または5
記載の二値化のいき値決定方式。 7)前記累積算出部(1)は所定の画像として原画像と
順序フィルタ処理後の画像を用いることを特徴とする請
求項1記載の二値化のいき値決定方式。 8)前記累積算出部(1)は所定の画像として定められ
た順位が一位である前記順序フィルタ処理後の画像と定
められた順位が最後位である前記順序フィルタ処理後の
画像を用いることを特徴とする請求項1記載の二値化の
いき値決定方式。 9)前記累積算出部(1)は所定の画像として前記順序
フィルタにおいて順位を変えて処理した二つの処理結果
の画像を用いることを特徴とする請求項1記載の二値化
のいき値決定方式。 10)前記累積算出部(1)は、濃淡値の各レベルに対
応する番地を持つヒストグラムメモリと、入力画像を走
査して各画素の濃淡値に対応する前記番地のヒストグラ
ムメモリ内容をインクリメントして行く濃淡値ヒストグ
ラム算出用制御部と、前記インクリメントの動作終了時
に前記ヒストグラムメモリに格納された濃淡値ヒストグ
ラムの内容を累積する累積ヒストグラム算出部を有する
ことを特徴とする請求項1記載の二値化のいき値決定方
式。 11)前記最適いき値決定部(19)は、エッジ検出部
(11)で検出された画素群によって占められるエッジ
画像領域における境界画素数ヒストグラムにおいて、度
数が最大である濃淡値を最適ないき値として出力するこ
とを特徴とする請求項1記載の二値化のいき値決定方式
。 12)前記最適いき値決定部(19)は、エッジ検出部
(11)で検出された画素群によって占められるエッジ
画像領域における境界画素数ヒストグラムの濃淡値毎の
度数を分子とし、画像の全領域における境界画素数ヒス
トグラムの濃淡値毎の度数を分母とするような比が最大
である濃淡値を最適ないき値として出力することを特徴
とする請求項1記載の二値化のいき値決定方式。 13)前記最適いき値決定部(19)は、エッジ検出部
(11)で検出された画素群によって占められるエッジ
画像領域における境界画素数ヒストグラムの濃淡値毎の
度数を分子とし、画像の全領域における境界画素数ヒス
トグラムの濃淡値毎の度数とエッジ検出部(11)によ
ってエッジとして検出された画素の総数との和からエッ
ジ検出部(11)で検出された画素群によって占められ
るエッジ画像領域における境界画素数ヒストグラムの濃
淡値毎の度数を差し引いたものを分母とするような比が
最大である濃淡値を最適ないき値として出力することを
特徴とする請求項1記載の二値化のいき値決定方式。 14)前記エッジ検出部(11)は各画素の近傍で濃淡
値が急激に変化している画素を検出することを特徴とす
る請求項1記載の二値化のいき値決定方式。 15)前記エッジ検出部(11)は濃淡値の勾配の大き
さが濃淡値の勾配の方向にそって極大となっている画素
を検出することを特徴とする請求項1記載の二値化のい
き値決定方式。 16)前記エッジ検出部(11)はガウシァンラプラシ
アン(濃淡値の二次の微分値を検出する手段)の値が正
から負または負から正に変化する画素を検出することを
特徴とする請求項1記載の二値化のいき値決定方式。[Scope of Claims] 1) An image processing system that processes a grayscale image, comprising: an edge detection unit (11) that inputs an original image (10) and detects candidate points for the outline of an object in the image; 10)
An ordering filter that replaces the gray value of each pixel with a gray value of a predetermined rank when the gray values of pixels in a window consisting of neighboring pixels including that pixel are arranged in order of size. (12), and a cumulative histogram of gray values of the two images in the entire area of the image, and a cumulative calculation unit (1) that calculates a cumulative histogram of gray values of the two images in an edge image area occupied by the edge pixel group (110) detected by the edge detection unit (11); ), the boundary pixel number histogram in the entire area of the image obtained by the difference between the two cumulative histograms for each gray level in the entire area of the image, and the two in the edge image area calculated by the cumulative calculation unit (1) Boundary area pixel number calculation unit (2
), and using the histogram of the number of boundary pixels in the entire area of the image and the histogram of the number of boundary pixels in the edge image area calculated by the boundary area pixel number calculation unit (2), the gray value is set as a threshold value for each gray value. The optimum algorithm calculates the degree of coincidence between the boundary pixels of the binary image when binarized as , and the edge pixel group detected by the edge detection unit (11), and outputs the gray value with the maximum degree of coincidence. A threshold value determination method for binarization, comprising a value determination unit (19), and an output of the optimal threshold determination unit is used as a threshold value for binarization. 2) The threshold value determination method for binarization according to claim 1, wherein the order filter (12) uses a maximum value filter having a predetermined first rank. 3) The threshold value determination method for binarization according to claim 1, characterized in that said order filter (12) uses a minimum value filter whose predetermined rank is last. 4) The ordered filter (12) includes both a first-ranked filter, that is, a maximum value filter, and a lowest-value filter, that is, a minimum value filter. threshold determination method for binarization. 5) The binarization threshold determination method according to claim 1, wherein the order filter (12) has a variable order. 6) Claim 1, 2, 3, 4, or 5, wherein the ordered filter (12) has a variable window shape.
Threshold value determination method for binarization described. 7) The binarization threshold determination method according to claim 1, wherein the cumulative calculation unit (1) uses an original image and an image after sequential filter processing as the predetermined images. 8) The cumulative calculation unit (1) uses, as a predetermined image, the image after the sequential filter processing in which the predetermined ranking is the first, and the image after the sequential filter processing in which the predetermined ranking is the last. The binarization threshold determination method according to claim 1, characterized in that: 9) The threshold value determination method for binarization according to claim 1, wherein the cumulative calculation unit (1) uses, as the predetermined images, images resulting from two processes processed by changing the order in the order filter. . 10) The cumulative calculation unit (1) scans the input image with a histogram memory having an address corresponding to each level of gray value, and increments the contents of the histogram memory at the address corresponding to the gray value of each pixel. 2. The binarization system according to claim 1, further comprising: a control section for calculating a gray value histogram, and a cumulative histogram calculating section for accumulating the contents of the gray value histogram stored in the histogram memory when the increment operation ends. threshold determination method. 11) The optimal threshold determining unit (19) determines the gray value having the maximum frequency as the optimal threshold in the boundary pixel number histogram in the edge image area occupied by the pixel group detected by the edge detecting unit (11). 2. The binarization threshold determination method according to claim 1, wherein: 12) The optimum threshold determining unit (19) uses the frequency for each gray value of the boundary pixel number histogram in the edge image area occupied by the pixel group detected by the edge detecting unit (11) as a numerator, and calculates the frequency of each gray value in the entire area of the image. 2. The binarization threshold determination method according to claim 1, wherein a gray value having a maximum ratio such that the denominator is a frequency of each gray value in a boundary pixel number histogram is output as the optimal threshold value. . 13) The optimum threshold value determination unit (19) uses the frequency for each gray value of the boundary pixel number histogram in the edge image area occupied by the pixel group detected by the edge detection unit (11) as a numerator, and calculates the frequency of each gray value in the entire area of the image. In the edge image area occupied by the pixel group detected by the edge detection section (11), from the sum of the frequency for each gray value of the boundary pixel number histogram in and the total number of pixels detected as an edge by the edge detection section (11). 2. The binarization process according to claim 1, wherein the gradation value having the maximum ratio such that the denominator is a value obtained by subtracting the frequency of each gradation value of the boundary pixel number histogram is output as the optimum threshold value. Value determination method. 14) The binarization threshold determination method according to claim 1, wherein the edge detection unit (11) detects a pixel whose gray value changes rapidly in the vicinity of each pixel. 15) The binarization method according to claim 1, wherein the edge detection unit (11) detects a pixel in which the magnitude of the gradient of the gradation value is maximum along the direction of the gradient of the gradation value. Threshold value determination method. 16) The edge detection unit (11) is characterized in that it detects pixels in which the value of a Gaussian Laplacian (a means for detecting a second-order differential value of a gray value) changes from positive to negative or from negative to positive. The binarization threshold determination method according to claim 1.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP63008462A JPH0715705B2 (en) | 1988-01-20 | 1988-01-20 | Thresholding device for binarization |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP63008462A JPH0715705B2 (en) | 1988-01-20 | 1988-01-20 | Thresholding device for binarization |
Publications (2)
Publication Number | Publication Date |
---|---|
JPH01184583A true JPH01184583A (en) | 1989-07-24 |
JPH0715705B2 JPH0715705B2 (en) | 1995-02-22 |
Family
ID=11693798
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP63008462A Expired - Fee Related JPH0715705B2 (en) | 1988-01-20 | 1988-01-20 | Thresholding device for binarization |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH0715705B2 (en) |
-
1988
- 1988-01-20 JP JP63008462A patent/JPH0715705B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JPH0715705B2 (en) | 1995-02-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Lee et al. | Morphologic edge detection | |
JPH09510809A (en) | Method and apparatus for determining a fine azimuth of a barcode symbol in a two-dimensional CDD image | |
JPS62154179A (en) | Multivalue image processing apparatus and method | |
CN110570442A (en) | Contour detection method under complex background, terminal device and storage medium | |
Li et al. | Multi-scale morphologic tracking approach for edge detection | |
JPH01184583A (en) | System for deciding binarization threshold value | |
JP2520443B2 (en) | Thresholding method for binarization | |
JP3164835B2 (en) | Pre-processing method and post-processing method in human image recognition | |
KR20000025647A (en) | Method for processing image using shading algorithm | |
CN114332890A (en) | Table structure extraction method and device, electronic equipment and storage medium | |
Vacavant et al. | Topological and geometrical reconstruction of complex objects on irregular isothetic grids | |
Bartliff | An automatic procedure for image segmentation | |
Ablameyko et al. | Knowledge-based recognition of crosshatched areas in engineering drawings | |
JP2846173B2 (en) | Image processing device | |
Sakou et al. | Texture Discrimination Using Self‐Organized Multiresolution Filtering | |
JPH0812695B2 (en) | Area extraction device | |
JP2859453B2 (en) | Image thinning method | |
JPH05266194A (en) | Outline extracting device | |
JP2935847B2 (en) | Image processing device | |
JPH01162992A (en) | Image processing system | |
JPS60118987A (en) | Peak extraction processing unit | |
JPH0498470A (en) | Classifying system for line width of linear diagram | |
JPH07109612B2 (en) | Image processing method | |
JPH0232481A (en) | Peak data extractor | |
CN116612297A (en) | Contour feature fused image line segment extraction method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
LAPS | Cancellation because of no payment of annual fees |