JPH03237571A - Device for calculating binarizing threshold of image - Google Patents

Device for calculating binarizing threshold of image

Info

Publication number
JPH03237571A
JPH03237571A JP2033208A JP3320890A JPH03237571A JP H03237571 A JPH03237571 A JP H03237571A JP 2033208 A JP2033208 A JP 2033208A JP 3320890 A JP3320890 A JP 3320890A JP H03237571 A JPH03237571 A JP H03237571A
Authority
JP
Japan
Prior art keywords
image
brightness
window
histogram
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2033208A
Other languages
Japanese (ja)
Inventor
Koji Hisada
浩司 久田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Omron Corp
Original Assignee
Omron Corp
Omron Tateisi Electronics Co
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Omron Corp, Omron Tateisi Electronics Co filed Critical Omron Corp
Priority to JP2033208A priority Critical patent/JPH03237571A/en
Publication of JPH03237571A publication Critical patent/JPH03237571A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To prevent the generation of adverse influence or the like due to uneven brightness by comparing a difference between the brightness of each picture element of an image in a window and that of a specific picture element with a parameter proportional to the contrast to form a histogram and calculating a threshold based upon the histogram. CONSTITUTION:The brightness information of nine picture elements e.g. of an intra-window image in a many-valued image is latched by latch circuits 70 to 78 and two parameters rH, RU proportional to a contrast to be a difference between the brightness of an image part in an image to be a target and that of its background part are supplied to comparators 80 to 87 and compared with the brightness information d0 of a center picture element latched in the circuit 70. Binary data fi = 1 in the case of -RL < di -d0 < -rH or fi = 0 in the other case is outputted, an illegal pattern is detected, an illegal pattern histogram is formed based upon the detected result and an optimum binarizing threshold is determined in accordance with another necessary formed histogram. Thereby, a threshold prevented from adverse influence to be generated when plural images having respectively different brightness unenvenness or contrasts exist can be obtained.

Description

【発明の詳細な説明】 〈産業上の利用分野〉 この発明は、知能ロボットの眼や目視検査装置などに適
用される画像処理技術に関連し、殊にこの発明は、濃淡
画像や距離weなどの多値画像を2値化処理する際、最
良の2値画像を得るためのしきい値を算出するのに用い
られる画像の2値化しきい値算出装置に関する。
[Detailed Description of the Invention] <Industrial Application Field> The present invention relates to image processing technology applied to the eyes of intelligent robots and visual inspection devices. The present invention relates to an image binarization threshold calculation device used to calculate a threshold for obtaining the best binary image when performing binarization processing on a multivalued image.

〈従来の技術〉 先般、出願人は、対象物の大きさが未知であっても、高
速かつ安定して最適な2値化しきい値を算出し得る画像
の2値化しきい値算出装置を提案した(特開昭64−5
1586号)。
<Prior art> The applicant recently proposed an image binarization threshold calculation device that can calculate an optimal binarization threshold at high speed and stably even if the size of the object is unknown. (Unexamined Japanese Patent Publication No. 1986-5)
No. 1586).

第6図は、この装置の構成を示しており、マイクロコン
ピュータ10を制御主体とし、ウィンドウ走査部11.
非合法パターン検出部12゜非合法パターンヒストグラ
ム生成部13.明るさヒストグラム生成部149画質ヒ
ストグラム生成部15. ヒストグラム平滑処理部16
.最適しきい値探索部17を具備している。
FIG. 6 shows the configuration of this device, in which a microcomputer 10 is the main control unit, and a window scanning section 11.
Illegal pattern detection section 12. Illegal pattern histogram generation section 13. Brightness histogram generation section 149 Image quality histogram generation section 15. Histogram smoothing processing unit 16
.. It is equipped with an optimal threshold value search section 17.

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

このウィンドウ走査部11は、画像メモリ24に記憶さ
れた濃淡画像上に、第8図に示すような矩形状のウィン
ドウ60を設定してラスク走査するためのものであって
、このウィンドウ60内の画像につき所定の画素A0〜
A、の明るさデータd0〜d7が同時に取り出されるよ
うになっている。なお図中、×印は処理対象外の画素で
ある。
This window scanning unit 11 is for setting a rectangular window 60 as shown in FIG. Predetermined pixel A0~ per image
The brightness data d0 to d7 of A are taken out at the same time. Note that in the figure, x marks are pixels that are not subject to processing.

前記第1のシフトレジスタ25は画像メモリ24の横方
向の画素数をn(第8図参照)とすると、このnより第
1群のラッチ回路26〜29の段数を差し引いた段数(
n−4)をもつものであって、この段数分だけ明るさデ
ータの出力を遅延させる動作を行う、第1群の4段のラ
ッチ回路26〜29は全体としてシフトレジスタの動作
を行い、最終段のラッチ回路29の出力が第2のジフト
レジスタ30へ出力される。この第2のシフトレジスタ
30も(n−4)の段数を有し、この段数分だけ明るさ
データの出力を遅延させて第2群の4段のラッチ回路3
1〜34へ伝える。
The first shift register 25 has the number of stages obtained by subtracting the number of stages of the first group of latch circuits 26 to 29 from n (see FIG. 8), where the number of pixels in the horizontal direction of the image memory 24 is n (see FIG. 8).
The four-stage latch circuits 26 to 29 of the first group, which have a delay circuit (n-4) and which performs an operation of delaying the output of brightness data by this number of stages, operate as a shift register as a whole, and the final The output of the stage latch circuit 29 is output to the second shift register 30. This second shift register 30 also has (n-4) stages, and delays the output of the brightness data by the number of stages to delay the output of the brightness data to the four-stage latch circuit 3 of the second group.
Tell 1-34.

各画素A0〜A7の明るさデータd、〜d。Brightness data d, -d of each pixel A0-A7.

は非合法パターン検出部12へ出力されると共に、特定
画素A、の明るさデータd+については非合法パターン
ヒストグラム生成部13および明るさヒストグラム生成
部14にも出力される。
is output to the illegal pattern detection section 12, and the brightness data d+ of the specific pixel A is also output to the illegal pattern histogram generation section 13 and the brightness histogram generation section 14.

非合法パターン検出部12は、ウィンドウ60内の画像
が合法パターンか、非合法パターンかを判別し、それが
非合法パターンであれば「1」のフラグを、合法パター
ンであれば「O」のフラグを、それぞれ出力する。
The illegal pattern detection unit 12 determines whether the image in the window 60 is a legal pattern or an illegal pattern, and sets a flag of "1" if it is an illegal pattern, and sets a flag of "O" if it is a legal pattern. Output each flag.

第7図は、従来の非合法パターン検出部12の構成を示
すもので、各明るさデータd0〜d7をラッチする8個
のラッチ回路35〜42と、特定画素A、の明るさデー
タd、とその他の画素A、およびA2〜A?の明るさデ
ータdoおよびd2〜d7とを大小比較する7個の比較
回路43〜49とを含んでいる。これら比較回路43〜
49は、特定の画素AIの明るさデータdIをしきい値
として前記ウィンドウ60の各画素A0およびA2〜A
、の明るさデータd0およびd2〜d、を2値化するた
めのものであって、各明るさデータd、(ただしi・0
,2.3.、。
FIG. 7 shows the configuration of the conventional illegal pattern detection section 12, which includes eight latch circuits 35 to 42 that latch each brightness data d0 to d7, brightness data d of a specific pixel A, and other pixels A, and A2 to A? includes seven comparison circuits 43 to 49 for comparing the brightness data do and d2 to d7 in magnitude. These comparison circuits 43~
49, each pixel A0 and A2 to A of the window 60 is set using the brightness data dI of a specific pixel AI as a threshold value.
, for binarizing the brightness data d0 and d2 to d, of each brightness data d, (however, i・0
, 2.3. ,.

・・、7)がd工≧d、のときは「1」、d、<d。..., 7) is "1" when d ≧ d, d, < d.

のときは「0」の各2値データfiをそれぞれ出力する
。なお特定画素A、の2値データf。
In this case, each binary data fi of "0" is output. Note that the binary data f of the specific pixel A.

は常にrl、である。is always rl.

第9図は、ウィンドウ60内の各画素A0〜A、の明る
さデータd0〜d、が2値化されて2値データf0〜f
7に変換される過程を示している。
FIG. 9 shows that the brightness data d0 to d of each pixel A0 to A in the window 60 is binarized to binary data f0 to f.
It shows the process of conversion to 7.

前記の2値データf !  (i=0.2.3.・・・
・、7)は検出ロジック部50へ出力され、この検出ロ
ジック部50はこれら2値データfiによってウィンド
ウ60内の画像が非合法パターンであるか否かを判断し
、非合法パターンであれば「1」のフラグを、合法パタ
ーンであれば「0」のフラグを、それぞれ出力する。こ
こで合法パターンとは輪郭部の画像として適格な2値パ
ターンを、非合法パターンとは輪郭部の画像として不適
格な2値パターンを、それぞれ意味し、合法パターンは
第1O図に示すような滑らかな形態となり、また非合法
パターンは第11図に示すような滑らかでない形態とな
る。なお第10゜11図中、斜線部はrl、の2値デー
タをもつ画素を示し、第11図の2値パターンでは「1
」の画素領域の内側にrQJの孔部61が生じている。
The binary data f! (i=0.2.3...
. , 7) are output to the detection logic unit 50, which uses these binary data fi to determine whether or not the image within the window 60 is an illegal pattern, and if it is an illegal pattern, “ A flag of "1" is output, and a flag of "0" is output if the pattern is legal. Here, a legal pattern means a binary pattern that is suitable as an image of an outline, and an illegal pattern means a binary pattern that is inappropriate as an image of an outline.A legal pattern is a binary pattern that is not suitable as an image of an outline. The pattern becomes smooth, and the illegal pattern takes a non-smooth form as shown in FIG. Note that in Figures 10 and 11, the shaded area indicates a pixel with binary data rl, and in the binary pattern of Figure 11, it is "1".
An rQJ hole 61 is formed inside the pixel region of .

第6図に戻って、非合法パターンヒストグラム生成部1
3は、前記検出ロジック部50が非合法パターンを検出
して「1」のフラグを出力する都度、このフラグの発生
度数を計数して、非合法パターンのヒストグラムを生成
する。明るさヒストグラム生成部14はウィンドウ60
内の特定位置の画素A、の明るさデータd、を抽出して
明るさヒストグラムを生成する。画質ヒストグラム生成
部15は非合法パターンヒストグラムと明るさヒストグ
ラムとから画質ヒストグラムを生成する。この画質ヒス
トグラムは画質の評価基準(例えば画質の悪さを示す基
準)を与えるものである。
Returning to FIG. 6, illegal pattern histogram generation section 1
3, each time the detection logic unit 50 detects an illegal pattern and outputs a flag of "1", the frequency of occurrence of this flag is counted to generate a histogram of the illegal pattern. The brightness histogram generator 14 uses a window 60
A brightness histogram is generated by extracting the brightness data d of the pixel A at a specific position within. The image quality histogram generation unit 15 generates an image quality histogram from the illegal pattern histogram and the brightness histogram. This image quality histogram provides an evaluation standard for image quality (for example, a standard indicating poor image quality).

ヒストグラム平滑処理部16は、画質ヒストグラムを平
滑化するためのもので、その結果、第12図に示すよう
な、平滑化された画質ヒストグラムが生成される。
The histogram smoothing processing unit 16 is for smoothing the image quality histogram, and as a result, a smoothed image quality histogram as shown in FIG. 12 is generated.

第12図において、横軸はk(Lきい値)、縦軸は画質
の悪さであって、画質の悪さはしきい値k。tのとき最
小となっている。
In FIG. 12, the horizontal axis is k (L threshold) and the vertical axis is the poor image quality, where the poor image quality is the threshold value k. It is minimum at t.

最適しきい値探索部17は、このしきい値kopzを最
適しきい値として探索し、その探索結果ヲCP Uバス
18を通じてマイクロコンピュータ10に知らせる。
The optimal threshold searching section 17 searches for this threshold kopz as the optimal threshold, and notifies the microcomputer 10 of the search result via the CPU bus 18.

上記構成において、図示しない撮像装置により対象物が
撮像されると、画像メモリ24には対象物と背量とから
成る濃淡画像が格納される。
In the above configuration, when an image of an object is captured by an image capturing device (not shown), a grayscale image consisting of the object and its back weight is stored in the image memory 24.

この濃淡画像は2値化処理後に認識処理などが行われる
が、その2値化に先立ち、第6図の2値化しきい値算出
装置により最適な2値化しきい値の算出が行われること
になる。
This grayscale image is subjected to recognition processing after binarization processing, but prior to the binarization, the optimum binarization threshold value is calculated by the binarization threshold calculation device shown in Fig. 6. Become.

まず非合法パターンヒストグラム生成部13と明るさヒ
ストグラム生成部14とをゼロにクリアした後、ウィン
ドウ走査部11は濃淡画像上にウィンドウ60を設定し
てラスク走査する。
First, after clearing the illegal pattern histogram generation section 13 and the brightness histogram generation section 14 to zero, the window scanning section 11 sets a window 60 on the grayscale image and performs rask scanning.

すなわちウィンドウ走査部11において、アドレスジェ
ネレータ19は画像メモリ24の各画素のアドレスを順
次生成して、そのアドレスに対応する画素の明るさデー
タを画像バス20を介して第1のシフトレジスタ25へ
出力させる。
That is, in the window scanning unit 11, the address generator 19 sequentially generates the address of each pixel in the image memory 24, and outputs the brightness data of the pixel corresponding to the address to the first shift register 25 via the image bus 20. let

これら明るさデータは第1のシフトレジスタ25、第1
群のラッチ回路26〜29.第2のシフトレジスタ30
.第2群のラッチ回路31〜34へ順送りされ、第1群
の各ラッチ回路26〜28からはウィンドウ60内の画
素A0〜A8の明るさデータd0〜d2が、また第2の
シフトレジスタ30および第2群の各ラッチ回路31〜
34からは画素A、〜A、の明るさデータd。
These brightness data are transferred to the first shift register 25,
Group latch circuits 26-29. Second shift register 30
.. The brightness data d0 to d2 of the pixels A0 to A8 within the window 60 are sequentially sent to the second group of latch circuits 31 to 34, and the brightness data d0 to d2 of the pixels A0 to A8 within the window 60 are sent from each latch circuit of the first group to the second shift register 30 and Each latch circuit 31 of the second group
From 34 onwards, brightness data d of pixels A, ~A.

〜d、が、それぞれ取り出されることになる。~d, are respectively taken out.

非合法パターン検出部12はこれら明るさd0〜d、を
取り込み、特定の画素A、の明るさデータd+をしきい
値としてウィンドウ60内の各画素を2値化した後、そ
の2値パターンが非合法パターンに該当するか否かを判
断する。
The illegal pattern detection unit 12 takes in these brightness values d0 to d, and after binarizing each pixel in the window 60 using the brightness data d+ of a specific pixel A as a threshold value, the binary pattern is Determine whether the pattern corresponds to an illegal pattern.

もし非合法パターンであれば検出フラグ「1」が出力さ
れ、非合法パターンヒストグラム生成部13において明
るさ(しきい値)毎の非合法パターンの発生度数が計数
されて、非合法パターンヒストグラムが生成される。同
様に明るさヒストグラム生成部14では各明るさの度数
が計数されて明るさヒストグラムが生成される。
If it is an illegal pattern, a detection flag "1" is output, and the illegal pattern histogram generation unit 13 counts the number of occurrences of the illegal pattern for each brightness (threshold value) to generate an illegal pattern histogram. be done. Similarly, the brightness histogram generation unit 14 counts the frequency of each brightness and generates a brightness histogram.

これらヒストグラムの生成が完了すると、つぎの画質ヒ
ストグラム生成部15において両ヒストグラムを用いて
画質ヒストグラムが算出される。この画質ヒストグラム
は必要に応じてヒストグラム平滑処理部16で平滑化さ
れた後、最適しきい値探索部17がこの平滑化された画
質ヒストグラムより最適のしきい値を探索してその探索
結果をマイクロコンピュータ10へ出力する。
When the generation of these histograms is completed, the next image quality histogram generation unit 15 calculates an image quality histogram using both histograms. This image quality histogram is smoothed by a histogram smoothing processing unit 16 as necessary, and then an optimum threshold value search unit 17 searches for an optimum threshold value from this smoothed image quality histogram and uses the search result as a microprocessor. Output to computer 10.

なお上記は、最適な2値化しきい値をハード的に算出し
ているが、これに限らず、ソフト的に算出することも可
能である。
Note that although the optimal binarization threshold is calculated using hardware in the above example, the calculation is not limited to this, and it is also possible to calculate it using software.

〈発明が解決しようとする問題点〉 上記構成の2値化しきい値算出装置の場合、非合法パタ
ーン検出部12はウィンドウ6o内の特定画素A、の明
るさデータd、をしきい値とし、その特定画素AIにつ
いては2値データを常に「1」とし、ウィンドウ60内
の各画素A=  (i・0,2.3.・・・・、7)に
ついては明るさデータd、がd!≧d、ならば2値デー
タは「1」とし、d、<d、ならば2値データは「0」
としている。このため特定画素A、と同一画像部分の画
素であっても、明るさのムラに起因して明るさデータd
、が特定画素AIの明るさデータdiより僅かでも小さ
い場合には、2値データは’OJとなり、精度の高い非
合法パターンの検出が困難となる。
<Problems to be Solved by the Invention> In the case of the binarization threshold calculation device having the above configuration, the illegal pattern detection unit 12 uses the brightness data d of the specific pixel A in the window 6o as the threshold, For that specific pixel AI, the binary data is always "1", and for each pixel A= (i・0, 2.3..., 7) in the window 60, the brightness data d is d! If ≧d, the binary data is “1”; if d,<d, the binary data is “0”
It is said that Therefore, even if the pixel is in the same image part as the specific pixel A, the brightness data d may be affected due to uneven brightness.
, is even slightly smaller than the brightness data di of the specific pixel AI, the binary data becomes 'OJ', making it difficult to detect an illegal pattern with high accuracy.

また第13図に示すように、ひとつの画像1内にコント
ラストが異なる複数の画像部分2゜3が存在するような
場合、前記した従来の2値化しきい値算出装置によると
、両方の画像部分2.3を2値画像として抽出するよう
な最適な2値化しきい値の算出動作が行われる。このた
めいずれか一方の画像部分を認識などの対象とするよう
な場合に、そのターゲットとなる画像部分にとって最適
な2値化しきい値とならず、最良な2値画像を得るのが
困難である。
Furthermore, as shown in FIG. 13, when there are multiple image parts 2°3 with different contrasts in one image 1, according to the conventional binarization threshold calculation device described above, both image parts An operation for calculating an optimal binarization threshold value is performed to extract 2.3 as a binary image. For this reason, when one of the image parts is targeted for recognition, etc., the binarization threshold is not optimal for that target image part, making it difficult to obtain the best binary image. .

この発明は、明るさのむらによる悪影響を受けずに最適
な2値化しきい値の算出が可能であり、しかもひとつの
画像内にコントラストの異なる複数の画像部分が存在し
ていても、ターゲットとする画像部分について最適な2
値化しきい値の算出を可能とした画像の2値化しきい値
算出装置を提供することを目的とする。
This invention makes it possible to calculate the optimal binarization threshold without being adversely affected by uneven brightness, and even if there are multiple image parts with different contrasts in one image, the target Optimal 2 for the image part
It is an object of the present invention to provide an image binarization threshold calculation device that enables calculation of a digitization threshold.

〈問題点を解決するための手段〉 この発明の2値化しきい値算出装置は、任意の画像部分
に着目して多値画像の全体を2値化処理するためのしき
い値を算出するものであって、前記多値画像に対しウィ
ンドウを設定して走査する走査手段と、ウィンドウ内の
画像につき明るさに関する情報を抽出する第1の情報抽
出手段と、ウィンドウ内の画像につき輪郭部の画像とし
ての適否に関する情報を抽出する第2の情報抽出手段と
、第1.第2の情報抽出手段からの各情報より画質の評
価基準を与える第3の情報を生成する情報生成手段と、
第3の情報に基づき最良の画質を与える最適なしきい値
を算出するしきい値算出手段とを具備している。
<Means for Solving the Problems> The binarization threshold calculation device of the present invention focuses on an arbitrary image part and calculates a threshold for binarizing the entire multivalued image. a scanning means for setting a window and scanning the multivalued image; a first information extraction means for extracting information regarding the brightness of the image within the window; and a first information extraction means for extracting information regarding the brightness of the image within the window; a second information extraction means for extracting information regarding the suitability of the first. Information generating means for generating third information that provides an image quality evaluation standard from each piece of information from the second information extracting means;
and threshold calculation means for calculating an optimal threshold value that provides the best image quality based on the third information.

そして前記第2の情報抽出手段には、ウィンドウ内の各
画素につきそれぞれの明るさと特定画素の明るさとの差
と、着目した画像部分のコントラストに比例するパラメ
ータとを比較してウィンドウ内の画像を2値化処理する
2値化回路部と、この2値化回路部で得た2値パターン
につき輪郭部の画像パターンとしての適否を判断する判
断回路とを含ませている。
The second information extraction means compares the difference between the brightness of each pixel within the window and the brightness of a specific pixel with a parameter proportional to the contrast of the image portion of interest, and extracts the image within the window. It includes a binarization circuit section that performs binarization processing, and a judgment circuit that decides whether or not the binary pattern obtained by the binarization circuit section is appropriate as an image pattern of an outline part.

〈作用〉 第2の情報抽出手段において、ウィンドウ内の各画素に
つきそれぞれの明るさと特定画素の明るさとの差と、着
目した画像部分のコントラストに比例するパラメータと
を比較してウィンドウ内の画像を2値化処理するので、
ひとつの画像内にコントラストが異なる複数の画像部分
が存在するような場合に、ターゲットとなる画像部分の
コントラストに応じて前記パラメータを選択することに
より、その画像部分について最適な2値化しきい値を算
出し得る。
<Operation> The second information extraction means compares the difference between the brightness of each pixel within the window and the brightness of a specific pixel with a parameter proportional to the contrast of the image part of interest, and extracts the image within the window. Since it is binarized,
When there are multiple image parts with different contrasts in one image, by selecting the above parameters according to the contrast of the target image part, the optimal binarization threshold value can be determined for that image part. It can be calculated.

また同一の画像部分内に明るさのムラがあっても、ウィ
ンドウ内の画像を2値化処理した得た2値パターンが前
記ムラによる悪影響を受けるのを排除できる。
Furthermore, even if there is unevenness in brightness within the same image portion, it is possible to prevent the binary pattern obtained by binarizing the image within the window from being adversely affected by the unevenness.

〈実施例〉 第1図は、この発明の2値化しきい値算出装置の一樋底
である非合法パターン検出部12’の具体例を示してい
る。
<Embodiment> FIG. 1 shows a specific example of an illegal pattern detection section 12' which is the bottom of the binarization threshold calculation device of the present invention.

図示例のものは、濃淡画像上に、第2図に示すような縦
横3×3画素のウィンドウ5を設定してラスク走査する
場合に、そのウィンドウ5内の画像が合法パターンか、
非合法パターンかを判別するためのものである。なお図
示例のウィンドウ5は、前記したウィンドウ60とは形
状が相違するが、ウィンドウの形状は特に限定されず、
この二種以外の形状のものを用いてもよい。
In the illustrated example, when a window 5 of 3×3 pixels in length and width as shown in FIG.
This is to determine whether the pattern is illegal. Note that although the window 5 in the illustrated example has a different shape from the window 60 described above, the shape of the window is not particularly limited.
Shapes other than these two types may be used.

第3図は、上記ウィンドウ5を走査するためのウィンド
ウ走査部11′の構成例を示す。同図のものでは、6個
のラッチ回路91〜96とシフトレジスタのような2個
の遅延回路97゜98とを用いて上記ウィンドウ5のラ
スク走査を実現しており、このウィンドウ5内の各画素
A0〜A、につきそれぞれの明るさデータd0〜d8が
同時に取り出されて非合法パターン検出部12’に与え
られる。
FIG. 3 shows an example of the configuration of a window scanning section 11' for scanning the window 5. As shown in FIG. In the figure, six latch circuits 91 to 96 and two delay circuits 97 and 98 such as shift registers are used to realize rask scanning of the window 5. Brightness data d0 to d8 for pixels A0 to A are simultaneously extracted and provided to the illegal pattern detection section 12'.

なおウィンドウ走査部11’のその他の構成として、第
6図に示すように画像メモリ24やアドレスジェネレー
タ19などを含むことは勿論である。またこの発明の2
値化しきい値算出装置は、第6図の従来例と同様、マイ
クロコンピュータ10を制御主体として、上記ウィンド
ウ走査部11’や非合法パターン検出部12′の他に、
非合法パターンヒストグラム生成部13、明るさヒスト
グラム主成部142画質ヒストグラム生成部15.ヒス
トグラム平滑処理部16.最適しきい値探索部17を具
備するものである。
It goes without saying that other components of the window scanning section 11' include an image memory 24, an address generator 19, etc., as shown in FIG. Also, 2 of this invention
Similar to the conventional example shown in FIG. 6, the valorization threshold calculation device is controlled by a microcomputer 10, and includes, in addition to the window scanning section 11' and illegal pattern detection section 12',
Illegal pattern histogram generation section 13, brightness histogram main generation section 142, image quality histogram generation section 15. Histogram smoothing processing unit 16. It is equipped with an optimum threshold value search section 17.

第1図に戻って、非合法パターン検出部12′はウィン
ドウ5内の各画素A0〜A、の明るさデータd。−d、
をラッチする9個のラッチ回路70〜78を備え、一番
目のラッチ回路70からは特定画素(中心画素)Aoの
明るさデータd0が、二番目以降のラッチ回路71〜7
8からは他の画素A1〜Asの明るさデータd1〜d、
が、それぞれ8個の比較回路80〜87へ入力されるよ
うになっている。
Returning to FIG. 1, the illegal pattern detection unit 12' detects brightness data d of each pixel A0 to A within the window 5. -d,
The brightness data d0 of a specific pixel (center pixel) Ao is transmitted from the first latch circuit 70 to the second and subsequent latch circuits 71 to 7.
From 8, brightness data d1 to d of other pixels A1 to As,
are input to eight comparison circuits 80 to 87, respectively.

これら比較回路80〜87には、上記明るさデータの他
に、さらにターゲットとする画像部分のコントラスト(
画像部分の明るさと背景部分の明るさとの差)に比例す
る2個のパラメータrM、rL(ただしrH>rL)が
入力される。その結果、各比較回路80〜87は各画素
A=(i・1,2.3.・・・・、8)について明るさ
データd、と特定画素A0についての明るさデータd0
との差(dt   ao)が、−rt <dt −d。
In addition to the above-mentioned brightness data, these comparison circuits 80 to 87 also contain the contrast (
Two parameters rM and rL (where rH>rL) that are proportional to the difference between the brightness of the image portion and the brightness of the background portion are input. As a result, each comparison circuit 80 to 87 outputs brightness data d for each pixel A=(i・1,2.3...,8) and brightness data d0 for the specific pixel A0.
The difference (dt ao) is -rt <dt -d.

<−rHならば2値データf、として「O」を、それ以
外であれば2値データf、として「1」を、それぞれ検
出ロジック部50へ出力するものである。
If <-rH, "O" is output as binary data f, and otherwise, "1" is output as binary data f to the detection logic unit 50.

第4図は、上記の明るさデータの差(di −aO)と
比較回路80〜87の出力との関係を示すもので、(d
i  do)の値が領域S内であれば比較出力はrQJ
であり、領域S外であれば比較出力は「1」である。な
お明るさデータの差(di −do )は明るさデータ
が256諧調のいずれか値をとることから、最小−25
6から最大256までの値をとる。
FIG. 4 shows the relationship between the difference in brightness data (di −aO) and the outputs of the comparison circuits 80 to 87, and (d
If the value of i do) is within the region S, the comparison output is rQJ
If it is outside the area S, the comparison output is "1". Note that the difference in brightness data (di-do) is at least -25 because the brightness data takes any value of 256 tones.
It takes a value from 6 to a maximum of 256.

前記検出ロジック部50は、各比較回路80〜87から
与えられた2値データfiと、前記特定画素A0につい
ての2値データf、(ただしfoは常に「1」とする。
The detection logic section 50 receives the binary data fi given from each of the comparison circuits 80 to 87, and the binary data f regarding the specific pixel A0 (however, fo is always set to "1").

)とによってウィンドウ5内の画像が非合法パターンで
あるか否かを判断し、非合法パターンであれば「1」の
フラグを、合法パターンであれば「0」のフラグを、そ
れぞれ出力する。
), it is determined whether the image in the window 5 is an illegal pattern or not, and if it is an illegal pattern, a flag of "1" is output, and if it is a legal pattern, a flag of "0" is output.

このように、非合法パターンの検出処理に、ターゲット
とする画像部分のコントラストに比例した2個のパラメ
ータrH,rLを用いると、それ以外の画像部分につい
ての輪郭部では明るさデータの差(at −do )が
第4図中、領域S外となってウィンドウ5内の2値画像
は非合法パターンとなり、ターゲットとする画像部分の
みをくっきりと抽出するような2値化しきい値を得るこ
とができる。
In this way, when the two parameters rH and rL, which are proportional to the contrast of the target image part, are used in the illegal pattern detection process, the difference in brightness data (at -do) is outside the area S in Figure 4, and the binary image in window 5 becomes an illegal pattern, making it impossible to obtain a binarization threshold that clearly extracts only the target image part. can.

いま第13図に示すような、コントラストの大きな画像
部分2と、コントラストの小さな画像部分3とを含む濃
淡画像1を想定すると、各画像部分2.3の構成画素に
ついての明るさデータの差(dz   da)は第5図
(3)に示すような分布となる。
Assuming a grayscale image 1 including an image portion 2 with high contrast and an image portion 3 with low contrast as shown in FIG. 13, the difference in brightness data for the constituent pixels of each image portion 2.3 ( dz da) has a distribution as shown in FIG. 5 (3).

そこでコントラストの大きな画像部分2をターゲットと
する場合は、第5図(2)に示すように前記のパラメー
タr14+rLを大きくとる。これによりコントラスト
の小さな画像部分3についての輪郭部では明るさデータ
の差(di−do)が第5図(2)中、領域S外となっ
てウィンドウ5内の2値画像は非合法パターンとなり、
画像部分2のみをくっきりと抽出するような2値化しき
い値を得ることができる。
Therefore, when the image portion 2 with high contrast is targeted, the parameter r14+rL is set to a large value as shown in FIG. 5(2). As a result, the difference in brightness data (di-do) at the contour of the image portion 3 with low contrast is outside the area S in FIG. 5 (2), and the binary image within the window 5 becomes an illegal pattern. ,
It is possible to obtain a binarization threshold that clearly extracts only image portion 2.

またコントラストの小さな画像部分3をターゲットとす
る場合は、第5図(1)に示すように前記のパラメータ
rM+rLを小さくとる。これによりコントラストの大
きな画像部分2についての輪郭部では明るさデータの差
(di   do)が第5°図(1)中、領域S外とな
ってウィンドウ5内の2値画像は非合法パターンとなり
、画像部分3のみを(っきりと抽出するような2値化し
きい値を得ることができる。
Furthermore, when the image portion 3 with low contrast is targeted, the above-mentioned parameter rM+rL is set small as shown in FIG. 5(1). As a result, the difference in brightness data (di do) at the contour of image part 2 with large contrast is outside the area S in Figure 5 (1), and the binary image in window 5 becomes an illegal pattern. , it is possible to obtain a binarization threshold that clearly extracts only image portion 3.

なお上記パラメータr)l+rLは、画素の明るさの分
布に基づき人手を介して適当な値を入力してもよく、ま
たファジィ推論などにより自動的に決定して入力しても
よい。
Note that the above parameter r)l+rL may be manually inputted as an appropriate value based on the brightness distribution of the pixels, or may be automatically determined and inputted by fuzzy inference or the like.

〈発明の効果〉 この発明は上記の如く、多値画像を走査するウィンドウ
内の画像につき輪郭部の画像としての適否に関する情報
を抽出するのに、ウィンドウ内の各画素につきそれぞれ
の明るさと特定画素の明るさとの差と、着目した特定の
画像部分のコントラストに比例するパラメータとを比較
してウィンドウ内の画像を2値化処理するようにしたか
ら、ひとつの画像内にコントラストが異なる複数の画像
部分が存在するような場合に、ターゲットとなる画像部
分のコントラストに応じて前記パラメータを選択するこ
とにより、その画像部分にとって最適な2値化しきい値
を算出することが可能となった。
<Effects of the Invention> As described above, the present invention extracts information regarding the suitability of an outline of an image within a window for scanning a multivalued image by determining the brightness and specific pixel values for each pixel within the window. Since the image within the window is binarized by comparing the difference in brightness with a parameter proportional to the contrast of the specific image part of interest, multiple images with different contrasts can be generated in one image. When a portion exists, by selecting the parameters according to the contrast of the target image portion, it is now possible to calculate the optimal binarization threshold for that image portion.

また同一の画像部分内に明るさのムラがあっても、ウィ
ンドウ内の画像を2値化処理して得た2値パターンが前
記ムラによる悪影響を受けるのを排除できるなど、発明
目的を達成した顕著な効果を奏する。
Furthermore, even if there is unevenness in brightness within the same image area, the binary pattern obtained by binarizing the image within the window can be prevented from being adversely affected by the unevenness, thus achieving the purpose of the invention. It has a remarkable effect.

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

第1図はこの発明の2値化しきい値算出装置に用いられ
る非合法パターン検出部の構成例を示すブロック図、第
2図は濃淡画像に対して設定されるウィンドウの概念を
示す説明図、第3図は非合法パターンの構成例を示すブ
ロック図、第4図は明るさデータの差と比較回路の比較
出力との関係を示す説明図、第5図はパラメータの設定
方法を示す説明図、第6図は従来の2値化しきい値算出
装置の構成を示すブロック図、第7図は従来の非合法パ
ターン検出部の構成例を示すブロック図、第8図は濃淡
画像に対して設定されるウィンドウの概念を示す説明図
、第9図はウィンドウ内の画像の2値化過程を示す説明
図、第10図は合法パターンの一例を示す説明図、第1
1図は非合法パターンの一例を示す説明図、第12図は
画質ヒストグラムを示す説明図、第13図は異なるコン
トラストの画像部分を含む画像の一例を示す説明図であ
る。 11・・・・ウィンドウ走査部 12・・・・非合法パターン検出部 13・・・・非合法パターンヒストグラム生成部14′
・・・・明るさヒストグラム生成部15・・・・画質ヒ
ストグラム生成部 17・・・・最適しきい値探索部
FIG. 1 is a block diagram showing an example of the configuration of an illegal pattern detection section used in the binarization threshold calculation device of the present invention, and FIG. 2 is an explanatory diagram showing the concept of a window set for a grayscale image. Fig. 3 is a block diagram showing a configuration example of an illegal pattern, Fig. 4 is an explanatory diagram showing the relationship between the difference in brightness data and the comparison output of the comparison circuit, and Fig. 5 is an explanatory diagram showing the parameter setting method. , Fig. 6 is a block diagram showing the configuration of a conventional binarization threshold calculation device, Fig. 7 is a block diagram showing an example of the configuration of a conventional illegal pattern detection section, and Fig. 8 is a block diagram showing the configuration of a conventional illegal pattern detection section. FIG. 9 is an explanatory diagram showing the binarization process of the image in the window. FIG. 10 is an explanatory diagram showing an example of a legal pattern.
FIG. 1 is an explanatory diagram showing an example of an illegal pattern, FIG. 12 is an explanatory diagram showing an image quality histogram, and FIG. 13 is an explanatory diagram showing an example of an image including image parts with different contrasts. 11...Window scanning unit 12...Illegal pattern detection unit 13...Illegal pattern histogram generation unit 14'
... Brightness histogram generation section 15 ... Image quality histogram generation section 17 ... Optimal threshold value search section

Claims (1)

【特許請求の範囲】 任意の画像部分に着目して多値画像の全体を2値化処理
するためのしきい値を算出する装置であって、 前記多値画像に対しウィンドウを設定して走査する走査
手段と、 ウィンドウ内の画像につき明るさに関する情報を抽出す
る第1の情報抽出手段と、 ウィンドウ内の画像につき輪郭部の画像としての適否に
関する情報を抽出する第2の情報抽出手段と、 第1、第2の情報抽出手段からの各情報より画質の評価
基準を与える第3の情報を生成する情報生成手段と、 第3の情報に基づき最良の画質を与える最適なしきい値
を算出するしきい値算出手段とを備え、 前記第2の情報抽出手段は、 ウィンドウ内の各画素につきそれぞれの明るさと特定画
素の明るさとの差と、着目した画像部分のコントラスト
に比例するパラメータとを比較してウィンドウ内の画像
を2値化処理する2値化回路部と、 この2値化回路部で得た2値パターンにつき輪郭部の画
像パターンとしての適否を判断する判断回路とを含んで
成る画像の2値化しきい値算出装置。
[Claims] An apparatus for calculating a threshold value for binarizing the entire multivalued image by focusing on an arbitrary image part, the apparatus comprising: setting a window for the multivalued image and scanning the multivalued image; a first information extraction means for extracting information regarding the brightness of the image within the window; and a second information extraction means for extracting information regarding the suitability of the contour as an image for the image within the window; information generating means for generating third information giving an image quality evaluation standard from each piece of information from the first and second information extracting means; and calculating an optimal threshold value giving the best image quality based on the third information. threshold value calculation means, the second information extraction means compares the difference between the brightness of each pixel in the window and the brightness of a specific pixel with a parameter proportional to the contrast of the image portion of interest. and a judgment circuit that judges whether or not the binary pattern obtained by the binarization circuit is appropriate as an image pattern of the contour part. Image binarization threshold calculation device.
JP2033208A 1990-02-13 1990-02-13 Device for calculating binarizing threshold of image Pending JPH03237571A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2033208A JPH03237571A (en) 1990-02-13 1990-02-13 Device for calculating binarizing threshold of image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2033208A JPH03237571A (en) 1990-02-13 1990-02-13 Device for calculating binarizing threshold of image

Publications (1)

Publication Number Publication Date
JPH03237571A true JPH03237571A (en) 1991-10-23

Family

ID=12380043

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2033208A Pending JPH03237571A (en) 1990-02-13 1990-02-13 Device for calculating binarizing threshold of image

Country Status (1)

Country Link
JP (1) JPH03237571A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE10020178B4 (en) * 1999-04-21 2005-01-13 Ricoh Co., Ltd. Apparatus and method for image binarization and apparatus and method for image acquisition
DE10066045B4 (en) * 1999-04-21 2006-05-18 Ricoh Co., Ltd. Image generation unit for document processing has block division unit, luminance value output section, adjustment units, digitization section, object block selection unit, ranging section and calculation unit.
US7623727B2 (en) 1999-04-21 2009-11-24 Ricoh Company, Ltd. Image binarization apparatus, image binarization method, image pickup apparatus, image pickup method, and a computer product

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE10020178B4 (en) * 1999-04-21 2005-01-13 Ricoh Co., Ltd. Apparatus and method for image binarization and apparatus and method for image acquisition
DE10066045B4 (en) * 1999-04-21 2006-05-18 Ricoh Co., Ltd. Image generation unit for document processing has block division unit, luminance value output section, adjustment units, digitization section, object block selection unit, ranging section and calculation unit.
US7623727B2 (en) 1999-04-21 2009-11-24 Ricoh Company, Ltd. Image binarization apparatus, image binarization method, image pickup apparatus, image pickup method, and a computer product

Similar Documents

Publication Publication Date Title
JP3308617B2 (en) Apparatus and method for detecting motion vector
JP3725784B2 (en) Apparatus and method for detecting moving object in color frame image sequence
JPH03237571A (en) Device for calculating binarizing threshold of image
JPH11312243A (en) Facial region detector
JPH04227581A (en) Binarizing-threshold calculation device for image
JP2646569B2 (en) Multi-value image evaluation device and threshold value determination device using the device
JP2957878B2 (en) Image processing device
JP2628863B2 (en) Visual recognition device
JPH06201715A (en) Moving object detecting device
JP3091356B2 (en) Moving object detection method and apparatus
JPH09288037A (en) Inspection method for lcd panel
JP2001243479A (en) Method and device for image processing and recording medium having image processing program recorded thereon
JP3585143B2 (en) Character string extraction method and device
JPH10232931A (en) Image processing method and image processor
JP3899602B2 (en) Closed region detection method and apparatus
JP3074691B2 (en) Character recognition device
JP2000036047A (en) Picture processor
JPH05225337A (en) Method extracting boundary and device therefor
JP3880665B2 (en) Multi-tone image density histogram calculation device
JPH05225336A (en) Method for extracting boundary and device therefor
JPH10136258A (en) Outline extraction device/method
JP2001056860A (en) Image processor
JPH06251202A (en) Character recognition device
CN114596242A (en) Defect detection method, defect detection device, electronic equipment and computer readable storage medium
JPH1079035A (en) Specific object extracting device