JPH01239678A - Binary threshold value deciding system - Google Patents

Binary threshold value deciding system

Info

Publication number
JPH01239678A
JPH01239678A JP63064697A JP6469788A JPH01239678A JP H01239678 A JPH01239678 A JP H01239678A JP 63064697 A JP63064697 A JP 63064697A JP 6469788 A JP6469788 A JP 6469788A JP H01239678 A JPH01239678 A JP H01239678A
Authority
JP
Japan
Prior art keywords
image
cumulative histogram
value
threshold value
pixel
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
Application number
JP63064697A
Other languages
Japanese (ja)
Other versions
JP2520443B2 (en
Inventor
Takashi Torii
鳥井 隆
Toshio Endo
利生 遠藤
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP63064697A priority Critical patent/JP2520443B2/en
Publication of JPH01239678A publication Critical patent/JPH01239678A/en
Application granted granted Critical
Publication of JP2520443B2 publication Critical patent/JP2520443B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Image Input (AREA)
  • Image Processing (AREA)
  • Closed-Circuit Television Systems (AREA)

Abstract

PURPOSE:To decide the optimum threshold value to binarize a light-and-shade picture by using two two-dimensional cumulative histogram calculating means to calculate the value of an image element after passing a differential filter and a memory effectively. CONSTITUTION:The title system is provided with a concentration gradient calculation part 1 to calculate the size of concentration gradient in a picture by using a window differential filter, and a minimum value filter 3 to replace a central image element by the minimum image element in a window. The threshold values theta1 and theta2 to generate the output of first and second two-dimensional cumulative histogram calculation parts 17 and 18 to calculate the number of image elements whose image element value after passing filter 1 exceeds the threshold value theta1 and whose image element after passing a filter 3 and the one of an original picture value exceed the threshold value theta2 for all of the theta1 and theta2, and cumulative histogram calculation parts 9, 10, and 16 so as to set at the maximum degree of coincidence are detected by a coincidence calculation part 19 and an optimum threshold value decision part 15. Therefore, it is possible to decide the optimum threshold value by performing one time of scan of the picture.

Description

【発明の詳細な説明】 〔概   要〕 濃淡画像の特定な図形を処理する画像処理に係り、特に
、2値化のいき値決定方式に関し、bツ淡画像を2値化
するための最適ないき値を高速かつ高精度に決定する2
値化のいき値決定方式を提供することを目的とし、 濃淡画像を処理する画像処理システムにおいて、画像中
の濃度勾配の大きさを画素毎に算出する濃度勾配算出手
段と、画素毎にその画素を含むある形状のウィンド内の
画素値を大きさの順に並べたときにある定められた順位
である画素値を出力する順序フィルタ手段と、原画素の
画素値がいき値02以上である画素の総数を全てのθ2
に対して算出する第1の累積ヒストグラム算出手段と、
順次フィルタ手段通過後の画素値がいき値02以上であ
る画素の総数を全てのθ2に対して算出する第2の累積
ヒストグラム算出手段と、濃度勾配算出手段通過後の画
素値がいき値01以上である画素の総数を全ての01に
対して算出する第3の累積ヒストグラム算出手段と、濃
度勾配算出手段通過後の画素値がいき値01以上であり
かつ順序フィルタ手段通過後の画素値がいき埴θ2以上
である画素の総数を全てのθ1とθ2に対して算出する
第1の2次元累積ヒストグラム算出手段と、δコ度勾配
算出手段通過後の画素値がいき値01以上であり原画像
の画素値がいき値02以上である画素の総数を全てのθ
1とθ2に対して算出する第2の2次元累積ヒストグラ
ム算出手段吉、第1゜第2及び第3の累積ヒストグラム
算出手段及び第1と第2の2次元累積ヒストグラムの結
果から濃度勾配算出処理後の画像をいき値θ1で2値化
してi4られるエツジと原画像をいき値θ2で2値化し
て得られる図形の境界の一致度をθ1とθ2の全ての組
合せに対して算出する一致度算出手段と、一致度が最大
となるθ1と02を1!i!出する最適いき値決定手段
とを備えいき値θ1と02を同時に決定するように構成
する。
[Detailed Description of the Invention] [Summary] This invention relates to image processing for processing specific shapes of grayscale images, and particularly relates to a threshold value determination method for binarization. Determining threshold values quickly and with high precision 2
The purpose of the present invention is to provide a method for determining a threshold value for value conversion, and in an image processing system that processes gray scale images, the present invention provides a density gradient calculation means for calculating the magnitude of a density gradient in an image for each pixel, and a density gradient calculation means for calculating the magnitude of a density gradient in an image for each pixel. order filter means for outputting pixel values in a certain predetermined order when the pixel values in a window of a certain shape containing are arranged in order of size; The total number of all θ2
a first cumulative histogram calculation means for calculating the
a second cumulative histogram calculation means that sequentially calculates the total number of pixels whose pixel values after passing through the filter means are equal to or higher than the threshold value 02 for all θ2; a third cumulative histogram calculation means for calculating the total number of pixels for all 01, and a third cumulative histogram calculation means for calculating the total number of pixels for all 01; A first two-dimensional cumulative histogram calculation means that calculates the total number of pixels that are equal to or greater than θ2 for all θ1 and θ2, and a pixel value after passing through the δ gradient calculation means that is equal to or greater than the threshold value 01 and is the original image. The total number of pixels whose pixel value is greater than or equal to the threshold value 02 for all θ
A second two-dimensional cumulative histogram calculating means calculates for 1 and θ2, a second and a third cumulative histogram calculating means, and a concentration gradient calculation process from the results of the first and second two-dimensional cumulative histograms. Matching degree is calculated for all combinations of θ1 and θ2 between edges obtained by binarizing the subsequent image with threshold value θ1 and i4 and boundaries of figures obtained by binarizing the original image with threshold value θ2. Calculation means and θ1 and 02 where the degree of coincidence is maximum are set to 1! i! and optimum threshold value determination means for determining the threshold values θ1 and 02 at the same time.

〔産業上の利用分野〕[Industrial application field]

本発明は、濃淡画像の特定な図形を処理する画像処理に
係り、特に、2値化のいき値決定方式に関する。
TECHNICAL FIELD The present invention relates to image processing for processing specific figures in grayscale images, and particularly to a binarization threshold determination method.

IM 像カメラ等から入力されるアナログ画像をAD変
換してできるディジタル画像は、2次元の静止画像であ
り、画素が格子上に存在する濃淡画像として表現される
。各画素の濃淡値は例えば0がら255までのいずれか
のレベルに対応し、この場合2進表示では8ビツトで表
現される。与えられた濃淡画像内の特定な物体や図形に
対して認識等を高速に実行するディジタル画像処理は、
例えばベルトコンベア上に運ばれて来た物体を視覚ロボ
ットが認識し拾い上げる等のファクトリ・オートメーシ
ョン技術に極めて重要となる。濃淡画像中の対象物を認
識する場合に、原画像を成るいき値C2値化して得られ
る2値図形が利用されるが、この場合、最適ないき値を
高速に決定することが要求される。
A digital image created by AD converting an analog image input from an IM image camera or the like is a two-dimensional still image, and is expressed as a grayscale image in which pixels exist on a grid. The gray value of each pixel corresponds to any level from 0 to 255, for example, and in this case is expressed in 8 bits in binary representation. Digital image processing, which quickly performs recognition of specific objects and figures in a given grayscale image, is
For example, it will be extremely important for factory automation technology, such as visual robots recognizing and picking up objects carried on a conveyor belt. When recognizing an object in a grayscale image, a binary figure obtained by converting the original image into a threshold C binarization is used, but in this case, it is required to quickly determine the optimal threshold. .

〔従来の技術〕[Conventional technology]

従来の2値化のいき値決定方式は、原画像から対象物の
輪郭の候補、すなわちエツジを抽出したエツジ画像と、
原画像を成るいき値で2値化して得られる2値′図形の
境界を抽出した境界画像の一致度を全てのいき値に対し
て算出し、一致度が最大であるようないき値を採用して
いた。
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;
Binary values obtained by binarizing the original image with the threshold values ``The degree of coincidence of the boundary image extracted from the boundary of the figure is calculated for all threshold values, and the threshold value with the maximum degree of coincidence is adopted. Was.

第9図は第1の従来方式の処理フローである。FIG. 9 is a processing flow of the first conventional method.

同図において、濃度勾配算出部1は各画素における微分
の大きさを算出するもの、エツジ検出部2はその微分の
大きさが所定のいき値以上となる画素を検出するもの、
いき値仮設定部3は例えば、Oから255までの256
個のいずれかの整数値を仮のいき値として設定するもの
、いき値処理部4は仮に設定されたいき値によっ゛ζ入
力画像を2値化するもの、境界点検出部5は2値化され
た2値画像の境界、すなわち、画素値が1でありしかも
その8近傍の少なくとも1つの画素の画素値が0である
ような画素から成る境界画像を検出するもの、一致度算
出部6はエツジ検出部2からのエツジ画像と境界点検出
部5からの境界画像の一致度を算出するもの、一致度テ
ーブル7は仮に設定されたいき値毎のエツジ画像と境界
画像の一致度をOから255までの全てのいき値に対し
て保存するもの、最適いき値決定部8は一致度テーブル
7内に保存された一致度から一致度が最大であるような
いき値を求めてその値を最適ないき値として出力するも
のである。なお、一致度算出部6において、一致度は次
式の(11または(2)によって算出される。
In the figure, a density gradient calculating section 1 calculates the magnitude of the differential at each pixel, an edge detecting section 2 detects pixels for which the magnitude of the differential is greater than or equal to a predetermined threshold value,
For example, the threshold temporary setting unit 3 sets 256 values from O to 255.
The threshold processing section 4 binarizes the ζ input image according to the provisionally set threshold value, and the boundary point detection section 5 sets the integer value as a temporary threshold value. A coincidence calculation unit 6 that detects a boundary of a converted binary image, that is, a boundary image consisting of pixels whose pixel value is 1 and at least one pixel in its 8 neighboring pixels has a pixel value of 0. is used to calculate the degree of coincidence between the edge image from the edge detection section 2 and the boundary image from the boundary point detection section 5, and the degree of coincidence table 7 is used to calculate the degree of coincidence between the edge image and the boundary image for each temporarily set threshold value. The optimal threshold value determining unit 8 determines the threshold value that maximizes the degree of coincidence from the degrees of coincidence saved in the degree of coincidence table 7, and calculates that value. This is output as the optimal threshold value. In addition, in the matching degree calculation unit 6, the matching degree is calculated by the following equation (11 or (2)).

第10図は特願昭63−8462号において本発明者が
開示した第2の従来方式のブロック図である。
FIG. 10 is a block diagram of the second conventional system disclosed by the present inventor in Japanese Patent Application No. 8462/1983.

b5度勾配算出部1では各画素における微分の大きさを
算出し、エツジ検出部2では微分の大きさが所定のいき
値以上である画素すなわち、画像中の対象物の輪郭の候
補点を検出する。最小値フィルタ3はそれぞれの画素に
おいてその画素を中心とする所定の近傍内における画素
値の最小値を出力するもので、−船釣には近傍の画素の
濃淡値を大きさの順に並べたときにある定められた順位
の濃淡値に五摸する順序フィルタの1つである。
The b5 degree gradient calculation unit 1 calculates the magnitude of the differential at each pixel, and the edge detection unit 2 detects pixels where the magnitude of the differential is greater than a predetermined threshold, that is, candidate points for the outline of the object in the image. do. The minimum value filter 3 outputs, for each pixel, the minimum value of the pixel value within a predetermined neighborhood centered on that pixel. This is one of the order filters that selects gray values in a predetermined order.

累積ヒストグラム算出部9〜12はそれぞれ累積ヒスト
グラムすなわち、0から255までの各95度値に対し
て、画素値がその濃度以上であるような画素の総数を算
出する。境界点数ヒストグラム算出部13.14はそれ
ぞれ入力される2つの累1¥7ヒストグラムのzツ度値
毎の差を算出するものであり、境界点ヒノ、トゲラム算
出部13の出力は境界点である画素の総数を表しており
、境界点ヒストグラム算出部14の出力はエツジかつ境
界点である画素の総数を表している。
The cumulative histogram calculation units 9 to 12 each calculate the cumulative histogram, that is, the total number of pixels whose pixel value is equal to or higher than the density for each 95 degree value from 0 to 255. The boundary point number histogram calculation units 13 and 14 calculate the difference for each z-degree value of the two inputted cumulative histograms, and the output of the boundary point Hino and Togerum calculation unit 13 is a boundary point. It represents the total number of pixels, and the output of the boundary point histogram calculation unit 14 represents the total number of pixels that are edges and boundary points.

最適いき値決定部15では、境界点である画素の総数、
エツジかつ境界点である画素の総数、エツジである画素
の総数の三者から式(1)が最大となるいき値を選択出
力する。
The optimal threshold determination unit 15 determines the total number of pixels that are boundary points,
The threshold value that maximizes equation (1) is selected and output from the total number of pixels that are edges and boundary points, and the total number of pixels that are edges.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

第1の従来方式では、例えばOから255までの全ての
仮のいき値に対しζ、いき値処理部4と境界点検出部5
における2値化処理、及び一致度算出部6における一致
度算出処理が必要となるため、膨大な処理時間を要する
という第1の問題が生じていた。
In the first conventional method, for example, for all temporary thresholds from O to 255, the threshold processing unit 4 and the boundary point detection unit 5
Since the binarization process in step 1 and the match degree calculation process in match degree calculation section 6 are required, the first problem arises in that an enormous amount of processing time is required.

第2の従来方式は、原画像の2値化に対する仮のいき値
を設定せずに最適ないき値を高速に決定するもので、膨
大な処理時間を要するという第1の問題点を解決するが
、エツジ検出時のいき値を予め設定しておく必要があり
、そのエツジ検出時のいき値が適切でないと処理結果の
積度が悪いという第2の問題点が生じていた。
The second conventional method quickly determines the optimal threshold value for binarizing the original image without setting a temporary threshold value, which solves the first problem of requiring a huge amount of processing time. However, it is necessary to set a threshold value for edge detection in advance, and a second problem arises in that if the threshold value for edge detection is not appropriate, the processing results will be poor.

本発明は、濃淡画像を2値化するための最適ないき値を
高速かつ高精度に決定する2値化のいき値決定方式を提
供することを目的とする。
SUMMARY OF THE INVENTION An object of the present invention is to provide a binarization threshold determination method that quickly and accurately determines an optimal threshold for binarizing a grayscale image.

〔課題を解決するための手段〕[Means to solve the problem]

第1図は本発明のブロック図である。 FIG. 1 is a block diagram of the present invention.

濃度勾配算出手段1は画像中の濃度勾配の大きさを算出
するもので、例えば各画素を中心とした近(38画素か
ら成る3×3のウィンド微分フィルタを用いるもの、順
序フィルタ手段3は画素毎にその画素を含むある形状の
ウィンド内の画素値を大ぎさの順に並べたときにある定
められた順位である画素値を出力するもので、例えば3
×3のウィンドで画像を走査し、ウィンド内の9111
i1の画素値のうち最小値で中心画素を置き換える最小
値フィルタを用いるもの、第1の累積ヒストグラム算出
手段9は原画像の画素値がいき値02以上である画素の
総数を全てのθ2に対して算出するもの、第2の累積ヒ
ストグラム算出手段10は順序フィルタ手段3通過後の
画素値がいき値02以上である画素の総数を全ての02
に対して算出するもの、第3の累積ヒストグラム算出手
段16は濃度勾配算出手段1311過後の画素値がいき
値01以上である画素の総数を全ての01に対して算出
するもの、第1の2次元累積ヒストグラム、算出手段1
7は濃度勾配算出手段1m通過後画素値がいき値01以
上であり、かつ順序フィルタ手段3通過後の画素値がい
き値02以上である画素の総数を全てのθ1とθ2に対
して算出するもの、第2の2次元累積ヒストグラム算出
手段18は濃度勾配算出手段1通過後の画素値がいき値
01以上であり、かつ原画像の画素値がいき値02以上
である画素の総 ・数を全てのθ1とθ2に対して算出
するもの、一致度算出手段19は第1.第2及び第3の
累積ヒストグラム算出手段9,10.16及び第1と第
2の2次元累積ヒストグラム算出手段17.18の結果
から’b1度勾配算出処理後の画像をいき値θ1で2値
化して得られる工・7ジと原画像をいき値θ2で2値化
して得られる図形の境界の一致度をθIとθ2の全ての
組合せに対して算出するもの、最適いき値決定手段15
は一致度が最大となるθJとθ2を検出するもので、本
発明はいき値θlとθ2を同時に決定することを特徴と
する。
The density gradient calculating means 1 calculates the magnitude of the density gradient in an image. For example, the density gradient calculating means 3 calculates the magnitude of the density gradient in an image. When the pixel values in a window of a certain shape containing that pixel are arranged in order of size, the pixel values are output in a predetermined order.For example, 3
Scan the image with a ×3 window and 9111 in the window
The first cumulative histogram calculating means 9 uses a minimum value filter that replaces the center pixel with the minimum value among the pixel values of i1. The second cumulative histogram calculation means 10 calculates the total number of pixels whose pixel value after passing through the sequential filter means 3 is equal to or higher than the threshold value 02.
The third cumulative histogram calculation means 16 calculates the total number of pixels whose pixel values after passing through the density gradient calculation means 1311 are equal to or higher than the threshold value 01 for all 01. Dimensional cumulative histogram, calculation means 1
7 calculates, for all θ1 and θ2, the total number of pixels whose pixel value after passing through 1 m of concentration gradient calculating means is equal to or greater than the threshold value 01, and whose pixel value after passing through the order filter means 3 is equal to or greater than the threshold value 02. The second two-dimensional cumulative histogram calculating means 18 calculates the total number of pixels whose pixel values after passing through the density gradient calculating means 1 are equal to or higher than the threshold value 01, and whose pixel values in the original image are equal to or higher than the threshold value 02. The coincidence calculation means 19, which is calculated for all θ1 and θ2, is the first one. From the results of the second and third cumulative histogram calculation means 9 and 10.16 and the first and second two-dimensional cumulative histogram calculation means 17.18, the image after the 'b1 degree gradient calculation process is binary-valued at the threshold value θ1. Optimum threshold determining means 15, which calculates the degree of coincidence of the boundary of the figure obtained by binarizing the resulting image and the original image with a threshold value θ2 for all combinations of θI and θ2.
The method detects θJ and θ2 that have the maximum degree of coincidence, and the present invention is characterized in that the threshold values θl and θ2 are determined simultaneously.

〔作   用) 本発明では、微分フィルタ通過後の画素値がいき値01
以上であり、かつ最小値フィルタ通過後の画素値がいき
値02以上である画素の総数を全ての01とθ2に対し
て算出する第1の2次元累、債ヒストグラム算出手段と
、微分フィルタ通過後の画素値がいき値01以上であり
、かつ原画像の画素値がいき値02以上である画素の総
数を全てのθ1とθ2に対して算出する第2の2次元累
、債ヒストグラム算出f段をメモリを有効に用いて構成
することによって、画像を1回走査するだりで、lな2
つのいき値θ1とθ2を決定している。
[Function] In the present invention, the pixel value after passing through the differential filter is the threshold value 01.
and a first two-dimensional cumulative histogram calculating means for calculating the total number of pixels whose pixel values are equal to or higher than the threshold value 02 after passing through the minimum value filter for all 01 and θ2, and passing through the differential filter. A second two-dimensional cumulative histogram calculation f that calculates the total number of pixels whose subsequent pixel value is equal to or greater than the threshold value 01 and whose pixel value in the original image is equal to or greater than the threshold value 02 for all θ1 and θ2. By configuring the stages using memory effectively, it is possible to scan the image once,
Two threshold values θ1 and θ2 are determined.

〔実  施  例〕〔Example〕

次に本発明の実施例を図面を参照して説明する。 Next, embodiments of the present invention will be described with reference to the drawings.

本発明は、エツジ検出のいき値θ1と原画像を2値化す
るためのいき値02の2つのいき値に対して式(1)の
一致度を算出し、最適ないき値θ1とθ2を決定するも
ので、先ずθ2の決定方式を簡単に述べる。
The present invention calculates the degree of coincidence of equation (1) for two thresholds, θ1 for edge detection and 02 for binarizing the original image, and calculates the optimal thresholds θ1 and θ2. First, the method for determining θ2 will be briefly described.

第5図は原図形の濃淡曲線r  (x)に対する2値化
処理の概念図である。簡単化のため、ここでは1次元曲
線が用いられる。離散座標x1におけろ濃淡値f(x+
)は0から255の間のいずれかの値をもつが、いき値
θ2によって、 f(xl)≧θ2のときB(x+)=1f(x+)<θ
2のときB(x+)−〇とすれば、図では、 xlぐxlに対してB (x +) =OX1≦X≦x
2に対してB(x+)=IX?<XIに対してB (x
 +) =0となり、原図形の2値化系列(B(x+)
)は■に示されるようになる。
FIG. 5 is a conceptual diagram of the binarization process for the gradation curve r(x) of the original figure. For simplicity, a one-dimensional curve is used here. At the discrete coordinate x1, the gray value f(x+
) has any value between 0 and 255, but depending on the threshold value θ2, when f(xl)≧θ2, B(x+)=1f(x+)<θ
2, then B(x+)-〇, in the figure, B(x+) =OX1≦X≦x for xl×xl
B(x+)=IX for 2? <B for XI (x
+) = 0, and the binarized series of the original figure (B(x+)
) will be shown in ■.

離散座標x1における濃淡値がf(x+)でその近傍x
1−1とx+++における濃淡値がそれぞれf  (x
+−+)、  f  (x+++)としたとき、原図形
を最小値フィルタに通すと、X己こおける濃淡値f(x
+)は、 mix (f  (x l+ +) 、  f  (x
 +) 。
The gray value at discrete coordinate x1 is f(x+) and its neighborhood x
The gray values at 1-1 and x+++ are f (x
+−+), f (x+++), if the original figure is passed through a minimum value filter, the shading value f(x
+) is mix (f (x l+ +), f (x
+).

f(x+++)) に置換される。ここでminは最小なものを選択するこ
とを意味する記号である。また、原図形を最大値フィル
タに通すと、XIにおける濃淡値f(xI)は、 max (f  (x+−1)、f  (x+)。
f(x+++)). Here, min is a symbol that means selecting the minimum value. Moreover, when the original figure is passed through a maximum value filter, the gradation value f(xI) at XI is max (f (x+-1), f (x+).

f (Xl+1)) に置換される。ここでmaxは最大なものを選択するこ
とを意味する記号である。今離散曲線f(x+)を最小
値フィルタに通したとすれば、最小値フィルタ通過後の
図形は点線の離散曲線g(x+)で示される。この曲線
g(x+)を同じいき値θ2で2値化すると、最小値フ
ィルタ通過後の2値化系列(B、n (x +))は、
■に示されたものとなる。
f (Xl+1)). Here, max is a symbol that means to select the largest one. If the discrete curve f(x+) is now passed through a minimum value filter, the figure after passing through the minimum value filter is represented by a dotted discrete curve g(x+). When this curve g(x+) is binarized with the same threshold value θ2, the binarized series (B, n (x +)) after passing through the minimum value filter is:
It will be as shown in ■.

■に示される原図形の2値化系列(B (x +) 1
において、近傍3点のビット (B(XI−i)、B 
(x+)、  B (x+++))のうち少なくとも1
つがOである場合に、 13(x+)=0 とすることを「収縮」といい、少なくとも1つが■であ
る場合に、 B(xI)=1 とすることを「膨張」という。また、収縮処理を実行す
るフィルタを収縮用論理フィルタといい、膨張処理を実
行するフィルタを膨張用論理フィルタという。第5図の
■に示される原図形の2値化系列(B(xI))を収縮
フィルタに通すと、■に示される2値化系列C(B(x
I))が得られ、この系列は明らかにOの最小値フィル
タ通過後の2値化系列(B、(x +)lに等価である
。すなわち、 (B111(x +) )  =C(B (x +) 
)となる。
The binarized series of the original figure shown in ■ (B (x +) 1
, the bits of the three neighboring points (B(XI-i), B
(x+), B (x+++))
When at least one is O, setting 13(x+)=0 is called "contraction," and when at least one is ■, setting 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. When the binarized series (B(xI)) of the original figure shown in ■ in FIG. 5 is passed through a contraction filter, the binarized series C(B(x
I)) is obtained, and this sequence is clearly equivalent to the binarized sequence (B, (x +)l after passing through the minimum value filter of O. That is, (B111(x +) ) = C(B (x +)
).

また、原図形の2値化系列(B(xI))におい°で、 b (x +) =B (x + −+)○B(xI)
より生成される2値化系列(b(xI))は境界2値図
形である。ここで0は排他的論理和である。
Also, in the binarized series (B(xI)) of the original figure, b (x +) = B (x + -+)○B(xI)
The binary series (b(xI)) generated by is a boundary binary figure. Here, 0 is exclusive OR.

従って第5図において、■の2値化系列(B(xI))
からはeに示される境界2値図形の系列(b(xI))
が得られる。2値系列内のビット“1”の数を「面積」
という。境界2値図形の系列(b(xI))のビット“
1”の数、すなわち面積は「境界画素数」という。第5
図では、系列(b(xI))に対する境界画素数は2で
あり、明らかに 境界画素数=原図形の2値化系列(B(xI))の面債
−最小値フィルタ通過後の図形の2値化系列(Bln(
xI))の面積、 または、 境界画素数−原図形の2値化系列(B(XI))の面積
−原図形の2値化後収縮した2値系列C(B(xI))
の面積、 が成立する。すなわち、 性質l 最小値フィルタ処理後、2値化して得られる図形(B、
、(X l)) と2値化した後収縮用論理フィルタを
施して得られる図形C(B(xI)l は同一である。
Therefore, in Fig. 5, the binary series of ■ (B(xI))
From is the series of boundary binary figures shown in e (b(xI))
is obtained. The number of bits “1” in a binary series is the “area”
That's what it means. The bits of the boundary binary figure series (b(xI))
The number of 1", that is, the area is called the "number of boundary pixels." Fifth
In the figure, the number of boundary pixels for the series (b(xI)) is 2, and clearly the number of boundary pixels = the surface area of the binarized series (B(xI)) of the original figure - the figure after passing through the minimum value filter. Binarized series (Bln(
xI)) area, or: Number of boundary pixels - Area of the binarized series of the original figure (B(XI)) - Binary series C (B(xI)) contracted after the binarization of the original figure
The area of , holds true. That is, property l After minimum value filter processing, the figure obtained by binarization (B,
, (X l)) and the figure C(B(xI)l obtained by applying a contraction logic filter after binarization) are the same.

性質2 図形の境界画素数は、 境界画素数−原図形の面積−収縮後の図形の面積 より算出できる。Property 2 The number of boundary pixels of the figure is Number of boundary pixels - Area of original figure - Area of figure after contraction It can be calculated from

次に濃淡値のヒストグラムと濃淡値の累積ヒス!・ダラ
ムについて説明する。
Next is the histogram of the gradation values and the cumulative histogram of the gradation values!・Explain about Durham.

第6図は、濃淡値f(xI)のヒストグラムであり、各
濃淡値の度数(画素数)を示すものである。また、第7
図は、濃淡値f(xI)の累積ヒストグラムであり、い
き値θ2を越える濃淡値の度数を示し、例えば、第6図
のヒストグラムにおいて、いき値θ2を越える濃淡値の
度数は面積Sで示され、第7図の累積ヒストグラムでは
θ2の点においての値がSとなる。第5図上で考えると
、このSは区間(XI、X2)内の座標点の数であるこ
とがら■の原図形の2値化系列(B(xI))の面積(
“1”の数)に等しい。
FIG. 6 is a histogram of the gradation values f(xI), and shows the frequency (number of pixels) of each gradation value. Also, the seventh
The figure is a cumulative histogram of gradation values f(xI), which shows the frequency of gradation values that exceed the threshold value θ2. For example, in the histogram of FIG. In the cumulative histogram shown in FIG. 7, the value at the point θ2 is S. Considering in Figure 5, since this S is the number of coordinate points in the interval (XI, X2), the area of the binary series (B(xI)) of the original figure of
equal to the number of “1”).

従って、次の性質が成立する。Therefore, the following property holds.

)υ1よ 濃淡画像を2値化して得られる図形の面積はいき値によ
って変化するが、いき値と面積の関係は面積に等価な原
画像の累積ヒストグラムによって表現できる。
) υ1 The area of the figure obtained by binarizing the 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値化して得られる図形の境界画素数は、い
き値によって変化するが、 境界画素数−原画像の累積ヒストグラム・−最小値フィ
ルタ処理後の累積ヒストグラムによって算出できる。
Property 4 The number of boundary pixels of a figure obtained by binarizing a grayscale image changes depending on the threshold value, but can be calculated by: Number of boundary pixels - Cumulative histogram of original image - Cumulative histogram after minimum value filter processing.

すなわち、以上をまとめると、 境界画素数−原図形の面積 一収縮後の図形の面積 原図形の面積−原画像の累積ヒストグラJ・収縮後の図
形の面、債=最小値フィルタ処理後の画像の累積ヒスト
グラム 境界画素数=原画像の累、債ヒストグラムー最小値フィ
ルタ処理後の累積ヒストグラムとなる。
In other words, to summarize the above, the number of boundary pixels - the area of the original figure - the area of the figure after contraction - the area of the original figure - the cumulative histogram of the original image - the surface of the figure after contraction, bond = image after minimum value filtering Cumulative histogram boundary pixel number = original image cumulative histogram - cumulative histogram after minimum value filter processing.

さらに、次の性質も当然成立する。Furthermore, the following property also holds true.

性質5 予め設定されたある両1象領域内での境界画素数は4土
質4において、累積ヒストグラJ・の算出をその領域内
で実行する、すなわち、その領域以外をマン、りするこ
とによって算出できる。
Property 5: The number of boundary pixels in a certain pre-set quadrant area is calculated by calculating the cumulative histogram J within that area, in other words, by manipulating areas other than that area. can.

また、エツジiIj像と境界画像の一致度の定流は、(
1)式で示したように、 ・ ・ ・ ・ (1) で2与えられる。
In addition, the constant flow of the degree of coincidence between the edge IIj image and the boundary image is (
As shown in formula 1), ・ ・ ・ ・ (1) gives 2.

性質4、性質5より上式における分子は、エツジ画像鎖
酸における原画像の境界画素数に等価であるからエツジ
かつ境界点である画素の総数−原画1象のエツジ画像領
域における累積ヒストグラJ・−原画像に対して最小値
フィルタ処理を施した後の画像に対するエツジ画像領域
における累、積ヒストグラノ・によって全てのいき値に
対して同時に算出できる。
From property 4 and property 5, the molecule in the above formula is equivalent to the number of boundary pixels of the original image in the edge image chain acid, so the total number of pixels that are edges and boundary points - the cumulative histogram in the edge image area of one original image J. - All threshold values can be calculated simultaneously using the cumulative and product histograno in the edge image area for the image after minimum value filtering has been applied to the original image.

また、式(1)の分母は、第8図の集合関係を示す図を
参照すれば、エツジであるか、または、境界点である画
素の総数(AtJB)=エツジである画素の総数(A)
 十境界画素数(B)−エツジかつ境界点である画素の
1.9数(AnB)によゲで算出できる。ここで、Uと
口は、それぞれ集合の和と交わりを表す記号である。
Further, the denominator of equation (1) is the total number of pixels that are edges or boundary points (AtJB) = the total number of pixels that are edges (A )
It can be calculated by subtracting the number of pixels that are edges and boundary points (AnB) from the number of pixels that are edges and boundary points (AnB). Here, U and mouth are symbols representing the sum and intersection of sets, respectively.

しかし、以上の説明は、原画像を2値化するためのいき
値θ2を変化させたときの境界画素数を正確に決定して
いるが、エツジ検出のいき値θ1を変化させたときのエ
ツジである画素の+9数を決定していない。そごで、以
下において、エツジ検出のいき値θ1をも同時に変化さ
せてθ1.θ2の全ての組み合わせに対して式(1)を
算出し、一致度が最大となるθI、θ2を同時に決定す
る方法を述べる。
However, in the above explanation, the number of boundary pixels is accurately determined when changing the threshold value θ2 for binarizing the original image, but the number of boundary pixels when changing the threshold value θ1 for edge detection is determined accurately. The +9 number of pixels that is +9 has not been determined. Therefore, in the following, the threshold value θ1 for edge detection is also changed at the same time, and θ1. A method will be described in which equation (1) is calculated for all combinations of θ2 and θI and θ2 with the maximum degree of coincidence are determined simultaneously.

累積ヒストグラムとは、横軸が濃度で、縦軸は画素値が
その濃度以上であるような画素の総数を表すヒストグラ
ムで、最小値フィルタとは、2次元画像上では、3×3
のウィンドで画像を走査し、ウィンド内の9個の画素値
のうちの最小値で中心画素を置き換える処理をするフィ
ルタである・また微分フィルタとは、各画素において濃
度勾配の大きさを算出して出力するフィルタで、例えば
X方向の微分値とY方向の微分値を算出し、それらの値
の自乗用のルート(正の平方根)を出力するフィルタで
ある。また、2次元累、債ヒス]・ダラムとは、一方の
画像の画素値が01以上でありもう一方の画1象の画素
値がθ2であるような画素のIB故を表すヒストグラム
である。これらの言葉を用いて、以下に本発明の詳細な
説明するための記号を定義する。
A cumulative histogram is a histogram in which the horizontal axis represents the density and the vertical axis represents the total number of pixels whose pixel value is greater than or equal to that density.The minimum value filter is a 3x3
It is a filter that scans an image in a window and replaces the center pixel with the minimum value of the nine pixel values within the window. Also, a differential filter calculates the magnitude of the density gradient at each pixel. For example, this is a filter that calculates a differential value in the X direction and a differential value in the Y direction, and outputs the square root (positive square root) of these values. In addition, a two-dimensional histogram is a histogram representing the IB behavior of pixels such that the pixel value of one image is 01 or more and the pixel value of the other image is θ2. Using these words, symbols for detailed explanation of the present invention will be defined below.

原画像の累積ヒストグラムをI−((θ2)1、最小値
フィルタ処理後の累積ヒストグラムをM(θ2)、i2
&分フィルタ処理後の累積ヒストグラムをE(θ1)、
微分フィルタ処理後の画像と原画(象の2次元累積ヒス
トグラムをEH(θl、θ2)、微分フィルタ処理後の
画像と最小値フィルタ処理後の画像の2次元累積ヒスト
グラムをEM (、θ1.θ2)とする。
The cumulative histogram of the original image is I-((θ2)1, and the cumulative histogram after minimum filter processing is M(θ2), i2
The cumulative histogram after & minute filter processing is E(θ1),
The image after differential filter processing and the original image (the two-dimensional cumulative histogram of the elephant is EH (θl, θ2), and the two-dimensional cumulative histogram of the image after differential filter processing and the image after minimum filter processing is EM (, θ1.θ2) shall be.

画素値が1であってしかもその画素に隣接する8画素の
うち少なくとも1つの画素値がOであるような画素を2
値画像の境界画素と定義すると、まず、性質4と等価な
次の定理1が成立する。
2 pixels whose pixel value is 1 and at least one pixel value of 8 pixels adjacent to that pixel is O.
When defined as a boundary pixel of a value image, the following Theorem 1, which is equivalent to Property 4, holds true.

ぬm1 いき値θ2で2値化したときの境界画素数は、境界画素
数−H(θ2)M(θ2)・・・(2)で与えられる。
The number of boundary pixels when binarized with the threshold value θ2 is given by the number of boundary pixels−H(θ2)M(θ2) (2).

この定理の一般的な証明は、付録として最後に述べる。A general proof of this theorem is given at the end as an appendix.

また、エツジである画素数は各画素において0コ度勾配
を算出し、その値が01以上となる画素数を求めればよ
いから、微分フィルタ処理後の累積ヒストグラムとなる
。従ゲて次の定理2が成立する。
Further, the number of pixels that are edges can be determined by calculating the 0 degree gradient for each pixel and finding the number of pixels for which the value is 01 or more, so the cumulative histogram is obtained after differential filter processing. Accordingly, the following Theorem 2 holds true.

之皿主 いき値θ1でエツジ)食出したときの工・ノジである画
素数は、 エツジの数−E(θ1)       ・・・(3)で
与えられる。
The number of pixels that are the edges when the main threshold value θ1 starts is given by the number of edges - E(θ1) (3).

今、?a淡画像八へいき値θ2で2値化して得られる2
値画1象をB、八に対して最小値フィルタを施した画像
をC1八に対して微分フィルタを施した画像をDとする
。また、八において画素値が62以上である画素の’J
合をΣ、Cにおい°ζ画素値が02以上である画素の集
合をΔ、Dにおいて画素値が01以上である画素の集合
を■とする。このとき定理1のH(θ2)−M(θ2)
は原画像の画素値が62以上である画素の集合であって
、最小値フィルタ後の画素値が02以上とはならない画
素の集合であるから、記号を用いれば(Σ口λ)に等価
となる。従って、エツジかつ境界である画素のiL合は
、 1’1rl(Σ口Δ)          ・・・(5
)である。また、最小値を有する画素は画素集合の要素
であるから、最小値フィルタ後θ2以上である画素の集
合ΔはΣに含まれる。すなわち、(Σ「)λ)は、Σの
要素数からΔの要素数を差し引いたものとなる。従って
、(5)式は(n口Σ)の要素数から(nnΔ)の要素
数を差し引いたものを意味し、エツジかつ境界である画
素の総数はnかつΣである画素の総数El((θ1.θ
2)から■かつΔである画素の総数EM(θ1.θ2)
を差し引いたものに等しい。よって次の定理3が成立す
る。
now,? 2 obtained by binarizing a light image 8 with threshold value θ2
Let B be the value image 1, C1 be the image obtained by applying the minimum value filter to 8, and D be the image obtained by applying the differential filter to 8. In addition, 'J' of the pixel whose pixel value is 62 or more in 8
The sum is Σ, the set of pixels whose pixel value is 02 or more in C is Δ, and the set of pixels whose pixel value is 01 or more in D is . In this case, H(θ2)−M(θ2) of Theorem 1
is a set of pixels whose pixel value in the original image is 62 or more, but whose pixel value after the minimum value filter is not 02 or more, so using symbols, it is equivalent to (Σmouth λ). Become. Therefore, the iL combination of pixels that are edges and boundaries is 1'1rl (Σmouth Δ) ... (5
). Furthermore, since the pixel having the minimum value is an element of a pixel set, the set Δ of pixels whose value is θ2 or more after the minimum value filter is included in Σ. In other words, (Σ")λ) is the number of elements of Σ minus the number of elements of Δ. Therefore, equation (5) is calculated by subtracting the number of elements of (nnΔ) from the number of elements of (n-mouth Σ). The total number of pixels that are edges and boundaries is the total number of pixels that are n and Σ El ((θ1.θ
From 2), the total number of pixels EM (θ1.θ2) that is ■ and Δ
is equal to minus Therefore, the following Theorem 3 holds true.

之1工 いき値θ1でエツジ検出し、いき値θ2で原画像を2値
化したとき、エツジであり、かつ境界である画素の数は
、 エツジかつ境界の数=EH(θ1.θ2)−EM (θ
l、θ2)・・・(6) で与えられる。
When edges are detected using a threshold value θ1 and the original image is binarized using a threshold value θ2, the number of pixels that are edges and boundaries is as follows: Number of edges and boundaries = EH (θ1.θ2) − EM (θ
l, θ2)...(6) It is given by:

また、第8図の集合関係を示す図を参照すれば、エツジ
または境界点である画素の総数は、エツジである画素の
総数(E (θ1)〕モ境界画素数(H(θ2)−M(
θ2)〕−エエラかつ境界の画素数(EH(θ1.θ2
)−EM (θ1.θ2))となる。すなわち、次の定
理4が成立する。
Furthermore, referring to the diagram showing the set relationship in FIG. 8, the total number of pixels that are edges or boundary points is the total number of pixels that are edges (E (θ1)), the number of boundary pixels (H (θ2) - M (
θ2)] - number of pixels at the error and boundary (EH(θ1.θ2
)−EM (θ1.θ2)). That is, the following Theorem 4 holds true.

定理4 いき値θ1でエツジ検出し、いき値θ2で原画像を2値
化したとき、エツジであるか、または、境界である画素
の数は、 エツジまたは境界の数− E(θ、)+H(θ2)M(θ2) −(El((θl、θ2)−EM (θ1.θ2)〕・
・・(7) で与えられる。
Theorem 4 When edges are detected with a threshold value θ1 and the original image is binarized with a threshold value θ2, the number of pixels that are edges or boundaries is: Number of edges or boundaries − E (θ, ) + H (θ2)M(θ2) −(El((θl, θ2)−EM (θ1.θ2))]・
...(7) is given by.

これら四定理より一致度を算出する式(1)は、・・・
・(8) で算出できる。
Formula (1) for calculating the degree of coincidence from these four theorems is...
・It can be calculated using (8).

第2図は本実施例の構成図である。同図において、第1
図と同じものは同じ記号が用いられる。
FIG. 2 is a configuration diagram of this embodiment. In the same figure, the first
The same symbols are used for the same items as in the figure.

原画像の各画素の濃淡値を表す画像データは同図20に
より入力される。濃度勾配算出部1は各画素(xt、y
+)を中心とした近傍8画素から成る3×3のウィンド
微分フィルタを用いて各画素(x +、 ’y +)に
おける濃淡値の勾配の大きさを算出する。例えば、濃淡
値の勾配の大きさΔ■]は、・ ・ ・(9) より算出できる。ここで例えば座標(xt、y+)にお
ける濃淡値をf  (xt、y+)とすればX方向の差
分Δf  (xt、y+)はΔf  (x l+  y
 + )−f  (fx++、y+)   (xt、y
+)で与えられ、和Σは、3×3のウィンドに対するΔ
fの和を表す。
Image data representing the gray scale value of each pixel of the original image is inputted as shown in FIG. The concentration gradient calculation unit 1 calculates each pixel (xt, y
The magnitude of the gradient of the gray value at each pixel (x+,'y+) is calculated using a 3×3 window differential filter consisting of eight neighboring pixels centered on pixel (x+, 'y+). For example, the magnitude Δ■ of the gradient of the gray value can be calculated from (9). For example, if the gray value at the coordinates (xt, y+) is f (xt, y+), then the difference Δf (xt, y+) in the X direction is Δf (x l+ y
+ )−f (fx++, y+) (xt, y
+), and the sum Σ is given by Δ for a 3×3 window
represents the sum of f.

最小値フィルタ3は3×3のウィンドを走査して、画素
毎にウィンド内の9個の画素の濃淡値の最小値を算出し
、各画素(xt、y+)の濃淡値f  (xt、y+)
をウィンド内の最小な濃淡値g(xt、y+)(1次元
では第5図のg(xt)に相当)に置換する。
The minimum value filter 3 scans a 3×3 window, calculates the minimum value of the grayscale values of nine pixels in the window for each pixel, and calculates the grayscale value f (xt, y+) of each pixel (xt, y+). )
is replaced with the minimum gray value g(xt, y+) within the window (corresponding to g(xt) in FIG. 5 in one dimension).

同図9.10.及び16は累積ヒストグラム算出部に相
当する。累、債ヒストグラム算出部(1)9はまず、2
0から入力される原画像を走査して、累積ヒストグラム
を算出する。第3図は本発明の累積ヒストグラム算出部
(1)の構成図である。
Figure 9.10. and 16 correspond to a cumulative histogram calculating section. The bond histogram calculation unit (1) 9 first calculates 2
A cumulative histogram is calculated by scanning the original image input from 0. FIG. 3 is a configuration diagram of the cumulative histogram calculating section (1) of the present invention.

具体的には濃淡値レベルに対応する1から256の番地
を持つヒストグラムメEす21を最初にオールゼロにク
リアしておき、入力画像20を走査し°ζ各画素(x+
、y+)の濃淡値r  (x+、y+)に対応する番地
の内容に1を加算して行く。画像を全て走査し終わった
ときのヒストグラムメモリ21の内容が濃淡値のヒスト
ダラムを表現している。つまり、N番地の内容は濃淡値
がレベルNである画素のt8数を表している。すなわち
、画素値ヒストグラム算出用制御部22は入力したθコ
淡値NでヒスI・グラムメモリ21をアクセスし、読み
出した内容に1を加えて再びアドレスNに書き込む制御
を実行する。次に累積ヒストグラノ・算出部23は濃淡
値ヒストグラムを濃淡値の高いほうから累積して、累積
ヒストグラJ2を算出する。具体的にはヒストグラムメ
モリ21の256番地の内容はそのまま、255番地か
ら出発して、1番地まで、N番地の内容− N番地の内容十N+1番地の内容 ・ ・ ・ ・ 00) の演算を順次行うことによってi写られる。
Specifically, the histogram image 21, which has addresses from 1 to 256 corresponding to the gray level, is first cleared to all zeros, the input image 20 is scanned, and each pixel (x+
, y+), 1 is added to the contents of the address corresponding to the gray value r (x+, y+). The contents of the histogram memory 21 when the entire image has been scanned expresses a histogram of gray values. In other words, the contents of address N represent the t8 number of pixels whose gray value is level N. That is, the pixel value histogram calculation control unit 22 accesses the hiss I/gram memory 21 with the input θ value N, adds 1 to the read content, and executes control to write it to the address N again. Next, the cumulative histogram calculation unit 23 accumulates the gray value histograms from the highest gray value to calculate the cumulative histogram J2. Specifically, the contents of address 256 of the histogram memory 21 are left as they are, and the following calculations are performed sequentially starting from address 255 and ending with address 1: contents of address N - contents of address N, contents of address N+1, 00). I can be photographed by doing.

累積ヒストグラム算出部(2)10は最小値フィルタ3
の出力に対して、累積ヒストグラム算出部(1)9の処
理と同一の処理を行い、最小値フィルタ処理後の画像の
累積ヒストグラムすなわち、収縮後の図形の面積を算出
する。
Cumulative histogram calculation unit (2) 10 is minimum value filter 3
The same processing as that of the cumulative histogram calculation unit (1) 9 is performed on the output of the cumulative histogram calculation unit (1) to calculate the cumulative histogram of the image after the minimum value filter processing, that is, the area of the figure after contraction.

累積ヒストグラム算出部(3)16は微分フィルタ後の
画像の画素値を入力し、累積ヒストグラム算出部(1)
9の処理と同一の処理を行って累積ヒストグラムを算出
する。
The cumulative histogram calculation unit (3) 16 inputs the pixel values of the image after the differential filter, and the cumulative histogram calculation unit (1)
A cumulative histogram is calculated by performing the same process as in step 9.

2次元累積ヒストグラJい算出部(1)17はJ゛ず、
濃度勾配算出部1、すなわち微分フィルタ処理後の画像
と最小値フィルタ処理後の画像のそれぞれをラスク走査
して2次元濃度ヒストグラムを算出する。
Two-dimensional cumulative histogram calculation unit (1) 17 is
The density gradient calculation unit 1 scans each of the image after differential filter processing and the image after minimum value filter processing to calculate a two-dimensional density histogram.

第4図は本発明の2次元累積ヒストグラム算出部(1)
の構成図である。同図において24は2次元ヒストグラ
ムメモリ、25はθ1とθ2をセントするレジスタであ
りかつカウンタとなるアドレスBil+御部、26はi
番地の内容(i)に1を加えるインクリメンタかつi番
地の内容(i)とj番地の内容(j)を加える加算イン
クリメント部、27は制御部である。
Figure 4 shows the two-dimensional cumulative histogram calculation unit (1) of the present invention.
FIG. In the figure, 24 is a two-dimensional histogram memory, 25 is a register for storing θ1 and θ2 and serves as a counter, and 26 is an i
Reference numeral 27 is a control unit, which is an incrementer that adds 1 to the content (i) of address and an addition increment unit that adds content (i) of address i and content (j) of address j.

先ず、2次元濃度ヒストグラムを求めるためにアドレス
制御部25は、濃淡値をセットするレジスタとして動作
させ、加算インクリメント部26はインクリメンタとし
て動作させる。具体的には0から255までの整数値θ
1と同じ(0から255の整数値θ2の組(θ1.θ2
)によって番地がIFf定される2次元ヒスドグラムノ
モリ24を最初にオールゼロにクリアしておき、2枚の
画像のそれぞれを同時に走査し°ζ各画素の画素値の紐
をアドレス制御部25にセットし、その画素値の組に対
応する番地の2次元ヒストグラムメモリ24の内容を読
み出し加算インクリメント部26で1を加えて、同じ番
地に書き込む。これを画素の全てに対して行うと、画像
走査し終わった時には2次元ヒストグラフ・メモリ24
の内容は2次元濃度ヒストダラムを表現している。つま
り、(θ1.θ2)によって指定される番地の内容は一
方の画像の画素値が01であり、他方の画像の画素値が
02画素の総数を表している。次に2次元の累積ヒスト
グラムを求めるためにアドレス制御部25は、カウンタ
として動作させ、加算インクリメント部26は加算器と
して動作させ、2次元ヒスドグラムノモリ24を用いて
2次元濃度ヒストダラムを濃度の高いほうから累積して
、2次元累1債ヒストグラ゛ムを算出する。具体的には
2次元累積ヒストグラムは2次元濃度ヒストグラムにお
いて、(255゜255)で1青電されるアドレスの内
容はそのまま、(255,θ2);θ2=0〜254の
内容を、(255,02)の内容+(255,θ2−ト
l)の内容に置き換える処理をθ2が大きい方から順に
行う。
First, in order to obtain a two-dimensional density histogram, the address control section 25 is operated as a register for setting gray values, and the addition increment section 26 is operated as an incrementer. Specifically, an integer value θ from 0 to 255
Same as 1 (set of integer values θ2 from 0 to 255 (θ1.θ2
), the two-dimensional histogram memory 24 whose address is determined by IFf is first cleared to all zeros, each of the two images is scanned simultaneously, and the string of pixel values of each pixel is stored in the address control unit 25. The contents of the two-dimensional histogram memory 24 at the address corresponding to the set of pixel values are read out, the addition increment unit 26 adds 1, and writes the result to the same address. If this is done for all pixels, when the image scanning is finished, the two-dimensional histogram memory 24
The content of represents a two-dimensional density histodarum. That is, the contents of the address specified by (θ1.θ2) represent the total number of pixels, with the pixel value of one image being 01 and the pixel value of the other image being 02. Next, in order to obtain a two-dimensional cumulative histogram, the address control unit 25 operates as a counter, the addition increment unit 26 operates as an adder, and the two-dimensional density histogram is converted into a two-dimensional density histogram using the two-dimensional histogram memory 24. A two-dimensional cumulative 1-bond histogram is calculated by accumulating from the highest value. Specifically, in the two-dimensional density histogram, the two-dimensional cumulative histogram is the same as the contents of the address that is 1 blue at (255°255), (255, θ2); θ2 = 0 to 254, (255, The process of replacing the contents of 02) with the contents of (255, θ2 - tl) is performed in order from the one with the largest θ2.

上記以外の(θI、θ2)に対しては(θ1.θ2)の
内容を02が255のときには (θ+、255)の内容+(θ+1.255)の内容に
置き換え、θ2が254以下のときには、(θ1.θ2
)の内容 +(θ1+1.θ2)の内容 +(θ1.θ2+1)の内容 −(θ1+1.θ2+1)の内乳ミ に置き換える処理をθ1.θ2が大きいほうから。
For (θI, θ2) other than the above, when 02 is 255, replace the content of (θ1.θ2) with the content of (θ+, 255) + (θ+1.255), and when θ2 is 254 or less, (θ1.θ2
) content + content of (θ1+1.θ2) + content of (θ1.θ2+1) - content of (θ1+1.θ2+1) The process of replacing the internal milk mi with θ1. From the side with larger θ2.

順に行う。Do it in order.

また、2次元累積しストダラム算出部(2)18は原画
像と微分フィルタ処理後の画1象のそれぞれをラスク走
査して2次元濃度ヒストダラムを算出するもので、構造
は2次元累、債ヒストグラノ・算出部(1)17と同一
である。
In addition, the two-dimensional cumulative histogram calculation unit (2) 18 calculates the two-dimensional density histogram by scanning each of the original image and the image after differential filter processing. - Same as calculation unit (1) 17.

一致度算出部19では累積ヒストグラム算出部(1)9
の出力すなわち原画像の累積ヒストグラムH,(θ2)
、累積ヒストグラム算出部(2)10の出力すなわち最
小値フィルタ処理後の画像の累積ヒストグラムM(θ2
)、累積ヒストグラム算出部(3)16の出力すなわち
1放分フィルタ処理後の画像の累、債ヒストグラムE(
0口、2次元累積ヒストグラム、算出部(2)18の出
力すなわち微分フィルタ処理後の画像と原画像の2次元
累積ヒストグラムEH(θ1.θ2)、2次元累請ヒス
トグラム算出部(1)17の出力すなわち微分フィルタ
処理後の画像と最小値フィルタ処理後の画像の2次元累
積ヒス1−グラムEM(θ1゜θ2)を入力する。そし
て、それぞれのθ1.θ2に対して(8)式の、 Ell(θ1.θ2)EM(θ1.θ2)E (θ +
)+H(θ 2)−M(θ 2 )−(Elf(θ1.
θ2)EM(θ1.θ2)〕・ ・ ・ ・ (8) を算出する。
In the coincidence calculation unit 19, the cumulative histogram calculation unit (1) 9
output, that is, the cumulative histogram H, (θ2) of the original image
, the output of the cumulative histogram calculation unit (2) 10, that is, the cumulative histogram M(θ2
), the output of the cumulative histogram calculation unit (3) 16, that is, the cumulative image after 1-distribution filter processing, and the bond histogram E(
0, two-dimensional cumulative histogram, the output of the calculation unit (2) 18, that is, the two-dimensional cumulative histogram EH (θ1, θ2) of the image after differential filter processing and the original image, the two-dimensional cumulative histogram calculation unit (1) 17 The output, that is, the two-dimensional cumulative histogram EM (θ1°θ2) of the image after differential filter processing and the image after minimum value filter processing is input. Then, each θ1. Ell(θ1.θ2)EM(θ1.θ2)E (θ +
)+H(θ2)-M(θ2)-(Elf(θ1.
θ2)EM(θ1.θ2)] ・ ・ ・ ・ (8) Calculate.

最適いき値決定部15では一致度が最大となるθ1.θ
2を最適ないき値として出力する。結果として、θ1は
エツジ)炭山の最適ないぎイ直であり、θ2は原画像を
2値化するための最適ないき値となる。
The optimal threshold determination unit 15 selects θ1. θ
2 is output as the optimal threshold value. As a result, θ1 is the optimal threshold value for the edge coal mine, and θ2 is the optimal threshold value for binarizing the original image.

なお本実施例は、例えば最小値フィルタ3、累積ヒスト
グラム算出部(1,2,3)9,10゜16.2次元累
積ヒストグラム算出部(1,2)17.18は専用のハ
ードウェアで実現し、一致度算出部19及び最適いき値
決定部15はマイクロプロセッサによるアルゴリズムで
表現できる。
In this embodiment, for example, the minimum value filter 3, cumulative histogram calculation unit (1, 2, 3) 9, 10° 16.2-dimensional cumulative histogram calculation unit (1, 2) 17, 18 are realized by dedicated hardware. However, the matching degree calculating section 19 and the optimal threshold determining section 15 can be expressed by an algorithm using a microprocessor.

また上述した性質1.2.3.4をそれぞれ拡張かつ一
般化すると次のようになる。
Further, when the properties 1.2.3.4 described above are expanded and generalized, the following results are obtained.

性質1 最大値(最小値)フィルタ処理後、2値化して得られる
図形と、2値化した後、膨張用(収縮用)論理フィルタ
を施して得られる図形は同一である。
Property 1 The figure obtained by binarizing after maximum value (minimum value) filtering is the same as the figure obtained by applying an expansion (contraction) logic filter after binarization.

ここで、最大値フィルタとは3×3のウィンドで画像を
走査し、ウィンド内の9 f[lilの画素値のうちの
最大値で中心画素を置き換えるものである。
Here, the maximum value filter scans an image in a 3×3 window and replaces the center pixel with the maximum value of the 9 f[lil pixel values within the window.

性質2 図形の境界点数は、次の3方法で算出できる。Property 2 The number of boundary points of a figure can be calculated using the following three methods.

+11  原図形の面、債−収縮後の図形の面積(2)
膨張後の図形の面積−原図形の面積(3)(膨張後の図
形の面積 一収縮後の図形の面積)/2 性質3 濃淡画像を2値化して得られる図形の面積はいき値によ
って変化するが、いき値と面積の関係は面積に等価な原
画像の累積ヒストグラムによって表現できる。
+11 Surface of original figure, bond - Area of 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 the figure obtained by binarizing the grayscale image changes depending on the threshold value. However, 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値化して得られる図形の境界画素数はいき
値によって変化するが、いき値と境界画素数の関係は、
性Tt2の項で記載した3方法に応じて、 (1,1原画像の累積ヒストダラム ー最小値フィルタ処理後の累積ヒストグラム(2)Q大
値フィルタ処理後の累積ヒストグラム−原画像の累積ヒ
ストグラJ・ (3)最大値フィルタ処理後のヒス1−グラム−最小値
フィルタ処理後の累積ヒストグラノ・によって算出でき
る。
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 Tt2, (3) It can be calculated as: histogram after maximum value filtering - cumulative histogram after minimum value filtering.

前記性質4(2)に基づくものとしては、本実施例にお
いて最小値フィルタ3を最大値フィルタで置き換えれば
よい。このとき、最大値フィルタ処理後の累積ヒストグ
ラムをX(θ2)とすれば、境界画素数X(θ2)−H
(θ2)となる。また、微分フィルタ処理後の画像と最
大値フィルタ処理後の画像の2次元累積ヒストグラムを
EX (01゜θ2)とすれば、一致度は最小値フィル
タの場合と同様に算出できる。すなわち画素値がOであ
ってしかもその画素に隣接する8画素の内生なくとも1
つの画素値が1であるような画素を2値画像の境界点と
定理した場合には、上記と同様な考察から、 さらに、境界点の数を上記2種の定τによる境界点の数
の平均として定義すると、 なお、最大値フィルタや最小値フィルタの代わりにウィ
ンド内で2番目に大きい画素値や2番目に小さな画素値
を出力する順序フィルタを利用しても良い。この場合に
は、孤立的な雑音に影ワされない結果を得ることができ
る。
Based on property 4(2), the minimum value filter 3 in this embodiment may be replaced with a maximum value filter. At this time, if the cumulative histogram after maximum value filtering is X(θ2), then the number of boundary pixels X(θ2)−H
(θ2). Further, if the two-dimensional cumulative histogram of the image after the differential filter processing and the image after the maximum value filter processing is EX (01° θ2), the degree of coincidence can be calculated in the same way as in the case of the minimum value filter. In other words, if the pixel value is O, and the endogeneity of the 8 pixels adjacent to that pixel is at least 1
If a pixel with one pixel value of 1 is defined as a boundary point of a binary image, then from the same consideration as above, we can further calculate the number of boundary points by the number of boundary points according to the above two types of constant τ When defined as an average, an order filter that outputs the second largest pixel value or second smallest pixel value within a window may be used instead of the maximum value filter or the minimum value filter. In this case, results that are not affected by isolated noise can be obtained.

また、ウィンドの形状としては、3×3以り)に、中心
画素及び、その画素と4連結の意味で連結し°Cいる画
素から成るウィンドを用いることもできる。すなわち、
境界の定義における隣接8画素(上下左右及び斜め方向
)をVA接4画素(上下左右)に匿き換えた場合はそれ
に応じて最大値(最小値)フィルタのウィンド形状を3
×3から十字型(3×3の四隅を除く)に変更すれば良
い。さらに、ウィンド形状を可変としても良い。
Further, as for the shape of the window, it is also possible to use a window consisting of a central pixel and pixels that are connected to the central pixel in the sense of 4-connection (3×3 or more). That is,
If the 8 adjacent pixels (up, down, left, right, and diagonal directions) in the boundary definition are replaced with 4 VA pixels (up, down, left, and right), the window shape of the maximum value (minimum value) filter will be changed to 3 accordingly.
All you have to do is change the shape from ×3 to a cross shape (excluding the four corners of 3×3). Furthermore, the window shape may be made variable.

また、さらに他の実現形態としては、空間フィルタ(濃
度勾配算出部)、順序フィルタ(最小値フィルタ)、1
次元と2次元のヒストグラム算出(累積ヒストグラム算
出部)等の機能を専用のハードウェア、あるいは汎用計
算機上のソフトウェアで構築し、一致度算出部、最適い
き値決定部の機能を付加し、さらに全体を制御するソフ
トウェアを備えることによっても実現できる。
Further, as still other implementation forms, a spatial filter (concentration gradient calculation unit), an order filter (minimum value filter), 1
Functions such as dimensional and two-dimensional histogram calculation (cumulative histogram calculation part) are constructed using dedicated hardware or software on a general-purpose computer, and functions of a coincidence calculation part and an optimal threshold determination part are added, and the overall This can also be achieved by providing software to control the

最後に、付録として定理1の詳♀田な証明を述べ(定理
1の証明) 濃淡画偉人をいき値θ2で2値化して得られる2値画像
をB、Aに対して最小値フィルタを施した画像をCとす
る。また、八において画素値が02以上である画素の集
合をΣ、Cにおいて画素値が02以上である画素の集合
をΔとする。さらに、境界点の集合をrとする。
Finally, as an appendix, we provide a detailed proof of Theorem 1 (Proof of Theorem 1). We apply a minimum value filter to B and A of the binary image obtained by binarizing a great grayscale painting with threshold value θ2. The resulting image is called C. In addition, the set of pixels whose pixel values are 02 or more in 8 is Σ, and the set of pixels whose pixel values are 02 or more in C is Δ. Furthermore, let the set of boundary points be r.

いま画素ωがBの境界点であると仮定する。このときB
においてωの画素値は1であってしかも隣接する8画素
のうち少なくとも1つは画素値が0である。従って、濃
淡画像Aにおいて、ωの画素値が02以上であり、かつ
ωに隣接する8個の画素のうち少なくとも1つは画素値
が0未満である。このことは、濃淡画像Aにおいてωの
画素値が02以上でありしかも最小値フィルタ処理後の
画像Cにおいてωの画素値が02未満であることを意味
する。つまりωがBの境界点であれば、濃淡画偉人にお
いてωの画素値が02以上でありしかも最小値フィルタ
処理後の画像Cにおいてのωの画素値が02未満である
。逆に、濃淡画偉人において画素値が02以上でありし
かも最小値フィルタ処理後の画像Cにおいて画素値が0
2未満である(02以上ではない)ような画素はBの境
界点である。
Now assume that pixel ω is a boundary point of B. At this time B
, the pixel value of ω is 1, and at least one of the eight adjacent pixels has a pixel value of 0. Therefore, in the grayscale image A, the pixel value of ω is 02 or more, and at least one of the eight pixels adjacent to ω has a pixel value of less than 0. This means that in the grayscale image A, the pixel value of ω is 02 or more, and in the image C after the minimum value filter processing, the pixel value of ω is less than 02. In other words, if ω is a boundary point of B, the pixel value of ω is 02 or more in the gray-scale painting master, and the pixel value of ω in the image C after the minimum value filter processing is less than 02. On the other hand, if the pixel value is 02 or more in the grayscale painting great person, and the pixel value is 0 in the image C after the minimum value filter processing,
Pixels that are less than 2 (not 02 or more) are B boundary points.

r=Σ口Δ 一方明らかに最小値フィルタ処理後の画像Cにおいて画
素値が02以上であればちとの画素へにおいても画素値
が02以上である。つまり、ΔはΣに含まれる。
r=ΣmouthΔ On the other hand, it is clear that if the pixel value in the image C after the minimum value filter processing is 02 or more, the pixel value of the next pixel is also 02 or more. In other words, Δ is included in Σ.

従って、境界点の数はΣであってΔでない画素の個数に
等しいが、この数は、Σである画素の総数H(θ2)か
らΔである画素の総数M(θ2)を差し引いたものに等
しい。
Therefore, the number of boundary points is equal to the number of pixels that are Σ and not Δ, but this number is the total number of pixels that are Σ H (θ2) minus the total number of pixels that are Δ M (θ2) equal.

〔発明の効果〕〔Effect of the invention〕

従来、本発明と同等な効果を得るためには画像を256
x 256回走査する必要があるが、本発明によれば、
微分フィルタ処理後の画像を2値化して得られるエツジ
と原画像を2値化して得られる図形の境界が最も良く一
致するような最適ないき値を画像を1回走査するだけで
高速かつ高積度に得ることができる。
Conventionally, in order to obtain the same effect as the present invention, the image was
x 256 times, but according to the present invention,
By scanning the image once, you can quickly and efficiently find the optimal threshold value that best matches the edge obtained by binarizing the image after differential filter processing and the boundary of the figure obtained by binarizing the original image. You can get it in bulk.

【図面の簡単な説明】[Brief explanation of the drawing]

h′1,1図は本発明の11179図、第2図は本実施
例の構成図、 第3図は累積ヒストグラム算出部(1)の構成図 第4図は本発明の2次元累積ヒストグラム算出部(1)
のIR構成図 第5図は原図形の’bl淡曲線f  (x)に対する2
値化処理の(既念図、 第6図は濃淡値のヒストグラム、 第7図は濃淡値の累積ヒストグラム、 第8図は集合関係を示す図、 第9図は第1の従来方式の処理フロー、第10図は第2
の従来方式のブロック図である。 1・・・濃度勾配算出手段、 3・・・順序フィルタ手段、 9・・・第1の累積ヒストダラム算出手段、10・・・
第2の累積ヒストグラム算出手段、15・・・最適いき
値決定手段、 16・・・第3の累、債ヒストグラム算出手段、17・
・・第1の2次元累積ヒストグラム・算出手段、 1日・・・第2の2次元累積ヒス1−グラブ・算出手段
、 19・・・一致度算出手段、 特許出願人   富士通株式会社 木兄B月の)577図 第1図 $二k〔ツバi(グ11の17緊YA図第2図 濃淡イ直の累1貫巳又トゲラム 第7図
Fig. h'1,1 is a 11179 diagram of the present invention, Fig. 2 is a block diagram of this embodiment, Fig. 3 is a block diagram of the cumulative histogram calculation unit (1), and Fig. 4 is a two-dimensional cumulative histogram calculation of the present invention. Part (1)
The IR configuration diagram in Figure 5 is 2 for the 'bl light curve f (x) of the original figure.
Figure 6 is a histogram of gray values, Figure 7 is a cumulative histogram of gray values, Figure 8 is a diagram showing set relationships, and Figure 9 is a processing flow of the first conventional method. , Figure 10 is the second
FIG. 2 is a block diagram of a conventional method. DESCRIPTION OF SYMBOLS 1... Concentration gradient calculation means, 3... Order filter means, 9... First cumulative histodrum calculation means, 10...
Second cumulative histogram calculating means, 15... Optimal threshold determining means, 16... Third cumulative bond histogram calculating means, 17.
...First two-dimensional cumulative histogram/calculation means, 1 day...Second two-dimensional cumulative histogram/grab calculation means, 19... Matching degree calculation means, Patent applicant: Fujitsu Limited Kinoe B Moon) 577 Figure 1 $ 2k [Tsuba i (G11 17 Kin YA Figure 2 Shade I Straight Cumulative 1 Kanmi Mata Togerum Figure 7

Claims (1)

【特許請求の範囲】 1)濃淡画像を処理する画像処理システムにおいて、 画像中の濃度勾配の大きさを画素毎に算出する濃度勾配
算出手段(1)と、 画素毎にその画素を含むある形状のウインド内の画素値
を大きさの順に並べたときにある定められた順位である
画素値を出力する順序フィルタ手段(3)と、 原画素の画素値がいき値θ_2以上である画素の総数を
全てのθ_2に対して算出する第1の累積ヒストグラム
算出手段(9)と、 順次フィルタ手段(3)通過後の画素値がいき値θ_2
以上である画素の総数を全てのθ_2に対して算出する
第2の累積ヒストグラム算出手段(10)と、 濃度勾配算出手段(1)通過後の画素値がいき値θ_1
以上である画素の総数を全てのθ_1に対して算出する
第3の累積ヒストグラム算出手段(16)と、 濃度勾配算出手段(1)通過後の画素値がいき値θ_1
以上でありかつ順序フィルタ手段(3)通過後の画素値
がいき値θ_2以上である画素の総数を全てのθ_1と
θ_2に対して算出する第1の2次元累積ヒストグラム
算出手段(17)と、 濃度勾配算出手段(1)通過後の画素値がいき値θ_1
以上であり原画像の画素値がいき値θ_2以上である画
素の総数を全てのθ_1とθ_2に対して算出する第2
の2次元累積ヒストグラム算出手段(18)と、 第1、第2及び第3の累積ヒストグラム算出手段(9)
、(10)、(16)及び第1と第2の2次元累積ヒス
トグラムの結果から濃度勾配算出処理後の画像をいき値
θ_1で2値化して得られるエッジと原画像をいき値θ
_2で2値化して得られる図形の境界の一致度をθ_1
とθ_2の全ての組合せに対して算出する一致度算出手
段(19)と、一致度が最大となるθ_1とθ_2を検
出する最適いき値決定手段(15)とを備えいき値θ_
1とθを同時に決定することを特徴とする2値化のいき
値決定方式。 2)前記順序フィルタ手段(3)は定められた順位が最
後位(つまり最小値を出力する)ことを特徴とする請求
項1記載の2値化のいき値決定方式。 3)前記順序フィルタ手段(3)は定められた順位が1
位(つまり最大値を出力する)ことを特徴とする請求項
1記載の2値化のいき値決定方式。 4)前記順序フィルタ手段(3)は、定められた順位が
1位である(つまり最大値を出力する)ものと定められ
た順位が最後位である(つまり最小値を出力する)もの
の両者を備えることを特徴とする請求項1記載の2値化
のいき値決定方式。 5)前記順序フィルタ手段(3)は、定めるべき順位が
可変であることを特徴とする請求項1記載の2値化のい
き値決定方式。 6)前記一致度算出手段(19)は、原画像の累積ヒス
トグラムH(θ_2)、定められた順位が最後位である
順序フィルタ処理後の画像の累積ヒストグラムM(θ_
2)、微分フィルタ処理後の画像の累積ヒストグラムE
(θ_1)、微分フィルタ処理後の画像と原画像の2次
元累積ヒストグラムEH(θ_1,θ_2)、微分フィ
ルタ処理後の画像と定められた順位が最後位である順序
フィルタ処理後の画像の2次元累積ヒストグラムEM(
θ_1,θ_2)とから、一致度として {EH(θ_1,θ_2)EM(θ_1,θ_2)}/
{E(θ_1)+H(θ_2)−M(θ_2)−〔EH
(θ_1,θ_2)−EM(θ_1,θ_2)〕}を算
出することを特徴とする請求項1記載の2値化のいき値
決定方式。 7)前記一致度算出手段(19)は、原画像の累積ヒス
トグラムH(θ_2)、定められた順位が1位である順
序フィルタ処理後の画像の累積ヒストグラムX(θ_2
)、微分フィルタ処理後の画像の累積ヒストグラムE(
θ_1)、微分フィルタ処理後の画像と原画像の2次元
累積ヒストグラムEH(θ_1、θ_2)、微分フィル
タ処理後の画像と定められた順位が1位である順序フィ
ルタ処理後の画像の2次元累積ヒストグラムEX(θ_
1,θ_2)とから、一致度として {EX(θ_1,θ_2)−EH(θ_1,θ_2)}
/{E(θ_1)+X(θ_2)−H(θ_2)−(E
X(θ_1,θ_2)−EH(θ_1,θ_2)〕}を
算出することを特徴とする請求項1記載の2値化のいき
値決定方式。 8)前記一致度算出手段(19)は、定められた順位が
1位である順序フィルタ処理後の画像の累積ヒストグラ
ムX(θ_2)、定められた順位が最後位である順序フ
ィルタ処理後の画像の累積ヒストグラムM(θ_2)、
微分フィルタ処理後の画像の累積ヒストグラムE(θ_
1)、微分フィルタ処理後の画像と定められた順位が1
位である順序フィルタ処理後の画像の2次元累積ヒスト
グラムEX(θ_1,θ_2)、微分フィルタ処理後の
画像と定められた順位が最後位である順序フィルタ処理
後の画像2次元累積ヒストグラムEM(θ_1,θ_2
)とから、一致度として、 {EX(θ_1,θ_2)−EM(θ_1,θ_2)}
/{E(θ_1)×2+X(θ_2)−M(θ_2)−
〔EX(θ_1,θ_2)−EM(θ_1,θ_2)〕
}を算出することを特徴とする請求項1記載の2値化の
いき値決定方式。 9)前記の第1と第2の2次元累積ヒストグラム算出手
段(17),(18)は、一方の画像の画素値と他方の
画像の画素値をアドレスとして入力し、入力画素値の組
(θ_1,θ_2)に対応する番地を持つヒストグラム
メモリと、前記2枚の画像を走査して入力画素値の組(
θ_1,θ_2)に対応する前記番地のヒストグラムメ
モリ内容をインクリメントして行く第1の制御手段と、
前記インクリメントの動作終了時に前記ヒストグラムメ
モリに格納された画素値のヒストグラムの内容を入力画
素値の組(θ_1,θ_2)の全てに対して累積する第
2の制御手段を有することを特徴とする請求項1記載の
2値化のいき値決定方式。
[Claims] 1) An image processing system that processes a grayscale image, comprising: a density gradient calculation means (1) that calculates the magnitude of a density gradient in the image for each pixel, and a shape that includes the pixel for each pixel. order filter means (3) for outputting pixel values in a predetermined order when the pixel values in the window are arranged in order of size; a first cumulative histogram calculation means (9) that calculates the value for all θ_2, and a pixel value after passing through the sequential filter means (3) is a threshold value θ_2
a second cumulative histogram calculation means (10) which calculates the total number of pixels that is above for all θ_2; and a pixel value after passing through the density gradient calculation means (1) is a threshold value θ_1.
A third cumulative histogram calculation means (16) that calculates the total number of pixels that is above for all θ_1, and a pixel value after passing through the density gradient calculation means (1) is a threshold value θ_1
a first two-dimensional cumulative histogram calculation means (17) which calculates the total number of pixels whose pixel value after passing through the order filter means (3) is equal to or higher than the threshold value θ_2 for all θ_1 and θ_2; The pixel value after passing through the concentration gradient calculation means (1) is the threshold value θ_1
The second step is to calculate the total number of pixels whose pixel value of the original image is greater than or equal to the threshold value θ_2 for all θ_1 and θ_2.
two-dimensional cumulative histogram calculation means (18); and first, second and third cumulative histogram calculation means (9).
, (10), (16) and the results of the first and second two-dimensional cumulative histograms, the image after the density gradient calculation process is binarized using the threshold value θ_1, and the edge and original image obtained by binarizing the image are converted to the threshold value θ.
The matching degree of the boundary of the figure obtained by binarizing with _2 is θ_1
The threshold value θ_
A binarization threshold determination method characterized by determining 1 and θ at the same time. 2) The binarization threshold determination method according to claim 1, wherein the order filter means (3) has a predetermined rank of the last one (that is, outputs the minimum value). 3) The order filter means (3) has a predetermined order of 1.
2. The binarization threshold determination method according to claim 1, wherein the binarization threshold value determination method is characterized in that the binarization threshold value determination method outputs the maximum value. 4) The order filter means (3) selects both the one whose predetermined rank is the first (that is, outputs the maximum value) and the one whose predetermined rank is the last (that is, outputs the minimum value). 2. The binarization threshold determination method according to claim 1, further comprising: 5) The binarization threshold determination method according to claim 1, wherein the order filter means (3) has a variable order to be determined. 6) The coincidence calculation means (19) calculates a cumulative histogram H(θ_2) of the original image and a cumulative histogram M(θ_2) of the image after the sequential filter processing with the determined rank being the last.
2) Cumulative histogram E of the image after differential filter processing
(θ_1), two-dimensional cumulative histogram EH (θ_1, θ_2) of the image after differential filter processing and the original image, two-dimensional image after differential filter processing and the image after sequential filter processing with the determined rank being the last. Cumulative histogram EM (
θ_1, θ_2), the matching degree is {EH(θ_1, θ_2)EM(θ_1, θ_2)}/
{E(θ_1)+H(θ_2)-M(θ_2)-[EH
2. The binarization threshold determination method according to claim 1, wherein: (θ_1, θ_2)−EM(θ_1, θ_2)]}. 7) The coincidence calculation means (19) calculates a cumulative histogram H(θ_2) of the original image and a cumulative histogram X(θ_2) of the image after order filter processing with a predetermined first rank.
), the cumulative histogram E(
θ_1), two-dimensional cumulative histogram EH (θ_1, θ_2) of the image after differential filter processing and the original image, two-dimensional cumulative histogram of the image after differential filter processing and the image after sequential filter processing with the determined rank of 1st Histogram EX(θ_
1, θ_2), the matching degree is {EX(θ_1, θ_2)−EH(θ_1, θ_2)}
/{E(θ_1)+X(θ_2)-H(θ_2)-(E
2. The binarization threshold determination method according to claim 1, wherein: X(θ_1, θ_2)−EH(θ_1, θ_2)]}. 8) The coincidence degree calculation means (19) calculates a cumulative histogram X(θ_2) of the image after the ordinal filter processing in which the predetermined rank is the first, and an image after the ordinal filter processing in which the predetermined rank is the last one. Cumulative histogram M(θ_2) of
Cumulative histogram E(θ_
1), the determined rank of the image after differential filter processing is 1
The two-dimensional cumulative histogram EX(θ_1, θ_2) of the image after the ordered filter processing is the lowest, and the two-dimensional cumulative histogram EM(θ_1) of the image after the differential filter processing is the last. ,θ_2
), the degree of matching is {EX(θ_1, θ_2)−EM(θ_1, θ_2)}
/{E(θ_1)×2+X(θ_2)−M(θ_2)−
[EX (θ_1, θ_2) - EM (θ_1, θ_2)]
} The binarization threshold determination method according to claim 1, wherein: } is calculated. 9) The first and second two-dimensional cumulative histogram calculation means (17) and (18) receive the pixel values of one image and the pixel values of the other image as addresses, and calculate the set of input pixel values ( A histogram memory having addresses corresponding to θ_1, θ_2) and a set of input pixel values (
a first control means that increments the content of the histogram memory at the address corresponding to θ_1, θ_2);
A second control means for accumulating the contents of the histogram of pixel values stored in the histogram memory for all input pixel value sets (θ_1, θ_2) at the end of the increment operation. Threshold value determination method for binarization described in Section 1.
JP63064697A 1988-03-19 1988-03-19 Thresholding method for binarization Expired - Fee Related JP2520443B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63064697A JP2520443B2 (en) 1988-03-19 1988-03-19 Thresholding method for binarization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63064697A JP2520443B2 (en) 1988-03-19 1988-03-19 Thresholding method for binarization

Publications (2)

Publication Number Publication Date
JPH01239678A true JPH01239678A (en) 1989-09-25
JP2520443B2 JP2520443B2 (en) 1996-07-31

Family

ID=13265600

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63064697A Expired - Fee Related JP2520443B2 (en) 1988-03-19 1988-03-19 Thresholding method for binarization

Country Status (1)

Country Link
JP (1) JP2520443B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2750226B2 (en) 1991-02-19 1998-05-13 大日本スクリーン製造株式会社 How to set the binarization threshold

Also Published As

Publication number Publication date
JP2520443B2 (en) 1996-07-31

Similar Documents

Publication Publication Date Title
JP2885823B2 (en) Visual recognition device
US10366307B2 (en) Coarse-to-fine search method, image processing device and recording medium
JPH09510809A (en) Method and apparatus for determining a fine azimuth of a barcode symbol in a two-dimensional CDD image
CN114529925B (en) Method for identifying table structure of whole line table
Pikaz et al. Optimal polygonal approximation of digital curves
JPH03294976A (en) Reference mark pattern detecting device
JP3675629B2 (en) Pattern recognition method, apparatus and recording medium
Shen et al. Real time gray level corner detector
Kampel et al. On 3d mosaicing of rotationally symmetric ceramic fragments
CN112288009A (en) R-SIFT chip hardware Trojan horse image registration method based on template matching
EP4131177A1 (en) Imaging system and method using a multi-layer model approach to provide robust object detection
Shih et al. The efficient algorithms for achieving Euclidean distance transformation
CN1564190A (en) Image processing method of detecting ellipsoid by utilizing restricted random Huff transition
JPH01239678A (en) Binary threshold value deciding system
Dawoud Iterative cross section sequence graph for handwritten character segmentation
Hahn et al. Ellipse detection using a randomized Hough transform based on edge segment merging scheme
US5206916A (en) Modular cellular automation for line association and identification
JPH01184583A (en) System for deciding binarization threshold value
Wang et al. Real-Time Texture Extraction Based on the Improved Median Robust Extended Local Binary Pattern
JPH0232481A (en) Peak data extractor
JP2935847B2 (en) Image processing device
Sudha Design of a cellular architecture for fast computation of the skeleton
JPH05242240A (en) Picture processor
Banerjee et al. A novel approach for freeman chain coding with prior modification using cubic interpolation
JPH0812695B2 (en) Area extraction device

Legal Events

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