[go: up one dir, main page]

JPH06101032B2 - Image processing method - Google Patents

Image processing method

Info

Publication number
JPH06101032B2
JPH06101032B2 JP16906987A JP16906987A JPH06101032B2 JP H06101032 B2 JPH06101032 B2 JP H06101032B2 JP 16906987 A JP16906987 A JP 16906987A JP 16906987 A JP16906987 A JP 16906987A JP H06101032 B2 JPH06101032 B2 JP H06101032B2
Authority
JP
Japan
Prior art keywords
pixel
pixel value
index
value
target
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.)
Expired - Fee Related
Application number
JP16906987A
Other languages
Japanese (ja)
Other versions
JPS6413680A (en
Inventor
良平 熊谷
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.)
Sharp Corp
Original Assignee
Sharp 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 Sharp Corp filed Critical Sharp Corp
Priority to JP16906987A priority Critical patent/JPH06101032B2/en
Publication of JPS6413680A publication Critical patent/JPS6413680A/en
Publication of JPH06101032B2 publication Critical patent/JPH06101032B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)

Description

【発明の詳細な説明】 〔発明の技術分野〕 処理対象とならない画素値を周囲の画素値としてあらか
じめ定めておき、画像中における周囲の画素でない図形
が、その図形の形状の特徴を残して連続した1画素幅の
曲線に変換されるように、並列型で判断して端点や独立
点ではなくかつ逐次型で判断して連結数が1でありかつ
並列型で判断して境界画素である画素をその図形の周囲
の画素値に変化させる画像処理方法に関する。
Description: TECHNICAL FIELD OF THE INVENTION Pixel values that are not to be processed are determined in advance as surrounding pixel values, and a figure that is not a surrounding pixel in an image is continuously formed with the shape features of the figure remaining. Pixels that are judged to be a 1-pixel-width curved line and are not end points or independent points, and are judged to be a sequential type, and the number of connections is 1 and are judged to be a boundary pixel if judged to be a parallel type so as to be converted into a curve of 1 pixel width. The present invention relates to an image processing method for changing a pixel value to a pixel value around the figure.

〔発明の背景とその問題点〕[Background of the invention and its problems]

例えば結晶構造の顕微鏡像では結晶界面はある程度の幅
をもつ曲線として現われ、結晶構造を解析する上でこの
曲線をその中心を通る1画素幅の曲線に修正しなければ
粒度などの測定を行うことはできない。このとき界面の
曲線を1画素幅に細める細線化が必要である。そして細
線化に際して界面の曲線が不連続となると隣接する結晶
粒がつながってしまい正しい粒度測定を行うことができ
ない。このような必要性に基づき細線化に対してはほぼ
確立した要求がある。すなわち、 (1)線幅1となる。
For example, in a microscopic image of a crystal structure, the crystal interface appears as a curve having a certain width, and in analyzing the crystal structure, if the curve is not corrected to a curve having a width of one pixel passing through the center, the grain size and the like should be measured. I can't. At this time, it is necessary to thin the curve of the interface to one pixel width. If the curve of the interface becomes discontinuous during thinning, adjacent crystal grains will be connected and accurate particle size measurement cannot be performed. Based on this need, there is an almost established demand for thinning. That is, (1) the line width is 1.

(2)線の位置はもとの図形のほぼ中心にくる。(2) The position of the line is almost at the center of the original figure.

(3)図形の連結性が保存される。(3) The connectivity of the figures is preserved.

(4)線図形の端の部分が必要以上に縮退しない。(4) The end portion of the line figure does not shrink more than necessary.

(5)境界部の凹凸により「ひげ」を生じない。(5) No whiskers occur due to the unevenness of the boundary.

(6)図形の交差部で線が歪まない。(6) Lines are not distorted at the intersection of figures.

これらの条件のうち、(1)〜(4)の条件は細線化処
理の基本条件と呼ばれ、アルゴリズムを構成する場合、
必ず考慮しなければならない。(長谷川純一他:画像処
理の基本技法、技術評論社、1961年、p66〜67) 細線化の画像処理方法としては、従来HILDITCHの手法が
知られており、その処理結果に対する評価は高いものが
あった。しかしHILDITCHの手法においては、対象画素の
連結数のみでなくその周囲の画素の連結数をも評価する
ため処理速度が不充分であるという問題があった。
Among these conditions, the conditions (1) to (4) are called basic conditions for thinning processing, and when configuring an algorithm,
Must be considered. (Junichi Hasegawa et al .: Basic technique of image processing, Technical Review, 1961, p66-67) As the image processing method for thinning, the HILDITCH method has been known so far, and the processing result is highly evaluated. there were. However, the HILDITCH method has a problem that the processing speed is insufficient because not only the number of connected pixels of the target pixel but also the number of connected pixels of the surrounding pixels are evaluated.

〔発明の目的〕[Object of the Invention]

この発明はこのような従来の問題点を解消すべく創案さ
れたもので、処理結果が良好であるとともに、処理が高
速の画像処理方法を提供することを目的とする。
The present invention was devised to solve such conventional problems, and an object of the present invention is to provide an image processing method in which the processing result is good and the processing speed is high.

〔発明の概要〕[Outline of Invention]

この発明に係る画像処理方法は、端点の処理を並列型と
して走査方向後方に「ひげ」が残ることを防止し、さら
に走査線の進行方向および走査線の並列方向に沿った2
画素幅の直線の処理に留意し、2画素幅の直線が生じる
可能性が生じたときに対象画素の画素値を指標的画素値
とし、2画素幅であることを確認したときに指標的画素
値の画素に隣接する画素を残存させ、指標的画素値の画
素は次回の走査の際に周囲の画素値に変化させるもので
ある。
The image processing method according to the present invention uses the end point processing as a parallel type to prevent "beards" from remaining behind in the scanning direction, and further, to prevent the "whiskers" from remaining behind in the scanning direction.
Paying attention to the processing of the straight line of the pixel width, the pixel value of the target pixel is set as the index pixel value when there is a possibility that a straight line of the two pixel width occurs, and the index pixel The pixels adjacent to the value pixel are left, and the pixel having the index pixel value is changed to the surrounding pixel value at the next scanning.

〔発明の実施例〕Example of Invention

次にこの発明に係る画像処理方法の一実施例を図面に基
づいて説明する。
Next, an embodiment of an image processing method according to the present invention will be described with reference to the drawings.

第1図に示すように画像中に1画素の点A(独立点)、
1画素幅の直線Lが存在するとき、これらを消去したと
すると画像の特徴がそこなわれる。また直線Lの端点LE
1またはLE2を消去したとすると、その他の点も順次消去
され、ついには直線Lが消去されて画像の特徴が損なわ
れる。従って細線化の処理において独立点や端点は消去
すべきでない。
As shown in FIG. 1, a point A (independent point) of one pixel in the image,
When there is a straight line L having a width of one pixel, if these lines are deleted, the characteristics of the image will be damaged. The end point LE of the straight line L
If 1 or LE2 is erased, the other points are also erased sequentially, and finally the straight line L is erased, and the characteristics of the image are impaired. Therefore, independent points and end points should not be deleted in the thinning process.

またある画素が要となって2つ以上の図形が連結されて
いる状態のとき、その画素を消去すると画像がトポロジ
ー的に変化してしまう。この連結状態は8連結について
の連結数で評価され、2つ以上の図形の要となる画素の
連結数は2以上である。従って画像の特徴を保持するた
めには連結数が1でない画素は消去すべきでない。
Further, when a certain pixel is required and two or more figures are connected, if that pixel is deleted, the image topologically changes. This connection state is evaluated by the number of connections for eight connections, and the number of connection of pixels that are the core of two or more figures is two or more. Therefore, in order to preserve the features of the image, pixels with a concatenation number of 1 should not be erased.

第13図に示す3×3のコンボリューションにおいて、対
象画素Pの右の画素の画素値をPOとし、これから反時計
回りに、周囲の画素の画素値をP1〜P7とすると、連結数
N8は次式で与えられる。
In the 3 × 3 convolution shown in FIG. 13, if the pixel value of the pixel to the right of the target pixel P is PO and the pixel values of the surrounding pixels are P1 to P7 in the counterclockwise direction, the number of connections
N8 is given by the following equation.

k=1−Pk 一方第2図において、画像中に特定の画素値(例えば
「1」)の正方形が存在するとき、これを細線化するに
はまず1回の走査でその境界画素(図中×印で示す。)
を周囲の画素値(例えば「0」)に変化させ、1回毎の
走査で順次境界画素を「1」から「0」に変化させると
いう処理を行う。このとき走査方向が左から右、上から
下の通常の走査であったとすると、当初の正方形におけ
る右下の画素、すなわち図形中最後に走査される画素に
はその他の境界画素が周囲の画素値に変化(×印を付し
た)したときには端点となり、これを消去することはで
きない。同様にその左上、その左上(中央)の画素は毎
回の走査で残ってしまい、ついには第2図のような右下
りの「ひげ」を生じてしまう。
k = 1-P k On the other hand, in Fig. 2, when a square of a specific pixel value (for example, "1") exists in the image, in order to thin the square, the boundary pixel (Fig. (Indicated by a cross mark.)
Is changed to a peripheral pixel value (for example, “0”), and the boundary pixels are sequentially changed from “1” to “0” in each scanning. At this time, if the scanning direction is normal scanning from left to right and from top to bottom, the lower right pixel in the original square, that is, the pixel scanned last in the figure has other boundary pixels surrounding pixel values. When it changes to (marked with x), it becomes an end point and cannot be erased. Similarly, the upper left pixel and the upper left (center) pixel remain in each scanning, and finally a downward whisker "beard" as shown in FIG. 2 is generated.

このような「ひげ」の発生を防止するために、ここでは
端点を並列型で処理している。ここに並列型の処理とは
1回の走査において、その回画素値が変化した画素につ
いては、未だ変化していないものとみなして判断を行う
ものである。すなわち第2図において変化済の×印を付
した画素が未変化であると、画素Eの上、左に同一画素
値の画素A,Bが存在することになり、Eは端点でなくな
る。このためEは1回目の走査で周囲の画素値に変化
し、その左上の画素も次回の走査で周囲の画素値に変化
し、「ひげ」の発生が防止される。
In order to prevent the occurrence of such a “whisker”, the end points are processed in parallel here. Here, the parallel type processing is to judge that a pixel whose pixel value has changed a single time in one scanning is regarded as having not changed. That is, in FIG. 2, when the pixel marked with the changed X is not changed, pixels A and B having the same pixel value exist above and to the left of the pixel E, and E is not an end point. Therefore, E changes to the surrounding pixel value in the first scanning, and the upper left pixel also changes to the surrounding pixel value in the next scanning, thus preventing the occurrence of "whiskers".

並列型処理と対照的な処理方法に逐次型処理があり、こ
の場合には、1回の走査において画素値が変化した画素
をその変化後の画素値に基づいて評価する。
Sequential processing is a processing method in contrast to parallel processing, and in this case, a pixel whose pixel value has changed in one scan is evaluated based on the pixel value after the change.

しかしこのように端点を並列型で処理すると、次のよう
な問題を生じる。すなわち、第4図(a)のような走査
線の進行方向に沿った2画素幅の直線、あるいは同
(b)のような走査線の並列方向に沿った2画素幅の直
線は、端点を並列型で処理すると消滅してまう。
However, when the end points are processed in parallel as described above, the following problems occur. That is, a straight line having a width of 2 pixels along the traveling direction of the scanning line as shown in FIG. 4A or a straight line having a width of 2 pixels along the parallel direction of the scanning lines as shown in FIG. It disappears when processed in parallel.

第4図(a)において、その左上の端の画素Aは端点や
独立点ではなく、連結数は1でありかつ境界画素である
ので周囲の画素値(例えば「O」)にかえられる。その
右隣の画素Bは画素Aが存在しなければ端点として残さ
れるが端点に関する処理は並列的であるのでAが残って
いるものとしてBの端点に関する処理が行われる。この
ため画素Bは消去されてしまう。次に走査線並列方向に
ついて1走査だけ進んだ2段目の画素C,Dについては、
まずCが単なる境界画素であるために消去され、さら
に、A,B,Cが存在しているものとして画素Dの境界画素
に関する判断が行われるので、画素Dも消去される。こ
のように2画素幅の縦線はついには消滅してしまう。
In FIG. 4 (a), the pixel A at the upper left end is not an end point or an independent point, the number of connections is 1 and it is a boundary pixel, so it can be changed to the surrounding pixel value (for example, "O"). If the pixel A does not exist, the pixel B on the right side of the pixel B is left as an end point, but since the processing regarding the end point is parallel, the processing regarding the end point of B is performed assuming that A remains. Therefore, the pixel B is erased. Next, regarding the second-stage pixels C and D that have advanced by one scan in the scanning line parallel direction,
First, C is erased because it is merely a boundary pixel, and further, since the determination regarding the boundary pixel of pixel D is made assuming that A, B, and C exist, pixel D is also erased. In this way, the vertical line having a width of 2 pixels disappears at last.

第4図(b)において、1段目の画素A,A,…は単なる境
界画素であるから順次消去され、2段目の画素の判断に
移ったとき、2段目の左端の画素Bは、1段目の画素が
消去されていれば端点として残されるが、端点は並列型
で判断されるため、画素Bは消去される。同様にBの右
隣B′、その右隣と順次2段目の画素は消去され、つい
には2画素幅の水平線全てが消滅してしまう。
In FIG. 4 (b), the first-stage pixels A, A, ... Are simply boundary pixels, and are sequentially erased. When the second-stage pixel determination is performed, the second-stage leftmost pixel B is If the pixels in the first row are erased, they are left as endpoints, but since the endpoints are determined in parallel, pixel B is erased. Similarly, B'to the right of B and its neighbor to the right are sequentially erased, and finally, all horizontal lines having a width of 2 pixels disappear.

このような2画素幅の直線の消滅を防止するため次のよ
うな条件a-i)〜a-v)を採用することにする。
In order to prevent the disappearance of such a straight line having a width of 2 pixels, the following conditions ai) to av) are adopted.

すなわち、第5図〜第9図の3×3のコンボリューショ
ンにおいて、 a-i)対象画素Aの上および左の画素が周囲の画素値
(例えば「O」)であるとき、対象画素Aには通常の画
素値と異なる指標的画素値(画像中に存在し得ない画素
値、例えば「−1」)を与える(第5図)。
That is, in the 3 × 3 convolution of FIGS. 5 to 9, ai) When the upper and left pixels of the target pixel A have the surrounding pixel values (for example, “O”), the target pixel A is usually An index pixel value (a pixel value that cannot exist in the image, for example, "-1") different from the pixel value of is given (FIG. 5).

a-ii)a-i)の条件に合致しない場合であって、逐次型
で判断して、対象画素Aの上の画素Cが指標的画素値で
あり、下の画素Bが周囲の画素値であるとき、対象画素
Aをそのまま保存する(第6図)。
a-ii) When the condition of ai) is not met, the pixel C above the target pixel A is the index pixel value, and the pixel B below is the surrounding pixel value, determined by the sequential type. At this time, the target pixel A is saved as it is (FIG. 6).

a-iii)a-i)の条件に合致しない場合であって、逐次型
で判断して、対象画素Aの左の画素Cが指標的画素値で
あり、右の画素Bが周囲の画素値であるとき、対象画素
Aをそのまま保存する(第7図)。
a-iii) When the condition of ai) is not met, the pixel C on the left side of the target pixel A is the index pixel value, and the pixel B on the right side is the surrounding pixel value, which is determined by the sequential type. At this time, the target pixel A is saved as it is (FIG. 7).

a-iv)a-i)〜a-iii)の条件に合致しない場合であっ
て、逐次型で判断して、対象画素Aの上の画素Bが指標
的画素値であり、並列型で判断して、画素Bの左右の画
素C1,C2が周囲の画素値であるとき、対象画素Aを指標
的画素値とする。
a-iv) ai) to a-iii) are not met, and the judgment is performed sequentially, and the pixel B above the target pixel A is an index pixel value, and the judgment is performed in parallel. , When the pixels C 1 and C 2 on the left and right of the pixel B have peripheral pixel values, the target pixel A is set as an index pixel value.

a-v)a-i)〜a-iii)の条件に合致しない場合であっ
て、逐次型で判断して、対象画素Aの左の画素Bが指標
的画素値であり、並列型で判断して、画素Bの上下の画
素C1,C2の画素が周囲の画素値であるとき、対象画素A
を指標的画素値とする。
av) ai) to a-iii) are not met, the pixel B on the left of the target pixel A is an index pixel value, which is determined by the sequential type, and the pixel B is determined by the parallel type. When the pixels C 1 and C 2 above and below B have peripheral pixel values, the target pixel A
Is an index pixel value.

そしてこのような処理によって生じた指標的画素値の画
素は次回の走査に際して周囲の画素値とする。
Then, the pixel having the index pixel value generated by such processing is set to the pixel value of the surroundings in the next scanning.

走査の方向を左から右、上から下に限らなければ、これ
らの条件a-i)〜a-v)は次のようにb-i)〜b-v)として
一般化される。
Unless the scanning direction is left to right or top to bottom, these conditions ai) to av) are generalized as bi) to bv) as follows.

b-i)並列型で判断して、1走査線の進行方向について
対象画素の1つ前の画素、および走査線並列方向につい
て1つ前の走査線における、対象画素の位置に対応した
画素が周囲の画素値または指標的画素値であるとき、対
象画素を指標的面素値に変換する。
bi) Judging by the parallel type, the pixel one pixel before the target pixel in the traveling direction of one scanning line and the pixel corresponding to the position of the target pixel in the scanning line one previous in the scanning line parallel direction are the surrounding pixels. If it is a pixel value or an index pixel value, the target pixel is converted into an index pixel value.

b-ii)b-i)の条件に合致しない場合であって、逐次型
で判断して、走査線の並列方向について1つ前の走査線
における対象画素の位置に対応した画素が指標的画素値
であり、なおかつ、走査線の並列方向について1つ後の
走査線における対象画素の位置に対応した画素が周囲の
画素値であるとき、対象画素をそのまま保存する。
b-ii) When the condition of bi) is not met, the pixel corresponding to the position of the target pixel in the scanning line one before in the parallel direction of the scanning lines is the index pixel value, which is determined by the sequential type. Yes, and when the pixel corresponding to the position of the target pixel on the scanning line one after in the parallel direction of the scanning lines has the surrounding pixel value, the target pixel is stored as it is.

b-iii)b-i)の条件に合致しない場合であって、逐次型
で判断して、1走査線の並列方向について、1つ前の画
素が指標的画素値であり、1つ後の画素が周囲の画素値
であるとき、対象画素をそのまま保存する。
In the case where the condition of b-iii) bi) is not met, it is judged by the sequential type that the pixel one pixel before is the index pixel value and the pixel one pixel after is one pixel in the parallel direction of one scanning line. When the pixel value is the surrounding pixel value, the target pixel is saved as it is.

b-vi)b-i)〜b-iii)の条件に合致しない場合であっ
て、逐次型で判断して、走査線の並列方向について1つ
前の走査線における対象画素の位置に対応した画素が指
標的画素値であり、なおかつ、並列型で判断して1走査
線の進行方向について、この画素の前後の画素が周囲の
画素値であるとき、対象画素を指標的画素値とする。
b-vi) bi) to b-iii) are not met, the pixel corresponding to the position of the target pixel in the scanning line immediately before in the parallel direction of the scanning lines is determined by the sequential type. When the pixel value is an index pixel value and the pixels before and after this pixel are surrounding pixel values in the advancing direction of one scanning line determined by the parallel type, the target pixel is set as the index pixel value.

b-v)b-i)〜b-iii)の条件に合致しない場合であっ
て、逐次型で判断して、1走査線の進行方向について1
つ前画素が指標的画素値であり、並列型で判断して、走
査線の並列方向についてこの画素の前後の走査線におけ
るこの画素の位置に対応した画素が周囲の画素値である
とき、対象画素を指標的画素値とする。
bv) bi) to b-iii) are not met, the judgment is made sequentially, and 1 in the traveling direction of one scanning line
If the preceding pixel is an index pixel value and is judged in parallel type, and the pixel corresponding to the position of this pixel in the scanning line before and after this pixel in the parallel direction of the scanning line is the surrounding pixel value, Let the pixel be an index pixel value.

これら条件は第10図〜第12図の図形の処理に対応する。These conditions correspond to the processing of the graphics of Figures 10-12.

第10図(a)の図形は縦の2画素幅の直線であり、前記
条件a-i)およびa-iii)に対応する。この図形はまず上
端左の画素が判断の対象となり、この画素にはa-i)の
条件により、指標的画素値(例えば「−1」)が付され
る。次にその右の画素が判断の対象となり、これは条件
a-iii)により、周囲の画素値とはされずにそのままの
画素値(例えば「1」)が残される。これによって2画
素幅の縦の直線は最下端の画素を除き右側の1画素幅の
直線に細線化されることになる。
The figure in FIG. 10 (a) is a vertical straight line having a width of 2 pixels and corresponds to the conditions ai) and a-iii). In this figure, the pixel on the upper left side is the object of judgment, and this pixel is given an index pixel value (for example, "-1") according to the condition of ai). Next, the pixel to the right of the
According to a-iii), the pixel value (for example, “1”) as it is is not left as the surrounding pixel value. As a result, the vertical straight line having a width of 2 pixels is thinned to a straight line having a width of 1 pixel on the right side except for the pixel at the lowermost end.

第10図(b)の図形は水平な2画素幅の直線であり、前
記条件a-i)およびa-ii)に対応する。この図形はまず
上段左端の画素が判断の対象となり、この画素にはa-
i)の条件により指標的画素値(例えば「−1」)が付
される。上段はこの左端の画素以外の画素は全て消去さ
れる。次に2段目に移ると、左端の画素は条件a-ii)に
より、そのままの画素値(例えば「1」)が残され、以
後の画素も同様に残される。これによって2画素幅の水
平な直線は右端の画素を除き下段の1画素幅の直線が残
されることになる。
The figure in FIG. 10 (b) is a horizontal straight line having a width of 2 pixels and corresponds to the conditions ai) and a-ii). In this figure, the pixel at the left end of the upper row is the target of judgment, and a-
An index pixel value (for example, "-1") is added according to the condition of i). In the upper row, all pixels except the leftmost pixel are erased. Next, when moving to the second stage, the pixel value at the left end is left as it is under the condition a-ii) (for example, “1”), and the subsequent pixels are also left in the same manner. As a result, a horizontal straight line having a width of 2 pixels is left as a straight line having a width of 1 pixel in the lower stage except for the rightmost pixel.

第11図(a)の図形は縦の2画素幅の直線の上端に、左
寄りに画素Aを付加したものであり、前記条件a-i)お
よびa-iv)に対応する。(ただし右寄りに画素を付加し
た図形も同様に処理される。) この図形に対し、単なる並列型の端点判定条件を用いる
と、まず画素Aは端点ではない(2画素B,Cに接してい
る。)ので周囲の画素値に変換されてしまう。次に2画
素幅の部分に移ると、左側の画素Bは、上側の画素Aが
存在しているものとして判断が行われるため、周囲の画
素値に変換され、同様に画素Cも周囲の画素値に変換さ
れる。このためついにはこの図形は消滅することにな
る。
The figure in FIG. 11 (a) is obtained by adding a pixel A to the left at the upper end of a vertical straight line having a width of 2 pixels, and corresponds to the conditions ai) and a-iv). (However, a graphic with pixels added to the right is also processed in the same manner.) If a simple parallel type end point determination condition is used for this graphic, first, pixel A is not an end point (contacts two pixels B and C). .) So it will be converted to surrounding pixel values. Next, when moving to a portion of a width of 2 pixels, the pixel B on the left side is determined as the pixel A on the upper side is present, and is therefore converted into the pixel value of the surrounding pixels. Is converted to a value. Therefore, this figure finally disappears.

そこで第12図(a)に示すように、条件a-i)により画
素Aには指標的画素値を与え、画素Bにも条件a-iv)に
より指標的画素値を与える。これによりこの図形は最下
端の画素を除き右側の1画素幅の直線に細線化される。
Therefore, as shown in FIG. 12 (a), the index pixel value is given to the pixel A under the condition ai) and the index pixel value is given to the pixel B also under the condition a-iv). As a result, this figure is thinned into a straight line having a width of one pixel on the right side except for the pixel at the bottom end.

第11図(b)の図形は水平な2画素幅の直線の左端上側
に画素Aを付加したものであり、前記条件a-i)およびa
-v)に対応する。(ただし下側に画素を付加した図形も
同様に処理される。) この図形に対し、単なる並列型の端点判定条件を用いる
と、まず画素Aは端点ではない(2画素B,Cに接してい
る。)ので周囲の画素値に変換されてしまう。次に2画
素幅の部分に移ると、上側の画素Bは、左側の画素Aが
存在しているものとして判断が行われるため、周囲の画
素値に変換され、ついには上段の画素は全て周囲の画素
値に変換される。次に2段目に移るとその左端の画素は
画素Aの存在により消去され、ついには2段目の画素は
全て周囲の画素値に変換される。このためこの図形は最
終的には消滅することになる。
The figure in FIG. 11 (b) is one in which a pixel A is added to the upper left end of a horizontal straight line having a width of 2 pixels.
-v). (However, a graphic with pixels added to the lower side is processed in the same manner.) If a simple parallel type end point judgment condition is used for this graphic, first, pixel A is not an end point (contacts two pixels B and C). It will be converted to the surrounding pixel values. Next, when moving to the 2-pixel width portion, the upper pixel B is determined as the pixel A on the left side is present, and is therefore converted into the peripheral pixel value, and finally the upper pixels are all peripheral pixels. Is converted into a pixel value of. Next, when moving to the second stage, the pixel at the left end is erased due to the presence of the pixel A, and finally the pixels in the second stage are all converted to the surrounding pixel values. Therefore, this figure eventually disappears.

そこで第12図(b)に示すように、条件a-i)により画
素Aには指標的画素値を与え、画素Bにも条件a-v)に
より指標的画素値を与える。これによりこの図形は右端
の画素を除き下側の1画素幅の直線に細線化される。
Therefore, as shown in FIG. 12B, the index pixel value is given to the pixel A under the condition ai) and the index pixel value is given to the pixel B under the condition av). As a result, this figure is thinned to a straight line having a width of one pixel on the lower side except for the pixel at the right end.

このように「ひげ」を生じさせることなく2画素幅の直
線が確実に1画素幅の直線として残るため、細線化の処
理結果は良好である。そして1回の走査で1層の境界画
素の処理が終了するので、処理は高速である。
In this way, a straight line having a width of 2 pixels is surely left as a straight line having a width of 1 pixel without causing a "whisker", and thus the thinning processing result is good. Since the processing of the boundary pixels of one layer is completed by one scan, the processing is fast.

ここにBASICのプログラムによるシミュレーションを行
った結果HILDICHの手法と同等あるいはより良好な結果
を1/2以下の処理時間で得られたというデータがある。
Here is the data that the simulation result by the BASIC program was equivalent to or better than the HILDICH method in less than half the processing time.

なお以上の実施例では画像中に周囲の画素値でない1種
類の画素値の図形が存在する場合について説明したが、
多種の画素値、例えば図形のグループ毎にラベリング番
号を付した場合には、各ラベリング番号を処理対象とな
る画素値として取扱い、各グループ毎に前記と同様に細
線化し、あるいは所望のラベリング番号の図形のみをそ
れぞれ前記と同様に細線化し得ることはいうまでもな
い。
In the above embodiments, the case where there is a figure of one kind of pixel value other than the surrounding pixel values in the image has been described.
Various pixel values, for example, when labeling numbers are assigned to each group of figures, each labeling number is treated as a pixel value to be processed, and each group is thinned as described above or a desired labeling number It goes without saying that only the figure can be thinned in the same manner as described above.

〔発明の効果〕〔The invention's effect〕

前述のとおり、この発明に係る画像処理方法は、端点の
処理を並列型として走査方向後方に「ひげ」が残ること
を防止し、さらに走査線の進行方向および走査線の並列
方法に沿った2画素幅の直線の処理に特に留意し、2画
素幅の直線が生じる可能性が生じたときに対象画素の画
素値を指標的画素値とし、2画素幅であることを確認し
たときに指標的画素値の画素に隣接する画素を残存さ
せ、指標的画素値の画素はその回の走査以後の走査の際
に周囲の画素値に変化させるので、処理結果が良好であ
るとともに処理が高速であるという優れた効果を有す
る。
As described above, the image processing method according to the present invention uses the end point processing as a parallel type to prevent a "whisker" from remaining behind in the scanning direction, and further, to meet the scanning line advancing direction and the scanning line paralleling method. Pay particular attention to the processing of a straight line with a pixel width, and when there is a possibility that a straight line with a two-pixel width occurs, the pixel value of the target pixel is set as an index pixel value, and when it is confirmed that the pixel width is two The pixel adjacent to the pixel having the pixel value is left, and the pixel having the index pixel value is changed to the surrounding pixel values during the subsequent scanning, so that the processing result is good and the processing is fast. It has an excellent effect.

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

第1図は端点、独立点を示す概念図、第2図、第3図は
「ひげ」の発生状況を示す概念図、第4図(a)は2画
素幅の縦線を示す概念図、第4図(b)は2画素幅の水
平線を示す概念図、第5図は3×3の領域に対する第1
の判断条件を示す概念図、第6図〜第9図は順次第2〜
第5の判断条件を示す概念図、第10図(a)は2画素幅
の縦線の処理結果を示す概念図、第10図(b)は2画素
幅の水平線の処理結果を示す概念図、第11図(a)は2
画素幅の縦線に1画素付加した図形を示す概念図、第11
図(b)は2画素幅の水平線に1画素付加した図形を示
す概念図、第12図(a)は第11図(a)の図形の処理結
果を示す概念図、第12図(b)は第11図(b)の図形の
処理結果を示す概念図、第13図は連結数を説明するため
の3×3のコンボリューションを示す概念図である。 A,B,C,C1,C2,A′,B′……画素 L……直線 LE1,LE2……端点。 P0〜P7……画素値
FIG. 1 is a conceptual diagram showing end points and independent points, FIG. 2 and FIG. 3 are conceptual diagrams showing the occurrence of “whiskers”, and FIG. 4 (a) is a conceptual diagram showing vertical lines of 2 pixel width, FIG. 4 (b) is a conceptual diagram showing a horizontal line having a width of 2 pixels, and FIG. 5 is a first diagram for a 3 × 3 region.
6 to 9 are conceptual diagrams showing the judgment conditions of
A conceptual diagram showing the fifth judgment condition, FIG. 10 (a) is a conceptual diagram showing a processing result of a vertical line of 2 pixel width, and FIG. 10 (b) is a conceptual diagram showing a processing result of a horizontal line of 2 pixel width. , Fig. 11 (a) is 2
11 is a conceptual diagram showing a figure in which one pixel is added to a vertical line having a pixel width.
FIG. 12B is a conceptual diagram showing a figure in which one pixel is added to a horizontal line having a width of 2 pixels, FIG. 12A is a conceptual diagram showing a processing result of the figure in FIG. 11A, and FIG. 12B. Is a conceptual diagram showing the processing result of the graphic of FIG. 11 (b), and FIG. 13 is a conceptual diagram showing a 3 × 3 convolution for explaining the number of connections. A, B, C, C 1 , C 2 , A ', B' ... Pixel L ... Straight lines LE1, LE2 ... End points. P 0 to P 7 ... Pixel value

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】処理対象とならない画素を周囲の画素値と
してあらかじめ定めておき、画像中における周囲の画素
値でない図形が、その図形の形状の特徴を残して連続し
た1画素幅の曲線に変換されるように、並列型で判断し
て端点や独立点ではなくかつ逐次型で判断して連結数が
1でありかつ並列型で判断して境界画素である画素をそ
の図形の周囲の画素値に変化させる画像処理方法におい
て、画像中に存在し得ない指標的画素値を定義してお
き、画像中の画素を順次走査して対象画素とし、対象画
素が指標的画素値であるときには、対象画素を周囲の画
素値とし、周囲の画素値あるいは指標的画素値でなかっ
たとき以下の処理を行うことを特徴とする画像処理方
法。 i)並列型で判断して、1走査線の進行方向について対
象画素の1つ前の画素および走査線並列方向について1
つ前の走査線における対象画素の位置に対応した画素
が、周囲の画素値または指標的画素であるとき対象画素
を指標的画素値に変換する。 ii)i)の条件に合致しない場合であって、逐次型で判
断して、走査線の並列方向について1つの前の走査線に
おける対象画素の位置に対応した画素が指標的画素値で
あり、なおかつ、走査線の並列方向について1つ後の走
査線における対象画素の位置に対応した画素が周囲の画
素値であるとき、対象画素をそのまま保存する。 iii)i)の条件に合致しない場合であって、逐次型で
判断して、1走査線の進行方向について1つ前の画素が
指標的画素値であり、1つ後の画素が周囲の画素値であ
るとき、対象画素をそのまま保存する。 iv)i)〜iii)の条件に合致しない場合であって、逐
次型で判断して、走査線の並列方向について1つ前の走
査線における対象画素の位置に対応した画素が指標的画
素値であり、なおかつ、並列型で判断して、1走査線の
進行方向についてこの画素の前後の画素が周囲の画素値
であるとき、対象画素を指標的画素値とする。 v)i)〜iii)の条件に合致しない場合であって、逐
次型で判断して、1走査線の進行方向について1つ前の
画素が指標的画素値であり、並列型で判断して、走査線
の並列方向についてこの画素の前後の走査線におけるこ
の画素の位置に対応した画素が周囲の画素値であると
き、対象画素を指標的画素値とする。 vi)i)〜v)の条件に合致しない場合は対象画素を周
囲の画素値とする。
1. A pixel which is not a processing target is defined in advance as a surrounding pixel value, and a figure having no surrounding pixel value in the image is converted into a continuous 1-pixel-wide curve while leaving the shape feature of the figure. As described above, it is determined by the parallel type that it is not an end point or an independent point, the sequential type is determined, and the number of connections is 1 and the parallel type is determined, and a pixel that is a boundary pixel is a pixel value around the figure. In the image processing method of changing to, the index pixel value that cannot exist in the image is defined, the pixels in the image are sequentially scanned to be the target pixel, and when the target pixel is the index pixel value, An image processing method, wherein a pixel is set as a surrounding pixel value, and the following processing is performed when it is not a surrounding pixel value or an index pixel value. i) Judging by the parallel type, the pixel preceding the target pixel in the traveling direction of one scanning line and the scanning line parallel direction is 1
When the pixel corresponding to the position of the target pixel on the immediately preceding scanning line is the surrounding pixel value or the index pixel, the target pixel is converted to the index pixel value. ii) In the case where the condition of i) is not met, the pixel corresponding to the position of the target pixel in one previous scan line in the parallel direction of the scan lines is the index pixel value, which is determined by the sequential type. In addition, when the pixel corresponding to the position of the target pixel on the next scanning line in the parallel direction of the scanning lines has the peripheral pixel value, the target pixel is stored as it is. iii) In the case where the condition of i) is not met, the pixel that is one pixel before in the traveling direction of one scanning line is the index pixel value, and the pixel that is one pixel after is one pixel in the surrounding direction when judged by the sequential type. If it is a value, the target pixel is saved as it is. iv) In the case where the conditions of i) to iii) are not met, the pixel corresponding to the position of the target pixel on the scan line immediately before in the parallel direction of the scan lines is determined as the index pixel value in the sequential determination. Further, when the pixels before and after this pixel in the advancing direction of one scanning line are the peripheral pixel values in the advancing direction of one scanning line, the target pixel is set as the index pixel value. v) In the case where the conditions of i) to iii) are not met, it is judged by the sequential type, and the pixel immediately before in the traveling direction of one scanning line is the index pixel value, and judged by the parallel type. , When the pixel corresponding to the position of this pixel in the scanning line before and after this pixel in the parallel direction of the scanning lines has the surrounding pixel value, the target pixel is set as the index pixel value. vi) When the conditions of i) to v) are not met, the target pixel is set as the surrounding pixel value.
JP16906987A 1987-07-07 1987-07-07 Image processing method Expired - Fee Related JPH06101032B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP16906987A JPH06101032B2 (en) 1987-07-07 1987-07-07 Image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP16906987A JPH06101032B2 (en) 1987-07-07 1987-07-07 Image processing method

Publications (2)

Publication Number Publication Date
JPS6413680A JPS6413680A (en) 1989-01-18
JPH06101032B2 true JPH06101032B2 (en) 1994-12-12

Family

ID=15879752

Family Applications (1)

Application Number Title Priority Date Filing Date
JP16906987A Expired - Fee Related JPH06101032B2 (en) 1987-07-07 1987-07-07 Image processing method

Country Status (1)

Country Link
JP (1) JPH06101032B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4515516B2 (en) 2008-09-09 2010-08-04 株式会社アイペックス Connector device

Also Published As

Publication number Publication date
JPS6413680A (en) 1989-01-18

Similar Documents

Publication Publication Date Title
JP2608571B2 (en) Apparatus and method for vectorizing input scanned image data
CN104680531B (en) A kind of connection amount statistical information extracting method and VLSI structure
JPH05256796A (en) Inspecting system
Chowdhury et al. Optical Character Recognition of Bangla Characters using neural network: A better approach
JPH06101032B2 (en) Image processing method
KR20020064897A (en) Segmentation of digital images
JPH10320557A (en) Method and apparatus for detecting telop character display frame
JPH0628466A (en) Method for making line of image thin
JPS60220479A (en) Character position detection circuit
JPH03179873A (en) Picture processing method
JPH0769966B2 (en) Image processing method
JP5157963B2 (en) Object detection device
JP3255549B2 (en) Figure processing method
EP0466330A2 (en) Method for editing character bit maps at small sizes using connected runs
CN116580129B (en) Method, device and storage medium for improving calligraphy character skeleton based on distance transformation
JPH04172573A (en) Picture processing method
JP2001043312A (en) Document image processing device
JP2003086641A (en) Wafer mapping system
JP2913635B2 (en) Drawing method in bitmap display system
JPS6019285A (en) Stroke extracting method
JPH0546758A (en) Method for processing image
JPS60181883A (en) Stroke extraction method in character discrimination
EP0375806A1 (en) Image processing method
JP2588742B2 (en) Image reduction apparatus and method
JPH0683949A (en) Method for reducing image

Legal Events

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