JPH09311936A - Image binarization method and device therefor - Google Patents

Image binarization method and device therefor

Info

Publication number
JPH09311936A
JPH09311936A JP8127168A JP12716896A JPH09311936A JP H09311936 A JPH09311936 A JP H09311936A JP 8127168 A JP8127168 A JP 8127168A JP 12716896 A JP12716896 A JP 12716896A JP H09311936 A JPH09311936 A JP H09311936A
Authority
JP
Japan
Prior art keywords
frequency
image
luminance
occurrence
occurrence frequency
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
JP8127168A
Other languages
Japanese (ja)
Inventor
恭男 ▲櫛▼渕
Takao Kushibuchi
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.)
Anritsu Corp
Original Assignee
Anritsu Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Anritsu Corp filed Critical Anritsu Corp
Priority to JP8127168A priority Critical patent/JPH09311936A/en
Publication of JPH09311936A publication Critical patent/JPH09311936A/en
Pending legal-status Critical Current

Links

Landscapes

  • Character Input (AREA)
  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

PROBLEM TO BE SOLVED: To obtain a correct binary image where a detected image can be correctly discriminated from its background by calculating the occurrence frequency of each luminance of pixels forming a two-dimensional image and binarizing this image with the occurrence frequency decided when the addition value of those occurrence frequency is equal to a prescribed level defined as the threshold. SOLUTION: A frequency table generation part 6 calculates the occurrence frequency N of each luminance I of pixels forming a two-dimensional image and produces a frequency table 12. A frequency rearrangement part 13 rearranges the frequency N contained in the table 12 in the order of smaller value of them and generates a frequency order table 14. A threshold calculation part 15 calculates the threshold NHJ of occurrence frequency based on each frequency order J set on the table 14 and the occurrence frequency N1 of the order J. A binarization processing part 16 binarized the two-dimensional image stored in an image memory 5 into a binary image 18 based on the threshold NHJ of the frequency N calculated at the part 15. Then a display part 17 displays and outputs the image 18.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は2次元画像を2値化
する画像2値化方法及び画像2値化装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image binarization method and an image binarization apparatus for binarizing a two-dimensional image.

【0002】[0002]

【従来の技術】例えば、ラベルに表記された文字を認識
したり、物体の形状を認識したり、または所定場所を移
動物体が通過したことを検出するシステムにおいては、
カメラで撮影した検出対象の像を含む所定面積分の2次
元画像を2値化して、形状判断等の各種の画像処理を行
う。
2. Description of the Related Art For example, in a system for recognizing characters written on a label, recognizing the shape of an object, or detecting that a moving object has passed a predetermined place,
A two-dimensional image of a predetermined area including an image of a detection target captured by a camera is binarized, and various image processing such as shape determination is performed.

【0003】このような画像処理の対像となる2次元画
像においては、検出像面積が背景面積に比較して所定割
合以下である場合が多い。例えば、同一色のラベルに異
なる色で文字が描かれていた場合は、文字の面積は背景
の面積に比較して20%〜30%以下である。また、例
えば、走行中車両のナンバープレートの車両番号を読取
る場合等においては、乗用車であれば、白の背景に対し
て緑の文字が記載されているが、この緑の文字の白の背
景に対する面積割合は10%〜20%である。さらに、
道路を通過する車両を検出する場合は、車両は一定の車
間間隔を開けて走行するので、例えば背景がフェンスや
空又は路面等の場合は、検出像(車両)の面積は背景の
面積に比較して20%〜30%である。
In many cases, in a two-dimensional image which is the image of such image processing, the detected image area is smaller than a predetermined ratio as compared with the background area. For example, when characters are drawn in different colors on the same color label, the area of the characters is 20% to 30% or less of the area of the background. In addition, for example, when reading the vehicle number on the license plate of a running vehicle, in the case of a passenger car, green characters are described against a white background, but this green character corresponds to a white background. The area ratio is 10% to 20%. further,
When detecting a vehicle passing through a road, the vehicle travels with a certain vehicle-to-vehicle spacing, so if the background is a fence, sky, or road surface, for example, the area of the detected image (vehicle) is compared to the area of the background. And 20% to 30%.

【0004】このように、検出像面積が背景面積に比較
して所定割合以下である2次元画像を2値化する手法と
して、pータイル法が実用化されている(「コンピュー
タ画像処理入門」 田村秀行 監修 総研出版)。
As described above, the p-tile method has been put into practical use as a method for binarizing a two-dimensional image in which the detected image area is less than a predetermined ratio compared with the background area ("Introduction to Computer Image Processing" Tamura. Hideyuki supervised by Soken Publishing).

【0005】図7は、このpータイル法を採用した画像
2値化装置の概略構成を示すブロック図である。例えば
紙に描かれた2次元の像1はカメラ2で読取られてデジ
タルの2次元画像に変換されて画像バッファ3に一旦書
込まれる。画像バッファ3に書込まれた2次元画像は次
の画像切出部4で検出像と背景とを含む所定面積(所定
画素数)の2次元画像に切出されて、画像メモリ5へ書
込まれる。画像メモリ5内に記憶されている2次元画像
を構成する各画素Pは自己のxy座標と例えば4又は8
ビット等の所定ビット構成の輝度Iを有している。した
がって、各画素はP(x,y,I)と表記される。
FIG. 7 is a block diagram showing a schematic configuration of an image binarization apparatus adopting the p-tile method. For example, a two-dimensional image 1 drawn on paper is read by a camera 2, converted into a digital two-dimensional image, and temporarily written in an image buffer 3. The two-dimensional image written in the image buffer 3 is cut out by the next image cutting-out unit 4 into a two-dimensional image having a predetermined area (a predetermined number of pixels) including the detected image and the background and written in the image memory 5. Be done. Each pixel P forming a two-dimensional image stored in the image memory 5 has its own xy coordinate and, for example, 4 or 8
It has a brightness I of a predetermined bit configuration such as bits. Therefore, each pixel is written as P (x, y, I).

【0006】頻度テーブル作成部6は、2次元画像を構
成する各画素P(x,y,I)における各輝度Iの発生
頻度を算出して、頻度テーブルを作成する。この頻度テ
ーブルは、図8に示すように、グラフ化することも可能
である。
The frequency table creating section 6 creates the frequency table by calculating the occurrence frequency of each brightness I in each pixel P (x, y, I) forming the two-dimensional image. This frequency table can also be graphed as shown in FIG.

【0007】2値化処理部7は頻度テーブルに設定され
た各輝度Iの発生頻度NI を用いて2次元画像を2値化
して、表示部8に2値化画像を表示する。図9は2値化
処理部7の具体的な2値化処理手順を示す流れ図であ
る。
The binarization processing unit 7 binarizes the two-dimensional image using the occurrence frequency N I of each luminance I set in the frequency table and displays the binarized image on the display unit 8. FIG. 9 is a flow chart showing a specific binarization processing procedure of the binarization processing unit 7.

【0008】流れ図が開始され、P1にて輝度Iの順位
Kを1に初期化する。なお、この輝度順位Kは輝度が高
い順番から降順に並んでいるものとする。すなわち、輝
度順位Kの1は、最高輝度を示す。例えば、輝度が0か
ら256の範囲の場合、輝度順位K=1は輝度256を
示し、輝度順位K=2は輝度255を示す。また、P1
にて画素数で示される面積Sを0に初期化する。
The flow chart starts, and the rank K of the brightness I is initialized to 1 at P1. The luminance order K is assumed to be arranged in descending order from the highest luminance. That is, 1 in the brightness rank K indicates the highest brightness. For example, when the brightness is in the range of 0 to 256, the brightness rank K = 1 indicates the brightness 256 and the brightness rank K = 2 indicates the brightness 255. Also, P1
The area S indicated by the number of pixels is initialized to zero.

【0009】P2にて、面積Sに輝度順位Kの輝度Iの
頻度NK を加算する(S=S+NK)。但し、各画素P
(x,y,I)の頻度は頻度1が1単位面積を有してい
るとする。P3にて加算後の面積Sが予め定められた2
次元画像面積の例えば20%に対応する面積SH に達し
ていないと、P4にて輝度順位Kに1を加算して、P2
へ戻る。
At P2, the frequency N K of the brightness I of the brightness rank K is added to the area S (S = S + N K ). However, each pixel P
Regarding the frequency of (x, y, I), it is assumed that frequency 1 has one unit area. The area S after the addition in P3 is predetermined 2
If the area S H corresponding to, for example, 20% of the three-dimensional image area has not been reached, 1 is added to the brightness rank K in P4, and P2 is added.
Return to.

【0010】P3にて、加算後の面積Sが予め定められ
た面積SH に達すると、この時点の輝度順位Kに対応す
る輝度Iを閾値IHKとする(P5)。そして、画像メモ
リ5に記憶されている2次元画像の各画素P(x,y,
I)の輝度Iを前記閾値IHKで2値化する(P6)。そ
して、2値化画像を作成し(P7)、作成した2値化画
像を表示部8に表示出力する(P8)。
When the area S after addition reaches the predetermined area S H at P3, the brightness I corresponding to the brightness rank K at this point is set as the threshold value I HK (P5). Then, each pixel P (x, y, of the two-dimensional image stored in the image memory 5
The brightness I of I) is binarized by the threshold value I HK (P6). Then, a binarized image is created (P7), and the created binarized image is displayed and output on the display unit 8 (P8).

【0011】[0011]

【発明が解決しようとする課題】しかしながら、上述し
たpータイル法を採用した画像2値化方法及び画像2値
化装置装置においてもまだ解消すべき次のような課題が
あった。例えば、図10(d)に示す紙に描かれた2次
元の像1に光が照射されていなくて、全体に暗い場合
は、撮影された2次元画像10(base)は図10(a)に
示すように、検出像10aの部分の輝度が4であり、背
景10bの部分の輝度が1である場合においては、図1
1(a)の輝度頻度特性に示すように、背景10b部分
の輝度頻度a1 と検出像10a部分の輝度頻度a2 との
間には大きな差が存在するので、2値化のための閾値I
HKa は輝度1と輝度4との間に存在し、図10(d)に
示す2次元画像10(base)は正しく2値化される。
However, the image binarization method and the image binarization apparatus using the p-tile method described above still have the following problems to be solved. For example, when the two-dimensional image 1 drawn on the paper shown in FIG. 10 (d) is not illuminated with light and is entirely dark, the captured two-dimensional image 10 (base) is shown in FIG. 10 (a). As shown in FIG. 1, when the brightness of the part of the detected image 10a is 4 and the brightness of the part of the background 10b is 1,
As shown in the luminance frequency characteristic of 1 (a), since between the brightness frequency a 2 of brightness frequency a 1 and the detection image 10a portion of the background 10b part there is a large difference, the threshold value for binarization I
HKa exists between the brightness 1 and the brightness 4, and the two-dimensional image 10 (base) shown in FIG. 10D is correctly binarized.

【0012】また、紙に描かれた2次元の像1に光が照
射されていて、全体に明るい場合は、撮影された2次元
画像10(base)は図10(b)に示すように、検出像1
0aの部分の輝度が8であり、背景10bの部分の輝度
が5である場合においては、図11(b)の輝度頻度特
性に示すように、背景10b部分の輝度頻度b1 と検出
像10a部分の輝度頻度b2 との間には大きな差が存在
するので、2値化のための閾値IHKb は輝度5と輝度8
との間に存在し、図10(d)に示す2次元画像10(b
ase)は正しく2値化される。
If the two-dimensional image 1 drawn on the paper is illuminated with light and the entire image is bright, the photographed two-dimensional image 10 (base) is as shown in FIG. 10 (b). Detection image 1
When the luminance of the portion of 0a is 8 and the luminance of the portion of the background 10b is 5, as shown in the luminance frequency characteristic of FIG. 11B, the luminance frequency b 1 of the background 10b portion and the detected image 10a Since there is a large difference between the brightness frequency b 2 of a part and the threshold value I HKb for binarization, brightness 5 and brightness 8 are set.
And the two-dimensional image 10 (b) shown in FIG.
ase) is correctly binarized.

【0013】しかし、紙に描かれた2次元の像1に光が
照射される部分と影の部分とが存在すると、撮影された
2次元画像10(base)は図10(c)に示すように、同
一背景10b部分であっても輝度が1の部分と輝度が5
の部分とが発生し、また、同一検出像10aにおいて
も、輝度が4の部分と輝度が8の部分とが存在する。こ
の場合、検出像10aの一方の輝度4は、背景10bの
他方の輝度5より低い(暗い)逆転現像が生じる。
However, if the two-dimensional image 1 drawn on the paper has a portion irradiated with light and a shaded portion, the photographed two-dimensional image 10 (base) is as shown in FIG. 10 (c). In addition, even in the same background 10b part, the part where the brightness is 1 and the brightness is 5
And the same detection image 10a also has a portion having a luminance of 4 and a portion having a luminance of 8. In this case, one of the luminances 4 of the detected image 10a is lower (darker) than the other luminance 5 of the background 10b, and the reverse development occurs.

【0014】したがって、この場合、図11(c)の輝
度頻度特性に示すように、c1 〜c4 の4つの輝度頻度
が存在する。そして、2値化のための閾値IHKc は輝度
5と輝度8との間に存在する。すなわち、閾値IHKc よ
り下に検出像10aの一方の輝度4が存在するので、こ
の検出像10aの一方部分は背景と同一になり、図12
に示すように、誤った2値化画像11が得られる。
Therefore, in this case, as shown in the luminance frequency characteristic of FIG. 11C, there are four luminance frequencies c 1 to c 4 . The threshold I HKc for binarization exists between the luminance 5 and the luminance 8. That is, since one luminance 4 of the detection image 10a exists below the threshold value I HKc , one portion of this detection image 10a becomes the same as the background, and
An erroneous binarized image 11 is obtained as shown in FIG.

【0015】また、図13(a)に示すように、輝度の
範囲が0〜99であり、2次元画像10(base)における
検出像の輝度が0〜9の狭い範囲で変化している場合に
おいて、この2次元画像10(base)を[0]と[99]
とで2値化すると、閾値が5となり、図13(b)に示
すように、1〜4の輝度は背景10bとなり、検出像1
0aを正確に検出できない。
Further, as shown in FIG. 13A, when the brightness range is 0 to 99 and the brightness of the detected image in the two-dimensional image 10 (base) is changing in a narrow range of 0 to 9. In this two-dimensional image 10 (base), [0] and [99]
When binarized with, the threshold value becomes 5, and as shown in FIG. 13 (b), the brightness of 1 to 4 becomes the background 10b, and the detected image 1
0a cannot be detected accurately.

【0016】本発明はこのような事情に鑑みてなされた
ものであり、輝度の発生頻度を基準として閾値を設定す
ることによって、たとえ2次元の像に均一に光が照射さ
れていなかったとしても、また、たとえ検出像の輝度に
細かい変動があったとしても、検出像を背景に対して正
しく区別できる正しい2値化画像を得ることができる画
像2値化方法及び画像2値化装置を提供することを目的
とする。
The present invention has been made in view of the above circumstances, and by setting a threshold value based on the frequency of occurrence of luminance, even if the two-dimensional image is not uniformly illuminated with light. Provided are an image binarization method and an image binarization device that can obtain a correct binarized image that can correctly distinguish the detected image from the background even if there is a slight variation in the brightness of the detected image. The purpose is to do.

【0017】[0017]

【課題を解決するための手段】上記課題を解消するため
に本発明の画像2値化方法においては、検出像面積が背
景面積に比較して所定割合以下である2次元画像を構成
する各画素における各輝度の発生頻度を求め、求めた各
輝度の発生頻度を発生頻度の小さい順に加算していき、
加算値が所定値に達したときの発生頻度を閾値とし、こ
の閾値で2次元画像を2値化するようにしている。
In order to solve the above problems, in the image binarization method of the present invention, each pixel forming a two-dimensional image in which the detected image area is a predetermined ratio or less compared to the background area. Then, the frequency of occurrence of each luminance in is calculated, and the frequency of occurrence of each luminance obtained is added in ascending order of the frequency of occurrence.
The occurrence frequency when the added value reaches a predetermined value is set as a threshold value, and the two-dimensional image is binarized by this threshold value.

【0018】また、本発明の画像2値化装置において
は、検出像面積が背景面積に比較して所定割合以下であ
る2次元画像を構成する各画素における各輝度の発生頻
度を求める発生頻度算出手段と、発生頻度算出手段で求
められた各輝度の発生頻度を発生頻度の小さい順に加算
していき、加算値が所定値に達したときの発生頻度を閾
値とする閾値算出手段と、閾値算出手段で求めた閾値で
2次元画像を2値化する2値化手段とを備えたものであ
る。
Further, in the image binarizing apparatus of the present invention, the occurrence frequency is calculated to find the occurrence frequency of each luminance in each pixel forming a two-dimensional image in which the detected image area is less than a predetermined ratio compared with the background area. Means, a threshold value calculating means for adding the occurrence frequencies of the respective luminances obtained by the occurrence frequency calculating means in ascending order of the occurrence frequency, and a threshold value for the occurrence frequency when the added value reaches a predetermined value, and a threshold value calculation And a binarizing means for binarizing the two-dimensional image with the threshold value obtained by the means.

【0019】このように構成された画像2値化方法及び
画像2値化装置の動作原理を説明する。検出像面積が背
景面積に比較して所定割合以下である2次元画像におい
ては、背景部分の輝度の発生頻度は検出像部分の輝度の
発生頻度に比較して格段に小さい。この場合、2次元の
像に均一に光が照射されていなくて、背景部分の輝度が
複数に分割されたとしても、複数に分割された各輝度の
頻度は検出像部分の輝度の発生頻度に比較して十分大き
い。
The operation principle of the image binarization method and the image binarization apparatus thus configured will be described. In a two-dimensional image in which the detected image area is equal to or less than a predetermined ratio as compared with the background area, the frequency of occurrence of luminance in the background portion is significantly smaller than the frequency of occurrence of luminance in the detected image portion. In this case, even if the two-dimensional image is not uniformly irradiated with light and the luminance of the background portion is divided into a plurality of portions, the frequency of each of the plurality of divided luminances is equal to the frequency of occurrence of the luminance of the detected image portion. Big enough in comparison.

【0020】さらに、背景部分の輝度が複数に分割さ
れ、かつ検出像部分の輝度も複数に分割された場合は、
複数に分割された検出像部分の各輝度の各頻度は、複数
に分割された背景部分の各輝度の各頻度に比較して十分
小さい。
Further, when the luminance of the background portion is divided into a plurality of pieces and the luminance of the detected image portion is also divided into a plurality of pieces,
Each frequency of each luminance of the detection image portion divided into a plurality is sufficiently smaller than each frequency of each luminance of the background portion divided into a plurality.

【0021】したがって、本発明においては、2次元画
像を構成する各画素における各輝度の発生頻度を小さい
順に順次加算していき、加算値が所定値に達した時点の
発生頻度を閾値と設定し、この閾値で2次元画像を2値
化している。
Therefore, in the present invention, the frequency of occurrence of each luminance in each pixel forming a two-dimensional image is sequentially added in ascending order, and the frequency of occurrence at the time when the added value reaches a predetermined value is set as a threshold value. , The two-dimensional image is binarized with this threshold value.

【0022】すなわち、この閾値以下の各発生頻度の各
輝度に対応する画素を2値のうちの一方とし、この閾値
を越える各発生頻度の各輝度に対応する画素を2値のう
ちの他方とすることによって、発生頻度の小さい輝度を
含む検出像部分と発生頻度の大きい輝度を含む背景部分
とを確実に区別できる。
That is, the pixel corresponding to each luminance of each occurrence frequency below this threshold is set to one of the two values, and the pixel corresponding to each luminance of each occurrence frequency exceeding this threshold is set to the other of the two values. By doing so, it is possible to reliably distinguish the detected image portion including the luminance having the low occurrence frequency and the background portion including the luminance having the high occurrence frequency.

【0023】[0023]

【発明の実施の形態】以下本発明の実施形態を図面を用
いて説明する。図1は実施形態に係わる画像2値化方法
を採用した画像2値化装置の概略構成を示すブロック図
である。図7に示す従来の画像2値化装置と同一部分に
は同一符号が付してある。したがって、重複する部分の
詳細説明は省略されている。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing the schematic arrangement of an image binarization apparatus that employs the image binarization method according to the embodiment. The same parts as those of the conventional image binarization apparatus shown in FIG. 7 are designated by the same reference numerals. Therefore, detailed description of the overlapping portions is omitted.

【0024】2次元の像1はカメラ2で読取られてデジ
タルの2次元画像に変換されて画像バッファ3に一旦書
込まれる。画像バッファ3に書込まれた2次元画像は次
の画像切出部4で検出像と背景とを含む所定面積(所定
画素数)の2次元画像に切出されて、図2(a)に示す
画像メモリ5へ書込まれる。画像メモリ5内に記憶され
ている2次元画像を構成する各画素は図2に示すように
座標(x,y)と輝度Iとで画素P(x,y,I)と表
記される。
The two-dimensional image 1 is read by the camera 2, converted into a digital two-dimensional image, and temporarily written in the image buffer 3. The two-dimensional image written in the image buffer 3 is cut out by the next image cutting-out unit 4 into a two-dimensional image having a predetermined area (predetermined number of pixels) including the detected image and the background, as shown in FIG. It is written in the image memory 5 shown. Each pixel forming the two-dimensional image stored in the image memory 5 is represented by a pixel P (x, y, I) with coordinates (x, y) and brightness I as shown in FIG.

【0025】頻度テーブル作成部6は、2次元画像を構
成する各画素P(x,y,I)における各輝度Iの発生
頻度Nを算出して、図2(b)に示す頻度テーブル12
を作成する。したがって、頻度テーブル12内には、各
輝度I(I=1,2,3.…,m)毎に画素数で示す発
生頻度N(N=N1 ,N2 ,N3 ,…,Nm )が設定さ
れる。
The frequency table creating unit 6 calculates the occurrence frequency N of each brightness I in each pixel P (x, y, I) forming the two-dimensional image, and the frequency table 12 shown in FIG. 2 (b).
Create Therefore, in the frequency table 12, the occurrence frequency N (N = N 1 , N 2 , N 3 , ..., N m ) indicated by the number of pixels for each luminance I (I = 1 , 2 , 3 , ..., M ). ) Is set.

【0026】頻度順並べ替部13は、頻度テーブル12
内の各発生頻度Nを発生頻度Nの小さい順に並べ替えて
図2(c)に示す頻度順テーブル14を作成する。した
がって、頻度順テーブル14内には、発生頻度の小さい
方から数えた場合の各発生頻度順位J(J=1,2,
3,…,m)毎に、該当頻度順位Jに相当する発生頻度
NJ1,NJ2,NJ3,…,NJmが設定される。
The frequency-order rearranging unit 13 includes a frequency table 12
The respective occurrence frequencies N are rearranged in the ascending order of the occurrence frequency N to create the frequency order table 14 shown in FIG. Therefore, in the frequency order table 14, each occurrence frequency rank J (J = 1, 2,
, ..., M), the occurrence frequencies N J1 , N J2 , N J3 , ..., N Jm corresponding to the corresponding frequency rank J are set.

【0027】閾値算出部15は、頻度順テーブル14内
に設定された各頻度順位J及び各頻度順位Jの発生頻度
NJ に基づいて発生頻度の閾値NHJを算出する。2値化
処理部16は閾値算出部15で算出された発生頻度Nの
閾値NHJを用いて画像メモリ5に記憶されている2次元
画像を2値化して、図4に示す2値化画像18を作成す
る。表示部17は2値化処理部16で作成された2値化
画像18を表示出力する。
The threshold value calculation unit 15 calculates the threshold value N HJ of the occurrence frequency based on each frequency rank J set in the frequency order table 14 and the occurrence frequency N J of each frequency rank J. The binarization processing unit 16 binarizes the two-dimensional image stored in the image memory 5 using the threshold value N HJ of the occurrence frequency N calculated by the threshold value calculation unit 15, and the binarized image shown in FIG. Create 18. The display unit 17 displays and outputs the binarized image 18 created by the binarization processing unit 16.

【0028】図3は上述した頻度テーブル作成部6,頻
度順並べ替部13、閾値算出部15、2値化処理部16
及び表示部17の具体的処理動作を示す流れ図である。
流れ図が開始され、Q1にて、画像メモリ5に記憶され
ている2次元画像の各画素P(x,y,I)における各
輝度Iの発生頻度Nを算出して頻度テーブル12を作成
する。次に、Q2にて頻度テーブル12の各発生頻度N
を発生頻度の少ない順に並べ替えて頻度順テーブル14
を作成する。
FIG. 3 shows the above-described frequency table creating unit 6, frequency order rearranging unit 13, threshold value calculating unit 15, and binarization processing unit 16.
9 is a flowchart showing a specific processing operation of the display unit 17.
The flow chart starts, and in Q1, the frequency N of occurrence of each brightness I in each pixel P (x, y, I) of the two-dimensional image stored in the image memory 5 is calculated to create the frequency table 12. Next, at Q2, each occurrence frequency N of the frequency table 12
Are sorted in ascending order of occurrence frequency and the frequency order table 14
Create

【0029】Q3にて発生頻度順位Jを1に初期化す
る。なお、この発生頻度順位Jは輝度の発生頻度Nが低
い順番である。すなわち、発生頻度順位Jの1は、最低
発生頻度NJ1を示す。さらに、Q3にて画素数で示され
る面積Sを0に初期化する。
At Q3, the occurrence frequency rank J is initialized to 1. It should be noted that the occurrence frequency rank J is an order in which the luminance occurrence frequency N is low. That is, 1 of the occurrence frequency rank J indicates the lowest occurrence frequency N J1 . Furthermore, the area S indicated by the number of pixels is initialized to 0 in Q3.

【0030】Q4にて、面積Sに発生頻度順位Jの輝度
の発生頻度NJ を加算する(S=S+NJ )。但し、各
画素P(x,y,I)の頻度は頻度1が1単位面積を有
しているとする。Q5にて加算後の面積Sが予め定めら
れた2次元画像面積の例えば20%に対応する面積SHJ
に達していないと、Q6にて発生頻度順位Jに1を加算
して、Q4へ戻る。
At Q4, the luminance occurrence frequency N J of the occurrence frequency rank J is added to the area S (S = S + N J ). However, it is assumed that the frequency of each pixel P (x, y, I) is frequency 1 having one unit area. The area S HJ corresponding to, for example, 20% of the predetermined two-dimensional image area S after addition in Q5
If it has not reached, the occurrence frequency rank J is incremented by 1 in Q6, and the process returns to Q4.

【0031】Q5にて、加算後の面積Sが予め定められ
た面積SHJに達すると、この時点における発生頻度順位
Jに対応する発生頻度NJ を2次元画像を2値化するた
めの閾値NHJとする(Q7)。そして、画像メモリ5に
記憶されている2次元画像の各画素P(x,y,I)を
この発生頻度の閾値NHJで2値化する(Q8)。すなわ
ち、各画素P(x,y,I)のうち、算出した閾値NHJ
以下の各発生頻度Nの各輝度Iを2値のうちの検出像を
示す[1],[H]又は[黒]レベルに設定し、この閾
値NHJを越える各発生頻度Nの各輝度Iを2値のうちの
背景を示す[0],[L]又は[白]レベルに設定す
る。
When the area S after addition reaches a predetermined area S HJ in Q5, a threshold value for binarizing the occurrence frequency N J corresponding to the occurrence frequency rank J at this point in time for binarizing the two-dimensional image. N HJ (Q7). Then, each pixel P (x, y, I) of the two-dimensional image stored in the image memory 5 is binarized by the threshold value NHHJ of the occurrence frequency (Q8). That is, the calculated threshold value N HJ of each pixel P (x, y, I)
The brightness I of each occurrence frequency N below is set to the [1], [H], or [black] level indicating the detected image of the binary values, and each brightness I of each occurrence frequency N exceeding this threshold value NHJ. Is set to the [0], [L], or [white] level indicating the background of the two values.

【0032】そして、このようにして発生頻度の閾値N
HJで各画素P(x,y,I)を2値化することによって
画像メモリ5に記憶され2次元画像から2値化画像18
を作成し(Q9)、作成した図4に示す2値化画像18
を表示部8に表示出力する。
In this way, the threshold value N for the occurrence frequency is set.
By binarizing each pixel P (x, y, I) with HJ , it is stored in the image memory 5 and the binarized image 18 is converted from the two-dimensional image.
(Q9), and the created binarized image 18 shown in FIG.
Is output to the display unit 8.

【0033】このように構成された画像2値化装置にお
いては、カメラ2で撮影された2次元画像10を構成す
る各画素P(x,y,I)における各輝度Iの発生頻度
Nが求められて、頻度テーブル12が作成される。そし
て、頻度テーブル12に設定された各輝度Iの発生頻度
Nは発生頻度の低い順に並べ替えられて頻度順テーブル
14に登録される。
In the image binarizing device thus constructed, the occurrence frequency N of each luminance I in each pixel P (x, y, I) forming the two-dimensional image 10 photographed by the camera 2 is obtained. Then, the frequency table 12 is created. Then, the occurrence frequency N of each luminance I set in the frequency table 12 is sorted in the ascending order of the occurrence frequency and registered in the frequency order table 14.

【0034】そして、頻度順テーブル14に登録された
発生頻度Nをこの発生頻度の低い順に順次加算してい
き、加算値Sが例えば検出対像面積と背景面積との比率
で定まる例えば20%に基づいて設定された所定値に達
した時点の発生頻度NJ を閾値NHJとしている。図5に
示す輝度発生頻度特性でも理解できるように、この閾値
NHJ以下の各発生頻度Nの各輝度Iを2値のうちの一方
(黒)とし、この閾値NHJを越える各発生頻度Nの各輝
度Iを2値のうちの他方(白)としている。
Then, the occurrence frequencies N registered in the frequency order table 14 are sequentially added in the ascending order of the occurrence frequencies, and the added value S becomes, for example, 20% determined by the ratio of the detected image area to the background area. The occurrence frequency N J at the time when the predetermined value set on the basis is reached is set as the threshold value N HJ . As can be understood from the brightness occurrence frequency characteristic shown in FIG. 5, each brightness I of each occurrence frequency N equal to or lower than the threshold value N HJ is set to one of two values (black), and each occurrence frequency N exceeding this threshold value N HJ. The respective brightnesses I of are set to the other (white) of the two values.

【0035】すなわち、2次元画像10(base)を単純に
輝度の値で2値化することなく、輝度の発生頻度Nで2
値化することによって、発生頻度Nの小さい輝度Iを含
む検出像部分と発生頻度Nの大きい輝度を含む背景部分
とを確実に区別できる。
That is, the two-dimensional image 10 (base) is not binarized by the luminance value, but the luminance frequency N is 2
By digitizing, the detected image portion including the luminance I with the low occurrence frequency N and the background portion including the luminance with the high occurrence frequency N can be reliably distinguished.

【0036】例えば、紙に描かれた2次元の像1に光が
照射される部分と影の部分とが存在する図10(c)に
示した2次元画像10の輝度発生頻度特性においては、
前述した図11(c)に示すように、c1 〜c4 の4つ
の輝度頻度が存在する。
For example, in the luminance occurrence frequency characteristic of the two-dimensional image 10 shown in FIG. 10C, in which the two-dimensional image 1 drawn on paper has a portion irradiated with light and a shaded portion,
As shown in FIG. 11C, there are four luminance frequencies c 1 to c 4 .

【0037】そして、実施形態においては、輝度発生頻
度Nの閾値NHJがc1 ,c3 とc2.c4 との間に存在
するので、検出像10aに対応する発生頻度が閾値NHJ
以下の各輝度4.8を有する各画素P(x,y,I)は
共に[黒]レベルとなり、背景に対応する発生頻度が閾
値NHJを越える各輝度1,5を有する各画素P(x,
y,I)は共に[白]レベルとなる。よって、図4に示
す正しい2値化画像18が得られる。
In the embodiment, the threshold value N HJ of the luminance occurrence frequency N is c 1 , c 3 and c 2 . Since it exists between c 4 and c 4 , the occurrence frequency corresponding to the detected image 10a is the threshold value N HJ
Each pixel P (x, y, I) having the following luminance 4.8 is at the [black] level, and each pixel P (having luminance 1, 5 whose occurrence frequency corresponding to the background exceeds the threshold value N HJ x,
Both y and I) are at the [white] level. Therefore, the correct binary image 18 shown in FIG. 4 is obtained.

【0038】なお、図10(a)に示した2次元の像1
に光が照射されていなくて、全体に暗い場合において
も、背景部分の輝度頻度a1 と検出像部分の輝度頻度a
2 との間には大きな差が存在するので、両者の間に閾値
NHJが位置し、検出像と背景とは明確に区別できる。
The two-dimensional image 1 shown in FIG.
Even when no light is radiated on the background and the whole is dark, the luminance frequency a 1 of the background portion and the luminance frequency a of the detected image portion a
Since there is a large difference between 2 and 2 , the threshold value N HJ is located between them, and the detected image and the background can be clearly distinguished.

【0039】同様に、図10(b)に示した2次元の像
1に光が照射されていて、全体に明るい場合において
も、背景部分の輝度頻度b1 と検出像部分の輝度頻度b
2 との間には大きな差が存在するので、両者の間に閾値
NHJが位置し、検出像と背景とは明確に区別できる。
Similarly, when the two-dimensional image 1 shown in FIG. 10 (b) is illuminated with light and the whole is bright, the luminance frequency b 1 of the background portion and the luminance frequency b of the detected image portion b
Since there is a large difference between 2 and 2 , the threshold value N HJ is located between them, and the detected image and the background can be clearly distinguished.

【0040】すなわち、図10(a)(b)(c)のい
ずれの光の照射状況であつたとして、2次元画像10は
正しく2値化される。また、図13(a)に示すよう
に、輝度Iの範囲が0〜99であり、検出像の各画素P
の輝度が0〜9の狭い範囲で変化している2次元画像1
0であっても、実施形態における発生頻度Nの閾値HJで
2値化すると、輝度1,2,3.4を有する画素Pは発
生頻度が少ないので、2値化した場合に、他の検出像の
部分の各輝度5,6,7,8,9と同一側の[99]に
分類される。よって、図6に示すよように、正しい2値
化画像18が得られる。
That is, the two-dimensional image 10 is correctly binarized under any of the light irradiation conditions of FIGS. 10A, 10B, and 10C. Further, as shown in FIG. 13A, the range of the brightness I is 0 to 99, and each pixel P of the detected image is
-Dimensional image 1 whose brightness changes in a narrow range of 0-9
Even if it is 0, if the threshold value HJ of the occurrence frequency N in the embodiment is binarized, the pixel P having the luminance 1, 2, 3.4 has a low occurrence frequency. It is classified into [99] on the same side as the luminances 5, 6, 7, 8, and 9 of the image portion. Therefore, as shown in FIG. 6, a correct binarized image 18 is obtained.

【0041】[0041]

【発明の効果】以上説明したように本発明の画像2値化
方法及び画像2値化装置においては、2次元画像を構成
する各画素における各輝度の発生頻度を求めて、この発
生頻度を小さい順に加算して、加算値が所定値に達した
時点の発生頻度を閾値として2次元画像を2値化してい
る。
As described above, in the image binarization method and the image binarization apparatus of the present invention, the occurrence frequency of each luminance in each pixel forming a two-dimensional image is obtained, and this occurrence frequency is reduced. The two-dimensional images are binarized by sequentially adding and using the occurrence frequency when the added value reaches a predetermined value as a threshold.

【0042】したがって、たとえ2次元の像に均一に光
が照射されていなかったとしても、また、たとえ検出像
の輝度に細かい変動があったとしても、検出像を背景に
対して正しく区別できる正しい2値化画像を得ることが
できる。
Therefore, even if the two-dimensional image is not uniformly illuminated with light, and even if there is a slight variation in the brightness of the detected image, the detected image can be correctly distinguished from the background. A binary image can be obtained.

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

【図1】 本発明の画像2値化方法が適用された画像2
値化装置の概略構成を示すブロック図
FIG. 1 is an image 2 to which an image binarization method of the present invention has been applied.
Block diagram showing the schematic configuration of the quantizer

【図2】 同画像2値化装置に組込まれた画像メモリ、
頻度テーブル及び頻度順テーブルの各記憶内容を示す図
FIG. 2 is an image memory incorporated in the image binarization apparatus,
The figure which shows each storage content of a frequency table and a frequency order table

【図3】 同画像2値化装置の2値化動作を示す流れ図FIG. 3 is a flowchart showing a binarizing operation of the image binarizing apparatus.

【図4】 同画像2値化装置で得られた2値化画像を示
す図
FIG. 4 is a diagram showing a binarized image obtained by the image binarization apparatus.

【図5】 同画像2値化装置の動作を説明するための輝
度頻度特性図
FIG. 5 is a luminance frequency characteristic diagram for explaining the operation of the image binarization apparatus.

【図6】 同画像2値化装置で得られた2値化画像を示
す図
FIG. 6 is a diagram showing a binarized image obtained by the image binarization apparatus.

【図7】 従来の画像2値化方法が適用された画像2値
化装置の概略構成を示すブロック図
FIG. 7 is a block diagram showing a schematic configuration of an image binarization apparatus to which a conventional image binarization method is applied.

【図8】 同従来の画像2値化装置の動作を説明するた
めの輝度頻度特性図
FIG. 8 is a luminance frequency characteristic diagram for explaining the operation of the conventional image binarization apparatus.

【図9】 同従来の画像2値化装置の2値化動作を示す
流れ図
FIG. 9 is a flowchart showing a binarizing operation of the conventional image binarizing apparatus.

【図10】 2値化対像の光照射条件がそれぞれ異なる
複数の2次元画像を示す図
FIG. 10 is a diagram showing a plurality of two-dimensional images with different light irradiation conditions for the binarized image.

【図11】 図10の各2次元画像に対応する各輝度頻
度特性図
FIG. 11 is a luminance frequency characteristic diagram corresponding to each two-dimensional image in FIG.

【図12】 同従来の画像2値化装置で得られた2値化
画像を示す図
FIG. 12 is a diagram showing a binarized image obtained by the conventional image binarization apparatus.

【図13】 同従来の画像2値化装置の問題点を説明す
るための2次元画像及び2値化画像を示す図
FIG. 13 is a diagram showing a two-dimensional image and a binarized image for explaining problems of the conventional image binarization apparatus.

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

1…像 2…カメラ 3…画像バッフア 4…画像切出部 5…画像メモリ 6…頻度テーブル作成部 10…2次元画像 11,18…2値化画像 12…頻度テーブル 13…頻度順並べ替部 14…頻度順テーブル 15…閾値算出部 16…2値化処理部 17…表示部 DESCRIPTION OF SYMBOLS 1 ... Image 2 ... Camera 3 ... Image buffer 4 ... Image cut-out part 5 ... Image memory 6 ... Frequency table creation part 10 ... Two-dimensional image 11, 18 ... Binary image 12 ... Frequency table 13 ... Frequency order rearranging part 14 ... Frequency order table 15 ... Threshold value calculation unit 16 ... Binarization processing unit 17 ... Display unit

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 検出像面積が背景面積に比較して所定割
合以下である2次元画像を構成する各画素における各輝
度の発生頻度を求め、 この求めた各輝度の発生頻度を発生頻度の小さい順に加
算していき、加算値が所定値に達したときの発生頻度を
閾値とし、 この閾値で前記2次元画像を2値化する画像2値化方
法。
1. The frequency of occurrence of each luminance in each pixel forming a two-dimensional image in which the detected image area is less than a predetermined ratio compared to the background area is determined, and the frequency of occurrence of each luminance thus determined is low in frequency of occurrence. An image binarization method in which the two-dimensional images are binarized by using the threshold as the occurrence frequency when the addition value reaches a predetermined value by sequentially performing addition.
【請求項2】 検出像面積が背景面積に比較して所定割
合以下である2次元画像を構成する各画素における各輝
度の発生頻度を求める発生頻度算出手段(6)と、 この発生頻度算出手段で求められた各輝度の発生頻度を
発生頻度の小さい順に加算していき、加算値が所定値に
達したときの発生頻度を閾値とする閾値算出手段(15)
と、 この閾値算出手段で求めた閾値で前記2次元画像を2値
化する2値化手段(16)とを備えた画像2値化装置。
2. An occurrence frequency calculation means (6) for obtaining an occurrence frequency of each luminance in each pixel forming a two-dimensional image in which a detected image area is smaller than a predetermined ratio in comparison with a background area, and the occurrence frequency calculation means. Threshold value calculation means (15) that adds the occurrence frequency of each luminance obtained in step 1 in ascending order of occurrence frequency, and sets the occurrence frequency when the added value reaches a predetermined value as a threshold value (15)
An image binarization device comprising: and a binarization unit (16) for binarizing the two-dimensional image with the threshold value obtained by the threshold value calculation unit.
JP8127168A 1996-05-22 1996-05-22 Image binarization method and device therefor Pending JPH09311936A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8127168A JPH09311936A (en) 1996-05-22 1996-05-22 Image binarization method and device therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8127168A JPH09311936A (en) 1996-05-22 1996-05-22 Image binarization method and device therefor

Publications (1)

Publication Number Publication Date
JPH09311936A true JPH09311936A (en) 1997-12-02

Family

ID=14953348

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8127168A Pending JPH09311936A (en) 1996-05-22 1996-05-22 Image binarization method and device therefor

Country Status (1)

Country Link
JP (1) JPH09311936A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009193130A (en) * 2008-02-12 2009-08-27 Honda Motor Co Ltd Vehicle periphery monitoring device, vehicle, vehicle periphery monitoring program, and vehicle periphery monitoring method
CN117581100A (en) * 2021-07-29 2024-02-20 株式会社岛津制作所 Image processing method and image processing device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009193130A (en) * 2008-02-12 2009-08-27 Honda Motor Co Ltd Vehicle periphery monitoring device, vehicle, vehicle periphery monitoring program, and vehicle periphery monitoring method
CN117581100A (en) * 2021-07-29 2024-02-20 株式会社岛津制作所 Image processing method and image processing device

Similar Documents

Publication Publication Date Title
CN111144305B (en) Training data generation method and device, electronic equipment and medium
JP2002133426A (en) Ruled line extraction device for extracting ruled lines from multi-valued images
CN115294483A (en) Small target identification method and system for complex scene of power transmission line
US5687252A (en) Image processing apparatus
JP2710527B2 (en) Inspection equipment for periodic patterns
JPH06109446A (en) Wiring pattern inspection device
JP3415700B2 (en) Closed area extraction device
CN116109891B (en) Image data amplification method, device, computing equipment and storage medium
JPH0624014B2 (en) Gray image processing method
JP2775404B2 (en) Automatic target identification device
CN117351495B (en) Text image correction method, device, chip and terminal
JP2581049B2 (en) Image area determination device
KR100695159B1 (en) Algibi map generation device and method for skin color model and skin color detection device and method using same
JPH0877355A (en) Weighted pattern matching method
JP2529505B2 (en) Wiring pattern inspection device
JP3358133B2 (en) Image processing device
JP3756660B2 (en) Image recognition method, apparatus and recording medium
JP2025178858A (en) Vehicle type identification device, vehicle type identification model generation device, and vehicle type identification model generation method
JP2001143076A (en) Image processor
JPH02108167A (en) optical inspection equipment
CN121999509A (en) Identification card number identification method and device, terminal equipment and storage medium
JP2024127101A (en) Vehicle type identification device, vehicle type identification model generating device, and vehicle type identification model generating method
JPH06227098A (en) Dot pattern inspection device
CN114943972A (en) Method and system for generating real scene deformation digital picture
JPS62251879A (en) Image contour extracting system