JPH0721392A - Method for extracting contour line of input picture - Google Patents
Method for extracting contour line of input pictureInfo
- Publication number
- JPH0721392A JPH0721392A JP5145063A JP14506393A JPH0721392A JP H0721392 A JPH0721392 A JP H0721392A JP 5145063 A JP5145063 A JP 5145063A JP 14506393 A JP14506393 A JP 14506393A JP H0721392 A JPH0721392 A JP H0721392A
- Authority
- JP
- Japan
- Prior art keywords
- pixel
- contour line
- image
- interest
- processing
- 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
Links
- 238000000034 method Methods 0.000 title claims description 36
- 239000000470 constituent Substances 0.000 claims description 23
- 238000000605 extraction Methods 0.000 claims description 6
- 238000012545 processing Methods 0.000 abstract description 60
- 239000000284 extract Substances 0.000 abstract description 5
- 238000007796 conventional method Methods 0.000 description 8
- 238000007781 pre-processing Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 230000005484 gravity Effects 0.000 description 4
- 238000009499 grossing Methods 0.000 description 3
- 230000004069 differentiation Effects 0.000 description 2
- 230000000873 masking effect Effects 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- 235000010724 Wisteria floribunda Nutrition 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000003111 delayed effect Effects 0.000 description 1
- 238000012805 post-processing Methods 0.000 description 1
Landscapes
- Image Analysis (AREA)
Abstract
Description
【0001】[0001]
【産業上の利用分野】本発明は、画像処理分野における
入力画像の輪郭線抽出方法に関し、特に多値入力画像の
多値情報を用いて輪郭線を抽出する入力画像の輪郭線抽
出方法に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for extracting a contour line of an input image in the field of image processing, and more particularly to a method for extracting a contour line of an input image which extracts contour lines using multivalued information of a multivalued input image.
【0002】[0002]
【従来の技術】一般に、ビデオカメラ等から入力された
濃淡画像は、画素毎に多値情報を持つディジタル画像で
あるため、かかる濃淡画像を記憶するためには大きなメ
モリ容量が必要となる。2. Description of the Related Art Generally, a grayscale image input from a video camera or the like is a digital image having multivalued information for each pixel, and therefore a large memory capacity is required to store the grayscale image.
【0003】このため、かかる濃淡画像をそのまま記憶
するのではなく、多値情報を2値情報に置き換える2値
化処理を行い、情報量を低減した画像を記憶することが
多い。この際、濃淡画像を2値化しただけでは、ユーザ
等が画像を認識しずらいため、画像の特徴抽出を併せて
行うことになる。Therefore, in many cases, such a grayscale image is not stored as it is, but binarization processing for replacing multivalued information with binary information is performed to store an image with a reduced amount of information. At this time, it is difficult for the user or the like to recognize the image only by binarizing the grayscale image, and therefore the feature extraction of the image is also performed.
【0004】例えば、文書処理装置に画像を取り込む際
には、撮像した濃淡画像から輪郭線を2値画像として抽
出した後、この2値画像を方向データ(セグメントデー
タ)に置き換えるベクトル化処理を行うことが多いた
め、ベクトル化処理の前提となる高品質な輪郭線をいか
に抽出するかが重要な課題となる。For example, when an image is taken into a document processing apparatus, a contour line is extracted as a binary image from a captured grayscale image, and then vectorization processing is performed to replace the binary image with direction data (segment data). Since it is often the case, how to extract a high-quality contour line which is a prerequisite for vectorization processing is an important issue.
【0005】この輪郭線抽出を行う従来技術には、濃淡
画像のノイズを除去する平滑化処理と、濃淡画像の輪郭
部分を強調して出力する微分処理とを前処理として行っ
た後、この微分処理後の画像(以下「微分画像」とい
う)に対して、細線化に先立ち2値化を行う方式と、細
線化後に2値化を行う方式とがある。In the conventional technique for extracting the contour line, smoothing processing for removing noise in the grayscale image and differentiation processing for emphasizing and outputting the contour portion of the grayscale image are performed as preprocessing, and then the differentiation is performed. The processed image (hereinafter referred to as “differential image”) may be binarized prior to thinning or may be binarized after thinning.
【0006】まず、細線化に先立ち2値化を行う方式と
は、多値画像を以後の処理が容易な2値画像に置換した
後、この2値画像に細線化処理を行うものであり、最も
一般的に用いられている方式である。なお、この細線化
処理の代表的なものとしては、線幅の重心に位置する画
素を輪郭線の構成画素とみなし、それ以外の画素につい
ては逐次消去を繰り返す方式がある。First, the method of performing binarization prior to thinning is to replace a multivalued image with a binary image that can be easily processed thereafter, and then perform thinning processing on this binary image. This is the most commonly used method. As a typical example of this thinning processing, there is a method in which the pixels located at the center of gravity of the line width are regarded as the constituent pixels of the contour line and the other pixels are successively erased.
【0007】これに対して、細線化後に2値化を行う方
式とは、微分画像が持つ濃淡値の稜線部分が輪郭線に対
応する点に着目し、濃淡値が極大となる画素を輪郭線の
構成画素とみなし、2値データとして記憶する方式であ
る。On the other hand, in the method of performing binarization after thinning, attention is paid to the point that the edge portion of the gray value of the differential image corresponds to the contour line, and the pixel having the maximum gray value is the contour line. In this method, the pixels are regarded as the constituent pixels and stored as binary data.
【0008】[0008]
【発明が解決しようとする課題】しかしながら、前者の
方式は、細線化処理を行う前に微分画像を2値画像に置
き換えるために、原画像に忠実な輪郭線を抽出すること
が難しいという問題がある。However, the former method has a problem that it is difficult to extract a contour line faithful to the original image because the differential image is replaced with the binary image before performing the thinning process. is there.
【0009】例えば、線幅の重心に位置する画素を輪郭
線の構成画素とみなす場合には、図6に示すように、輪
郭線として抽出した画素の位置が、本来の輪郭画素の位
置とずれることが多くなる。For example, when the pixels located at the center of gravity of the line width are regarded as the constituent pixels of the contour line, the position of the pixel extracted as the contour line is displaced from the original position of the contour pixel, as shown in FIG. More often.
【0010】すなわち、本来の輪郭線の構成画素は、濃
淡値の稜線部(ピーク)に相当する画素Xpとみなすこ
とができるため、線幅の重心に位置する画素Xwとは必
ずしも一致しないのである。このため、たとえ画素Xw
を抽出したとしても、線幅の濃度分布が均等でない場合
には、両者の間にずれが生じる結果となる。したがっ
て、この方式では、原画像に忠実な輪郭線を抽出するこ
とを保証できないのである。That is, since the original constituent pixels of the contour line can be regarded as the pixels Xp corresponding to the ridge line portion (peak) of the gray value, they do not necessarily coincide with the pixel Xw located at the center of gravity of the line width. . Therefore, even if the pixel Xw
Even if is extracted, if the density distribution of the line width is not uniform, a deviation occurs between the two. Therefore, this method cannot guarantee that the contour line faithful to the original image is extracted.
【0011】また、輪郭線の構成画素の濃淡値は、他の
画素の濃淡値よりも必ずしも大きくないため、2値化処
理を行う際に最適にしきい値を選定したとしても、本来
の輪郭線情報を失なってしまうことが多い。Further, since the grayscale values of the constituent pixels of the contour line are not necessarily larger than the grayscale values of the other pixels, even if the threshold value is optimally selected during the binarization processing, the original contour line is selected. Often loses information.
【0012】この問題を回避するため、特開昭62−2
19188号公報に開示された「細線化処理の過程で判
定器が画素中で孤立した孔となる画素を発見し、変換出
力回路の出力によって画素を補完する2値画像の細線化
処理装置」等の輪郭線を補完する技術もあるが、処理時
間が遅延するとともに、判定用画像メモリが必要となる
ため効率的ではない。In order to avoid this problem, Japanese Patent Laid-Open No. 62-2
Japanese Patent Laid-Open No. 19188 discloses "a binary image thinning processing device in which a determiner finds an isolated hole in a pixel in the process of thinning processing and complements the pixel by the output of a conversion output circuit". Although there is a technique for complementing the contour line of (1), it is not efficient because the processing time is delayed and a judgment image memory is required.
【0013】これに対して、後者の多値画像自体を細線
化する方式においては、多値の微分画像から濃淡値が極
大である画素を抽出するため、濃淡値の高い本来の輪郭
線に相当する画素を抽出することができる。On the other hand, in the latter method of thinning the multi-valued image itself, since the pixel having the maximum gray value is extracted from the multi-valued differential image, it corresponds to the original contour line having a high gray value. The pixels to be extracted can be extracted.
【0014】しかし、各画素の濃淡値にのみ着目するた
め、極大点でありさえすれば輪郭線の構成画素でなくと
も抽出されることになり、ノイズの多い画像を出力して
しまうという問題がある。However, since attention is paid only to the gray value of each pixel, even if it is a maximum point, it is extracted even if it is not a constituent pixel of the contour line, and there is a problem that a noisy image is output. is there.
【0015】この問題を解決するため、特開昭64−6
4080号公報に開示される「輪郭画像を2値化した画
像と、輪郭画像に極大点抽出処理を行った画像との論理
積を用いる入力画像の輪郭線抽出方法及び装置」では、
後者の方式によるノイズの多い画像と、微分画像を2値
化した画像との論理演算を行うことにより、ノイズ成分
を除去して輪郭線を抽出している。In order to solve this problem, JP-A-64-6
In the "Method and apparatus for extracting a contour line of an input image using a logical product of an image obtained by binarizing a contour image and an image obtained by performing maximum point extraction processing on the contour image" disclosed in Japanese Patent No. 4080,
By the logical operation of the image with a lot of noise by the latter method and the image obtained by binarizing the differential image, the noise component is removed and the contour line is extracted.
【0016】しかし、かかる処理では、極大点抽出処理
を行った画像と微分画像の2値化処理を行った画像の各
々に対してマスク処理を施す必要があるため、効率的と
は言えない。However, such processing cannot be said to be efficient because it is necessary to perform mask processing on each of the image subjected to the maximum point extraction processing and the image subjected to the binarization processing of the differential image.
【0017】そこで、本発明は、かかる問題点を除去
し、入力画像に忠実でかつ品質の良い輪郭線を、迅速か
つ効率的に抽出することを目的とする。Therefore, an object of the present invention is to eliminate such a problem and to quickly and efficiently extract a contour line that is faithful to the input image and has good quality.
【0018】[0018]
【課題を解決するための手段】上記目的を達成するた
め、本発明では、多値入力画像の多値情報を用いて輪郭
線を抽出する輪郭線抽出方法において、注目画素に隣接
する上下、左右、右上左下、左上右下方向の8つの画素
を抽出し、該4つの方向のうち少なくとも2つの方向に
位置する各画素の濃淡値が、当該注目画素の濃淡値より
も小さい場合は、当該注目画素を輪郭線の構成画素とし
て選択することを特徴とする。In order to achieve the above object, the present invention provides a contour line extraction method for extracting a contour line by using multivalued information of a multivalued input image. , Lower left upper right, lower left upper right, eight pixels are extracted, and if the grayscale value of each pixel located in at least two of the four directions is smaller than the grayscale value of the pixel of interest, It is characterized in that a pixel is selected as a constituent pixel of the contour line.
【0019】[0019]
【作用】本発明は、多値入力画像の多値情報を用いて輪
郭線を抽出する際に、注目画素に隣接する8画素を、上
下、左右、左上右下、右上左下方向の4つの組み合わせ
として抽出し、この4つの組み合わせのうち該注目画素
より共に濃淡値が小さい組み合わせが2つ以上ある場合
には、該注目画素を輪郭線の構成画素として選択するこ
とにより、入力画像に忠実でかつ品質の良い輪郭線を、
迅速かつ効率的に抽出することができる。According to the present invention, when a contour line is extracted using multi-valued information of a multi-valued input image, eight pixels adjacent to a target pixel are combined in four directions of up, down, left and right, upper left lower right, upper right lower left. If there are two or more combinations of the four combinations whose gray values are smaller than the target pixel, the target pixel is selected as a constituent pixel of the contour line and Good quality contour lines
It can be extracted quickly and efficiently.
【0020】[0020]
【実施例】以下、本発明に係わる入力画像の輪郭線抽出
方法の一実施例について図面を参照して説明する。DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of a method for extracting a contour line of an input image according to the present invention will be described below with reference to the drawings.
【0021】図1は、本発明の全体構成を示すブロック
図である。FIG. 1 is a block diagram showing the overall structure of the present invention.
【0022】本発明は、原画像10を入力する入力処理
部11と、入力画像に対して前処理を行う前処理部12
と、前処理を施した画像から輪郭線を2値データとして
抽出し画像メモリ15に出力する細線2値化処理部13
とから構成される。According to the present invention, an input processing section 11 for inputting an original image 10 and a preprocessing section 12 for preprocessing the input image.
And a thin line binarization processing unit 13 that extracts a contour line from the preprocessed image as binary data and outputs it to the image memory 15.
Composed of and.
【0023】ここで、入力処理部11は、CCDカメラ
等を用いて撮像した原画像10を、多値情報を持つディ
ジタル画像として入力するものである。Here, the input processing section 11 inputs the original image 10 picked up by a CCD camera or the like as a digital image having multi-valued information.
【0024】また、前処理部12は、このディジタル画
像に対して、ノイズを除去する平滑化処理と、エッジを
抽出する微分処理とを行うものである。このため、この
前処理部12からの出力は、入力画像からノイズを除去
し、エッジを抽出した多値の濃淡値を持つ微分画像とな
る。Further, the preprocessing section 12 performs a smoothing process for removing noise and a differentiating process for extracting edges on the digital image. Therefore, the output from the pre-processing unit 12 is a differential image having multi-valued gray values in which noise is removed from the input image and edges are extracted.
【0025】なお、本実施例では、平滑化処理には、高
速フーリエ変換(Fast Fourier transform;FFT)を
用いた手法を、微分処理には、"R.O.Duda and P.E.Har
t,Pattern Classification and Scene Analysis,Wiley,
1971,pp.267-272"に記載された3×3の代表的微分オペ
レータ(SOBELオペレータ)を用いている。In the present embodiment, the smoothing process uses a fast Fourier transform (FFT) method, and the differential process uses "RODuda and PEHar".
t, Pattern Classification and Scene Analysis, Wiley,
A typical 3 × 3 differential operator (SOBEL operator) described in 1971, pp.267-272 ”is used.
【0026】次に、細線2値化処理部13は、微分画像
のうち輪郭線の構成画素である可能性が高い画素(候補
画素)を候補画素選択部13aにおいて選択し、各選択
画素に対して細線化部13bがマスクパターン14を用
いた細線化を行い、2値化出力部により輪郭線を2値デ
ータとして画像メモリ15に出力する(13c)処理を
行う。なお、本実施例では、注目画素と中心とした3×
3のマスク処理手法を用いているため、3×3のマスク
パターンを細線化部13bにおいて準備する。Next, the thin line binarization processing unit 13 selects, in the candidate pixel selection unit 13a, the pixels (candidate pixels) that are likely to be the constituent pixels of the contour line in the differential image, and for each selected pixel. Then, the thinning unit 13b performs thinning using the mask pattern 14, and the binarization output unit outputs the contour line to the image memory 15 as binary data (13c). It should be noted that in the present embodiment, 3 × centered on the pixel of interest.
Since the mask processing method of 3 is used, a 3 × 3 mask pattern is prepared in the thinning unit 13b.
【0027】候補画素選択部13aは、処理の高速化を
図るとともにノイズ成分を除去するために、明らかに輪
郭線を構成する可能性がない画素は予め排除し、輪郭線
の構成画素である可能性が高い画素にのみ細線化を行い
得るように、輪郭線の候補画素を絞る処理を行ってい
る。In order to speed up the process and remove noise components, the candidate pixel selection unit 13a excludes pixels that have no apparent possibility of forming a contour line in advance, and may be a constituent pixel of the contour line. A process of narrowing down the candidate pixels of the contour line is performed so that the thinning can be performed only on the pixels having high property.
【0028】細線化部13bは、候補画素に対してマス
クパターン14を適用し、注目画素(候補画素)と隣接
画素との濃淡値の比較を行い、注目画素を輪郭線の構成
画素として選択できる条件を各隣接画素が有するか否か
を調べるものである。The thinning unit 13b applies the mask pattern 14 to the candidate pixel, compares the gray value of the target pixel (candidate pixel) with the adjacent pixel, and selects the target pixel as a constituent pixel of the contour line. It is to check whether or not each adjacent pixel has a condition.
【0029】2値化出力部13cは、細線化部13bの
結果に基づき、輪郭線の構成画素として選択した場合に
は’1’を、輪郭線の構成画素として選択しない場合に
は’0’を、注目画素に対応する画像メモリ15の座標
位置に出力するものである。Based on the result of the thinning section 13b, the binarization output section 13c selects "1" when it is selected as a constituent pixel of the contour line, and "0" when it is not selected as a constituent pixel of the contour line. Is output to the coordinate position of the image memory 15 corresponding to the pixel of interest.
【0030】すなわち、本発明は、従来法と同様に入力
処理部11を経て入力した濃淡画像から、前処理部12
を用いて微分画像を算出した後、従来法による「重心を
用いた細線化処理」及び「極大点を用いた細線化処理」
等に代えて、細線2値化処理部13を用いた輪郭線抽出
処理を行う構成を用いている。That is, according to the present invention, similarly to the conventional method, from the grayscale image input through the input processing unit 11, the preprocessing unit 12 is executed.
After calculating the differential image using, the conventional method "thinning process using the center of gravity" and "thinning process using the maximum point"
Instead of the above, a configuration for performing contour line extraction processing using the thin line binarization processing unit 13 is used.
【0031】次に、細線2値化処理部13の処理手順に
ついて、図2のフローチャートを用いて説明する。Next, the processing procedure of the thin line binarization processing unit 13 will be described with reference to the flowchart of FIG.
【0032】まず、この細線2値化処理部13では、処
理を簡素化するために、微分画像を構成する全ての画素
に対してマスク処理を繰り返す処理方式を採用する。First, in the thin line binarization processing unit 13, in order to simplify the processing, a processing method in which the mask processing is repeated for all the pixels forming the differential image is adopted.
【0033】このため、図2に示すように、注目画素
が、あるしきい値以上の濃淡値を有する画素か否かを判
定し(S201)、当該しきい値以上であればマスク処
理(S202)に移行するとともに、しきい値未満であ
れば当該画素を輪郭線の構成画素として選択することな
く画像メモリ15の該当画素に’0’を格納する(S2
05)処理を行う。Therefore, as shown in FIG. 2, it is determined whether or not the pixel of interest is a pixel having a gray value of a certain threshold value or more (S201), and if it is the threshold value or more, a mask process (S202). ), And if it is less than the threshold value, '0' is stored in the corresponding pixel of the image memory 15 without selecting the pixel as a constituent pixel of the contour line (S2).
05) Perform processing.
【0034】ここで、S201で用いるしきい値は、微
分画像におけるエッジ成分の欠落を防ぐため、通常の2
値化時に用いるしきい値よりも低く設定する。Here, the threshold value used in S201 is 2 in order to prevent the loss of edge components in the differential image.
Set it lower than the threshold value used for digitization.
【0035】その後、後述するマスク処理(S202)
を行い、所定の判定条件を満たすか否か(S203)を
確認する。Thereafter, a mask process (S202) described later is performed.
Then, it is confirmed whether or not a predetermined judgment condition is satisfied (S203).
【0036】その結果、所定の条件を満足する場合に
は、輪郭線の構成画素として選択して画像メモリ15の
該当画素に’1’を格納(S204)し、所定の条件を
満足しない場合には、画像メモリ15の該当画素に’
0’を格納する(S205)。As a result, when the predetermined condition is satisfied, "1" is stored in the corresponding pixel of the image memory 15 by selecting it as a constituent pixel of the contour line (S204), and when the predetermined condition is not satisfied, Is displayed in the corresponding pixel of the image memory 15.
0'is stored (S205).
【0037】以上のS201〜S205の処理を、微分
画像の各画素に対して繰り返し(S206)、全ての画
素を処理した時点で処理を終了する。The above steps S201 to S205 are repeated for each pixel of the differential image (S206), and the processing ends when all the pixels have been processed.
【0038】なお、候補画素選択部13aではS201
の処理を、細線化部13bではS202〜S203の処
理を、2値化出力部13cではS204又はS205の
処理を行うことになる。In the candidate pixel selection unit 13a, S201
The thinning unit 13b performs the processing of S202 to S203, and the binarization output unit 13c performs the processing of S204 or S205.
【0039】また、本実施例では、候補画素選択部13
aが行うS201の判定は、画素毎に逐次行うこととし
たが、予め微分画像自体を2値化する処理に置換するこ
ともできる。Further, in the present embodiment, the candidate pixel selection unit 13
Although the determination of S201 performed by a is performed sequentially for each pixel, it may be replaced with a process of binarizing the differential image itself in advance.
【0040】次に、本発明の主軸をなす細線化部13b
の動作の概念と、細線化部13bが行うマスク処理(S
202)及び条件判定(S203)とを、図3〜図4を
用いて詳細に説明する。Next, the thinning portion 13b forming the main axis of the present invention.
And the masking process performed by the thinning unit 13b (S
202) and condition determination (S203) will be described in detail with reference to FIGS.
【0041】図3(a)に示すように、本発明では注目画
素X0を中心とした3×3の小領域を処理の単位と考
え、注目画素の8近傍に位置する隣接画素X1〜X8を、
注目画素X0を中心とする4方向の組み合わせ(X2とX
7、X4とX5、X1とX8、X3とX6)として捉えてい
る。As shown in FIG. 3A, in the present invention, a small region of 3 × 3 centered on the target pixel X0 is considered as a processing unit, and adjacent pixels X1 to X8 located in the vicinity of 8 of the target pixel are considered. ,
A combination of four directions centering on the pixel of interest X0 (X2 and X
7, X4 and X5, X1 and X8, X3 and X6).
【0042】すなわち、微分画像のある画素に注目した
場合に、注目画素X0が輪郭線を構成する横方向の直線
(X4−X0−X5)の構成画素であるならば(図3
(b))、当該注目画素X0と注目画素の隣接画素のうち輪
郭線に対応する2画素(X4とX5)の濃淡値が、他の隣
接画素(X1〜X3、X6〜X8)の濃淡値よりも高くな
る。That is, when attention is paid to a pixel in the differential image, if the pixel of interest X0 is a constituent pixel of a horizontal straight line (X4-X0-X5) forming a contour line (FIG. 3).
(b)), among the adjacent pixels of the target pixel X0 and the target pixel, the grayscale values of the two pixels (X4 and X5) corresponding to the contour are the grayscale values of the other adjacent pixels (X1 to X3, X6 to X8). Will be higher than.
【0043】また、ある注目画素X0において、輪郭線
を構成する2つの直線(X2−X0−X7及びX4−X0−
X5)が交差する場合(図3(c))にも、当該注目画素X
0と2つの直線に対応する4つの隣接画素(X2、X7、
X4、X5)の濃淡値が、他の隣接画素(X1、X3、X
6、X8)の濃淡値よりも高くなる。Further, at a certain target pixel X0, two straight lines (X2-X0-X7 and X4-X0- that form the contour line are formed.
X5) also intersects (FIG. 3 (c)), the target pixel X
0 and four adjacent pixels (X2, X7,
The gray value of X4, X5 is the same as that of other adjacent pixels (X1, X3, X).
6 and X8) is higher than the gray value.
【0044】このように、3×3の小領域では、輪郭線
を4方向の直線の組み合わせとみなすことができるた
め、本発明では、隣接8画素を4つの組み合わせ(X2
とX7、X4とX5、X1とX8、X3とX6)として捉えた
のである。As described above, in the small area of 3 × 3, the contour line can be regarded as a combination of straight lines in four directions. Therefore, according to the present invention, eight adjacent pixels are combined into four combinations (X2).
And X7, X4 and X5, X1 and X8, X3 and X6).
【0045】また、ある注目画素X0において、輪郭線
を構成する3つ以上の直線が交差する場合もあるが、か
かる場合は輪郭線の構成画素とみなさない方が妥当であ
る場合が多い。このため、隣接画素の多くが同程度の濃
淡値を有する場合には、輪郭線とはみなさないこととし
た。Further, at a certain pixel of interest X0, three or more straight lines forming the contour line may intersect, but in such a case, it is often appropriate not to regard it as a pixel constituting the contour line. For this reason, when many of the adjacent pixels have the same gray value, it is not considered as a contour line.
【0046】例えば、隣接画素が図3(d)に示す場合に
は、注目画素は、X1−X0、X2−X0、X4−X0、X3
−X0−X6という4つの輪郭線(直線)の交点とみなす
ことは妥当ではなく、輪郭の外縁を形成する画素とみな
すべきである。この際、輪郭線は、注目画素よりも高い
濃淡値を持つ隣接画素X1を通ると考えられるのであ
る。For example, when the adjacent pixels are shown in FIG. 3 (d), the target pixels are X1-X0, X2-X0, X4-X0, X3.
It is not appropriate to regard it as an intersection of four contour lines (straight lines) -X0-X6, and it should be regarded as pixels forming the outer edge of the contour. At this time, the contour line is considered to pass through the adjacent pixel X1 having a gray value higher than that of the target pixel.
【0047】そこで、本実施例では、注目画素X0が、
1つの直線(輪郭線)上にあるか、又は2つの方向が異
なる直線(輪郭線)の交点である場合は、輪郭線の構成
画素の構成画素とみなし、それ以外の場合には輪郭線以
外の構成画素とする。Therefore, in this embodiment, the pixel of interest X0 is
If it is on one straight line (contour line) or is the intersection of two straight lines (contour lines) in different directions, it is regarded as a constituent pixel of the constituent pixel of the contour line, otherwise it is other than the contour line. The constituent pixels of
【0048】また、注目画素が2つの直線(輪郭線)の
交点であるということは、他の方向(2方向)に対して
は輪郭線を形成しないことを意味するため、「注目画素
X0が、1つの直線(輪郭線)上にあるか、又は2つの
方向が異なる直線(輪郭線)の交点である」とする条件
と、「注目画素X0を通る4方向の直線のうち、少なく
とも2方向の直線上にない」とする条件とは等価であ
る。Further, the fact that the target pixel is the intersection of two straight lines (contour lines) means that no contour line is formed in the other directions (two directions). "It is on one straight line (contour line) or is an intersection of straight lines (contour lines) in two different directions", and "at least two directions among four straight lines passing through the target pixel X0". Is not on the straight line of. "
【0049】このため、本実施例では、注目画素を輪郭
線の構成画素とみなすための条件を、「注目画素の濃淡
値が、4組の隣接画素のうち、少なくとも2組の隣接画
素値のいずれよりも大きい場合」としたのである。Therefore, in this embodiment, the condition for considering the target pixel as a constituent pixel of the contour line is that "the gray value of the target pixel is at least two sets of adjacent pixel values among four sets of adjacent pixels. If it is greater than either, "
【0050】以上の概念に基づき、マスク処理(S20
2)においては、注目画素X0と各隣接画素との各濃度
差(Yi=X0−Xi ただしi=1〜8)を求め、注目
画素を中心とした隣接画素の縦方向の組み合わせ(X2
とX7)、横方向の組み合わせ(X4とX5)、斜め方向
の組み合わせ(X1とX8、X3とX6)のうち注目画素X
0との濃度差Yiが共に正(Yi≧0)になる組み合わ
せがいくつあるかを求める。Based on the above concept, mask processing (S20
In 2), the density difference (Yi = X0−Xi, i = 1 to 8) between the target pixel X0 and each adjacent pixel is obtained, and the vertical combination (X2
And X7), the horizontal combination (X4 and X5), and the diagonal combination (X1 and X8, X3 and X6), the target pixel X
The number of combinations in which the density difference Yi with 0 is positive (Yi ≧ 0) is calculated.
【0051】そして、条件判定(S203)において
は、マスク処理(S202)で算出した組数が2組以上
であるか否かを判定し、条件を満たす場合のみ当該注目
画素X0を輪郭線の構成画素とみなすことになる。Then, in the condition determination (S203), it is determined whether or not the number of sets calculated in the masking process (S202) is two or more, and only when the condition is satisfied, the target pixel X0 is configured as a contour line. It will be regarded as a pixel.
【0052】以上、本発明における細線2値化処理部1
3の動作概念と、マスク処理(S202)及び条件判定
(S203)について詳細に説明した。As described above, the thin line binarization processing unit 1 according to the present invention.
The operation concept of No. 3, the mask processing (S202) and the condition determination (S203) have been described in detail.
【0053】次に、微分画像に対して細線2値化処理部
13(S201〜S206)の各処理を行った結果を図
4に示す。Next, FIG. 4 shows a result of performing each processing of the thin line binarization processing unit 13 (S201 to S206) on the differential image.
【0054】図4(a)は、細線2値化処理部13に入力
された多値の濃淡値を持つ微分画像である。FIG. 4A is a differential image having multi-value grayscale values input to the thin line binarization processing unit 13.
【0055】そして、しきい値を濃淡値’65’として
図4(a)を2値化したものが図4(b)である。すなわち、
図4(b)は、微分画像の各画素に対してS201のしき
い値処理を行い、S202のマスク処理に移行すべき輪
郭線の候補となる画素を抽出して’1’で表したもので
ある。FIG. 4 (b) is a binarized version of FIG. 4 (a) with the threshold value of gray value '65'. That is,
In FIG. 4 (b), the threshold value processing of S201 is performed on each pixel of the differential image, and the pixels that are candidates for the contour line to be transferred to the mask processing of S202 are extracted and represented by "1". Is.
【0056】また、図4(c)は、図4(b)のうち’1’を
持つ画素と同じ座標に位置する図4(a)の各画素に対し
て、S202〜S205の処理を行った結果である。Further, in FIG. 4C, the processing of S202 to S205 is performed for each pixel of FIG. 4A located at the same coordinates as the pixel having "1" in FIG. 4B. It is the result.
【0057】このため、図4(c)に示すように、図4(a)
に示す微分画像のうち、濃淡値の高い稜線部分を1本の
輪郭線として抽出できることが分かる。これに対して、
単にしきい値処理を行った図4(b)では、太さを持つ輪
郭については抽出できるものの、線画としては抽出でき
ないのである。Therefore, as shown in FIG. 4 (c), as shown in FIG.
It can be seen that, in the differential image shown in (3), the ridge line portion having a high gray value can be extracted as one contour line. On the contrary,
In FIG. 4B in which the threshold processing is simply performed, the contour having a thickness can be extracted, but it cannot be extracted as a line drawing.
【0058】なお、本実施例では、図4(b)に示す2値
画像を作成する必要はないが、図4(b)と図4(c)とを対
比して説明する便宜上示すこととした。In this embodiment, it is not necessary to create the binary image shown in FIG. 4 (b), but it is shown for convenience of explanation by comparing FIGS. 4 (b) and 4 (c). did.
【0059】さらに、図5には、腕時計を被写体とした
微分画像全体に対して、(a)微分画像を単に2値化した
場合、(b)従来の2値化後細線化する方式を用いた場
合、(c)従来の細線化後2値化する場合、(d)本発明を適
用した場合の処理結果を示す。Further, in FIG. 5, for the entire differential image with the wristwatch as a subject, (a) when the differential image is simply binarized, (b) the conventional method of thinning after binarization is used. In the case of the following, processing results in the case of (c) binarization after the conventional thinning, and (d) the case of applying the present invention are shown.
【0060】図5(a)に示すように、微分画像を単に2
値化した場合には、太さを持つ線分としてエッジ部分を
良く表していることが分かる。As shown in FIG. 5A, the differential image is simply 2
It can be seen that when the value is converted, the edge portion is well represented as a line segment having a thickness.
【0061】しかし、図5(b)に示す従来の2値化後細
線化する方式を適用すると、図中のアルファベットが崩
れて泡状に出力されていることが分かる。However, it can be seen that when the conventional method of thinning after binarization shown in FIG. 5B is applied, the alphabet in the figure is broken and the output is made in the form of bubbles.
【0062】また、図5(c)に示す従来の細線化後2値
化する方式を適用すると、多くのノイズが含まれること
が分かる。Further, it can be seen that a large amount of noise is included when the conventional method of binarizing after thinning shown in FIG. 5 (c) is applied.
【0063】これに対して、図5(d)に示す本発明によ
る方式では、従来法の処理結果(図5(b)〜(c))に比し
て、輪郭線を線分として抽出できることが分かる。On the other hand, in the method according to the present invention shown in FIG. 5D, the contour line can be extracted as a line segment in comparison with the processing results of the conventional method (FIGS. 5B to 5C). I understand.
【0064】上述してきたように、本実施例では、多値
の濃淡値を持つ入力画像から輪郭線を抽出する際に、注
目画素と隣接する8つの画素を、上下、左右、右上左
下、左上右下の4つの組み合わせとした場合に、少なく
とも2つの組み合わせを構成する4つの画素のいずれの
濃淡値よりも、当該注目画素の濃淡値の方が大きい場合
には、当該注目画素を輪郭線の構成画素として選択し、
それ以外の場合には当該注目画素を輪郭線の構成画素と
して選択しないことにより、入力微分画像に忠実でかつ
品質の良い輪郭線を、迅速かつ効率的に抽出することが
できる。As described above, in this embodiment, when extracting a contour line from an input image having multi-valued gray values, eight pixels adjacent to the target pixel are vertically, horizontally, upper right lower left, upper left. In the case of the four combinations at the lower right, when the grayscale value of the pixel of interest is greater than the grayscale value of any of the four pixels forming the at least two combinations, the pixel of interest is Select it as a constituent pixel,
In other cases, by not selecting the target pixel as a constituent pixel of the contour line, a contour line faithful to the input differential image and of good quality can be extracted quickly and efficiently.
【0065】また、微分画像の全ての画素に対してマス
ク処理を行うのではなく、しきい値以上の画素に限定し
てマスク処理を行うため、処理を高速化することができ
る。Further, the mask processing is not performed on all the pixels of the differential image, but is limited to the pixels having a threshold value or more, so that the processing can be speeded up.
【0066】さらに、出力画像に対して後処理を実施す
る必要がないため、高品質な輪郭線を効率的に抽出する
ことができる。Furthermore, since it is not necessary to perform post-processing on the output image, high quality contour lines can be efficiently extracted.
【0067】なお、本実施例においては、3×3のマス
ク処理の場合について示したが、本発明はマスク処理に
限定されることなく、注目画素と隣接画素との関係を用
いた各種手法に対して適用することができる。In the present embodiment, the case of 3 × 3 mask processing is shown, but the present invention is not limited to mask processing, and various methods using the relationship between the pixel of interest and the adjacent pixel can be used. Can be applied to
【0068】[0068]
【発明の効果】以上詳細に説明したように、本発明で
は、多値入力画像の多値情報を用いて輪郭線を抽出する
際に、注目画素に隣接する上下、左右、右上左下、左上
右下方向の8つの画素を抽出し、該4つの方向のうち少
なくとも2つの方向に位置する各画素の濃淡値が、当該
注目画素の濃淡値より小さい場合は、当該注目画素を輪
郭線の構成画素として選択することにより、入力微分画
像に忠実でかつ品質の良い輪郭線を、迅速かつ効率的に
抽出することができる。As described in detail above, according to the present invention, when a contour line is extracted by using multi-valued information of a multi-valued input image, upper and lower sides, right and left sides, lower right and lower left, and upper left and right adjacent to a pixel of interest. When eight pixels in the downward direction are extracted and the grayscale value of each pixel located in at least two directions among the four directions is smaller than the grayscale value of the target pixel, the target pixel is defined as a pixel constituting the contour line. By selecting as, it is possible to quickly and efficiently extract a contour line that is faithful to the input differential image and has good quality.
【0069】また、微分画像の全ての画素に対して細線
化を行うのではなく、予め算出した画素候補に対して細
線化を行うため、処理を高速化できるという利点もあ
る。Further, since thinning is not performed on all the pixels of the differential image but thinning is performed on the pixel candidates calculated in advance, there is also an advantage that the processing speed can be increased.
【図1】 本発明の全体構成を示すブロック図。FIG. 1 is a block diagram showing the overall configuration of the present invention.
【図2】 図1に示す細線2値化処理部の処理手順を示
すフローチャート。FIG. 2 is a flowchart showing a processing procedure of a thin line binarization processing unit shown in FIG.
【図3】 図2に示すマスク処理及び判定条件の説明
図。FIG. 3 is an explanatory diagram of mask processing and determination conditions shown in FIG.
【図4】 微分画像に対して、図2に示す細線2値化処
理を行った結果を示す図。FIG. 4 is a diagram showing a result of performing thin line binarization processing shown in FIG. 2 on a differential image.
【図5】 図1に示す処理結果の一例を示す図。FIG. 5 is a diagram showing an example of the processing result shown in FIG.
【図6】 従来法による輪郭線の構成画素と本来の輪郭
線構成画素との差異を示す図。FIG. 6 is a diagram showing a difference between a pixel forming a contour line according to a conventional method and an original pixel forming a contour line.
10 原画像、11 入力処理部、 12 前処理部、
13 細線2値化処理部、 13a 候補画素選択部、
13b 細線化部、 13c 2値化出力部、 1
4 マスクパターン、 15 画像メモリ10 original image, 11 input processing unit, 12 pre-processing unit,
13 thin line binarization processing unit, 13a candidate pixel selection unit,
13b thinning unit, 13c binarization output unit, 1
4 mask patterns, 15 image memory
───────────────────────────────────────────────────── フロントページの続き (72)発明者 矢島 誠二 神奈川県川崎市高津区坂戸3丁目2番1号 KSP R&D ビジネスパークビル 富士ゼロックス株式会社内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Seiji Yajima 3-2-1 Sakado, Takatsu-ku, Kawasaki City, Kanagawa Prefecture KSP R & D Business Park Building Fuji Xerox Co., Ltd.
Claims (1)
抽出する輪郭線抽出方法において、 注目画素に隣接する上下、左右、右上左下、左上右下方
向の8つの画素を抽出し、該4つの方向のうち少なくと
も2つの方向に位置する各画素の濃淡値が、当該注目画
素の濃淡値よりも小さい場合は、当該注目画素を輪郭線
の構成画素として選択することを特徴とする入力画像の
輪郭線抽出方法。1. A contour line extraction method for extracting a contour line by using multi-valued information of a multi-valued input image, wherein eight pixels adjacent to a pixel of interest are extracted vertically, left and right, upper right lower left, upper left lower right. When the grayscale value of each pixel located in at least two of the four directions is smaller than the grayscale value of the target pixel, the target pixel is selected as a constituent pixel of the contour line. A method for extracting contour lines of an input image.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP5145063A JPH0721392A (en) | 1993-06-16 | 1993-06-16 | Method for extracting contour line of input picture |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP5145063A JPH0721392A (en) | 1993-06-16 | 1993-06-16 | Method for extracting contour line of input picture |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH0721392A true JPH0721392A (en) | 1995-01-24 |
Family
ID=15376528
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP5145063A Pending JPH0721392A (en) | 1993-06-16 | 1993-06-16 | Method for extracting contour line of input picture |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH0721392A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20230077441A (en) * | 2021-11-25 | 2023-06-01 | 숭실대학교산학협력단 | Method and apparatus for generating adversarial attack image |
-
1993
- 1993-06-16 JP JP5145063A patent/JPH0721392A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20230077441A (en) * | 2021-11-25 | 2023-06-01 | 숭실대학교산학협력단 | Method and apparatus for generating adversarial attack image |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6411737B2 (en) | Method of selecting one of a plurality of binarization programs | |
JP3251918B2 (en) | Binarization method in optical character recognition system | |
JP2016505186A (en) | Image processor with edge preservation and noise suppression functions | |
US8687895B2 (en) | Image processing apparatus, image processing method, and computer-readable medium | |
US11151402B2 (en) | Method of character recognition in written document | |
CN109241973B (en) | A fully automatic soft segmentation method of characters under texture background | |
CN114863492B (en) | Method and device for repairing low-quality fingerprint image | |
JP4062987B2 (en) | Image area dividing method, image area dividing apparatus, and image area dividing program | |
JPH04315272A (en) | Graphic recognizing device | |
Shi et al. | Image enhancement for degraded binary document images | |
JP2005165387A (en) | Screen streak defect detection method and apparatus, and display device | |
JPH09130614A (en) | Image processing unit | |
CN108109120B (en) | Illumination compensation method and device for dot matrix two-dimensional code | |
CN117765287A (en) | Image target extraction method combining LWR and density clustering | |
CN111986176B (en) | Crack image identification method, system, terminal and readable storage medium | |
JPH10285399A (en) | Image binarization method | |
JPH0721392A (en) | Method for extracting contour line of input picture | |
JP2019003534A (en) | Image processing program, image processing apparatus, and image processing method | |
JP3150762B2 (en) | Gradient vector extraction method and character recognition feature extraction method | |
AU2018229526B2 (en) | Recursive contour merging based detection of text area in an image | |
JP4116377B2 (en) | Image processing method and image processing apparatus | |
JP4035696B2 (en) | Line segment detection apparatus and image processing apparatus | |
Kim et al. | Detection of moving edges based on the concept of entropy and cross-entropy | |
JP4409713B2 (en) | Document image recognition apparatus and recording medium | |
JPH08221512A (en) | Image processing apparatus and method thereof |