JPH032983A - Picture processing method - Google Patents

Picture processing method

Info

Publication number
JPH032983A
JPH032983A JP1136587A JP13658789A JPH032983A JP H032983 A JPH032983 A JP H032983A JP 1136587 A JP1136587 A JP 1136587A JP 13658789 A JP13658789 A JP 13658789A JP H032983 A JPH032983 A JP H032983A
Authority
JP
Japan
Prior art keywords
area
image
missing
ratio
image 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
Application number
JP1136587A
Other languages
Japanese (ja)
Inventor
Teruo Koyama
小山 輝夫
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.)
Mitsubishi Power Ltd
Original Assignee
Babcock Hitachi KK
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 Babcock Hitachi KK filed Critical Babcock Hitachi KK
Priority to JP1136587A priority Critical patent/JPH032983A/en
Publication of JPH032983A publication Critical patent/JPH032983A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

PURPOSE:To attain erasion and automatic restoration with reflection of technical knowledge by calculating the area of a part to be erased and/or restored and a ratio between the area and its peripheral length and deciding whether the relevant part is unnecessary or not based on a function decided previously in response to those calculated area and ratio. CONSTITUTION:When a picture obtained by erasing and/or missing the unnecessary parts out of a produced binary picture is restored, the area of an unnecessary part and the ratio between the area of the part and its peripheral length are calculated. Then a procedure is set to decide whether the relevant part is unnecessary or not based on a function decided previously in response to those calculated area and ratio. Thus it is possible to erase and restore the missing parts and the unnecessary parts in terms of noises out of a binary picture based on the technical knowledge with no intervention of experts.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は画像処理方法に係り、特に画像の境界が不明確
な場合に好適な画像処理方法に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to an image processing method, and particularly to an image processing method suitable for cases where the boundaries of an image are unclear.

〔従来の技術〕[Conventional technology]

近年、コンピュータの高度化に伴い、形状測定に画像処
理装置が用いられることが多くなってきている。例えば
、金属材料の結晶粒度や粉体の粒度測定等に画像処理装
置が用いられている。また、特開昭63−228062
号公報は金属材粒の結晶粒形状を測定し、その形状変化
量からクリープ寿命を予測する技術を開示しているが、
この場合も多くの結晶粒の形状を測定し、統計的処理を
するため画像処理装置が用いられている。
In recent years, as computers have become more sophisticated, image processing devices have been increasingly used for shape measurement. For example, image processing devices are used to measure the crystal grain size of metal materials and the grain size of powder. Also, JP-A No. 63-228062
The publication discloses a technology that measures the crystal grain shape of metal material grains and predicts creep life from the amount of change in shape.
In this case as well, an image processing device is used to measure the shapes of many crystal grains and perform statistical processing.

一般に画像処理ではカメラを介して対象物のアナログ信
号が入力され、該アナログ信号がA/D変換器でディジ
タル信号に変換される。すなわち、画像が数百X数百の
画素に分けられ、各画素の座標とアナログ信号に対する
色の情報がディジタル信号として取り込まれる。このデ
ィジタル信号がコンピュータで処理され、形状測定や形
態分類等が行われる。形状測定では測定対象物が色の濃
度に応じた値のディジタル信号で表現され、このディジ
タル信号がある色の濃度をしきい値として2つに分類さ
れて、対象物の画像が特定される。これが2値化と呼ば
れているが、この2値化が行われれば画像の座標データ
から、長さ、面積等種々の形状量がコンピュータで計算
される。
Generally, in image processing, an analog signal of an object is input through a camera, and the analog signal is converted into a digital signal by an A/D converter. That is, an image is divided into hundreds by hundreds of pixels, and the coordinates of each pixel and color information for analog signals are captured as digital signals. This digital signal is processed by a computer to perform shape measurement, morphological classification, etc. In shape measurement, an object to be measured is expressed by a digital signal having a value corresponding to the density of a color, and this digital signal is classified into two types using the density of a certain color as a threshold, and an image of the object is specified. This is called binarization, and when this binarization is performed, various geometric quantities such as length and area are calculated by computer from the coordinate data of the image.

このように2値化さえできれば簡単に形状測定されるが
、実際には結晶粒や粉体等のカメラ久方画像では境界線
が不鮮明であったり、途切れ(欠落し)でいたりするこ
とが多い。また、雑音的なデータの混入のため、不必要
な画像が生成されることがある。従って、単純に2値化
すると隣接する対象物が接続され、2つの対象物が1つ
のものと判断される場合がある。このため画像を修正す
る必要があるが、その方法としてはライトペンやディジ
タイザ等で欠落した境界を書き込む方法や、または発明
者の発明にががる「画像処理による自動境界弁nji法
Jがある。後者の方法は2値化された時に接続された対
象物の輪郭座標の曲率がら候補点が選定され、2候補点
間の距離と位置関係から接続の是非が判定される方法で
ある。
As long as it can be binarized in this way, it is easy to measure the shape, but in reality, in camera images of crystal grains and powder, the boundary lines are often unclear or broken (missing). . Furthermore, unnecessary images may be generated due to the inclusion of noise-like data. Therefore, when simply binarizing, adjacent objects are connected, and two objects may be determined to be one. For this reason, it is necessary to correct the image, but there are two ways to do this: write in the missing boundaries with a light pen or digitizer, or the ``automatic boundary valve method using image processing'' invented by the inventor. In the latter method, candidate points are selected based on the curvature of the contour coordinates of objects connected when they are binarized, and whether or not the connection is appropriate is determined based on the distance and positional relationship between the two candidate points.

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

上記従来技術の内、ライトペンやディジタイザ等で書き
込む方法では操作者に専門的知識が必要であり、操作者
の負担が大きい。
Among the above-mentioned conventional techniques, the method of writing with a light pen, digitizer, etc. requires specialized knowledge on the part of the operator, which places a heavy burden on the operator.

自動境界分離方法では処理が自動化されているため、操
作者の負担はほとんど解消されるが、数値計算で機械的
に自動化されていて、専門的知識が十分に反映されてお
らず、精度が充分ではなかった・ 本発明の課題は、2値化画像中の画像の欠落部分や雑音
的な画像の不必要な部分を専門的な知識をもつ人手を要
することなく、自動的に専門家の知識に基づいて修復、
消去を行うにある。
Since the automatic boundary separation method automates the processing, most of the burden on the operator is eliminated, but it is mechanically automated using numerical calculations, does not fully reflect professional knowledge, and is not accurate enough. The problem of the present invention is to automatically detect missing parts in a binarized image and unnecessary parts of a noisy image using the knowledge of an expert, without requiring manual labor with specialized knowledge. repair based on,
It's in Erase.

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

上記の課題は、2値化して作成された画像から不必要な
部分の消去及びまたは欠落した画像の修復を行なう画像
処理方法に、前記部分の面積と、前記部分の周囲長と面
積の比と、を算出し、前記面積と前記比に対応して予め
定められた関数に基づいて前記部分が、不必要な部分か
どうかを判定する手順を備えることにより達成される。
The above-mentioned problem arises in an image processing method for erasing unnecessary parts and/or restoring missing images from an image created by binarization. , and determines whether the portion is an unnecessary portion based on a predetermined function corresponding to the area and the ratio.

上記の課題は、また、2値化して作成された画像から不
必要な部分の消去及びまたは欠落した画像の修復を行な
う画像処理方法に、前記欠落部分の両端間の距離と、前
記両端を結ぶ線と前記欠落部分の一端の進行方向とがな
す角と、前記両端が接続されて形成される閉曲線内の面
積と、前記両端が接続されていない状態で形成されてい
る閉曲線内の前記欠落部分を含む区域の長径と短径の比
と、が算出され、前記欠落部分の両端間の距離と、前記
両端を結ぶ線と前記欠落部分の一端の進行方向とがなす
角と、前記両端が接続されて形成される閉曲線内の面積
と、前記両端が接続されていない状態で形成されている
閉曲線内の前記欠落部分を含む区域の長径と短径の比と
、に夫々対応して予め定められている関数に基づいて、
前記欠落部分の修復の要否が判定される手順を備えるこ
とによっても達成される。
The above problem also requires an image processing method for erasing unnecessary parts and/or restoring missing images from an image created by binarizing. The angle formed by the line and the traveling direction of one end of the missing portion, the area within the closed curve formed by connecting both ends, and the missing portion within the closed curve formed when both ends are not connected. The ratio of the major axis to the minor axis of the area including the missing part is calculated, and the distance between the two ends of the missing part, the angle formed by the line connecting the two ends and the direction of movement of one end of the missing part, and the connection between the two ends. and the ratio of the major axis to the minor axis of the area including the missing part in the closed curve formed with the two ends not connected, respectively. Based on the function
This can also be achieved by providing a procedure for determining whether or not the missing portion needs to be repaired.

上記の課題はさらに、欠落部分の両端間の2値化のしき
い値が変えられて2値化演算が行われ、該両端間の画素
数と画像部分となる画素数の比が算出され、該比に対応
してあらかじめ定められた関数が、欠落部分の修復の要
否の判定に加味されることを特徴とする請求項2に記載
の画像処理方法によっても達成される。
The above problem is further solved by performing a binarization operation by changing the binarization threshold between both ends of the missing part, and calculating the ratio of the number of pixels between the ends and the number of pixels forming the image part. This is also achieved by the image processing method according to claim 2, characterized in that a predetermined function corresponding to the ratio is taken into consideration in determining whether or not the missing portion needs to be repaired.

また、予め定められる関数のなかの少なくとも二つが、
メンバシップ関数であることを特徴とする請求項1,2
もしくは3に記載の画像処理方法によっても上記の課題
は達成される。
Furthermore, at least two of the predetermined functions are
Claims 1 and 2 characterized in that it is a membership function.
Alternatively, the above problem can also be achieved by the image processing method described in 3.

〔作用〕[Effect]

対象物の画像の形状には、対象によって特有の共通性が
みられる。画像部分の面積と、該画像部分の周囲長/面
積に基づき、前記共通性の有無が専門家の知見を表現す
る関数により判定され、不必要な部分として消去するか
どうかが自動的に決定され処理される。
There are commonalities in the shapes of images of objects depending on the object. Based on the area of the image part and the perimeter/area of the image part, the presence or absence of the commonality is determined by a function expressing expert knowledge, and it is automatically determined whether to delete it as an unnecessary part. It is processed.

2値化画像の中間部分が欠落しているかどうかは、その
部分の長さの大小、その部分が接続されたときに出来る
閉曲線内の部分の面積の大小と前記形状の共通性との関
係、前記中間部分の両端が接続されたとき、該接続部分
の形状が不自然でないかどうか、前記中間部分が接続さ
れなかった場合の形状に不自然さはないか、などの項目
についての専門家の知見が表現されたあらかじめ定めら
れた関数によって判定されるので、画像処理実施各個々
の知識によって行われることはなく、自動的に処理され
る。
Whether the middle part of the binarized image is missing is determined by the relationship between the length of the part, the area of the closed curve formed when the parts are connected, and the commonality of the shape. Experts on matters such as whether the shape of the connected portion is natural when both ends of the intermediate portion are connected, and whether the shape is unnatural when the intermediate portion is not connected. Since the knowledge is determined by expressed predetermined functions, the image processing implementation is not performed by each individual knowledge, but is processed automatically.

〔実施例〕〔Example〕

第8図は、本発明が適用された、境界判別殴能を有する
全屈結晶粒形状測定のための画像処理のフローを、第9
図はそのフローを実施するための画像処理装置のハード
ウェア構成を、それぞれ示している。図に示す画像処理
装置は、対象物の光学像を生成する顕微鏡101と、該
顕微鏡101に袋層され、前記光学像を、アナログ信号
に変換するカメラ102と、該カメラ102に接続され
FIG. 8 shows the flow of image processing for measuring the shape of a fully curved crystal grain having boundary discrimination ability, to which the present invention is applied.
The figures each show the hardware configuration of an image processing device for implementing the flow. The image processing apparatus shown in the figure includes a microscope 101 that generates an optical image of an object, a camera 102 that is attached to the microscope 101 and converts the optical image into an analog signal, and is connected to the camera 102.

前記アナログ信号をディジタル信号に変換するA/Dコ
ンバータ103と、該A/Dコンバータ103に接続さ
れた共通回線116と、該共通回線116に、G P 
−I B (General Purpose I n
t。
An A/D converter 103 that converts the analog signal into a digital signal, a common line 116 connected to the A/D converter 103, and a G P
-I B (General Purpose I n
t.

−erface Bus) 112を介して接続された
ホストコンピュータ113と、該ホストコンピュータ1
13に、それぞれ接続されたファジーコントローラ11
4およびディジタイザ115と、前記共通回線116に
接続されたコントロールプロセッサ104、CPUメモ
リ105、イメージコントローラ106および計測用ロ
ム107と、前記イメージコントローラ106に接続さ
れたイメージプロセッサ108、イメージメモリA10
9A、イメージメモリ8109B、イメージメモリCl
09CおよびイメージメモリD109Dと、前記共通回
線116を介して、前記イメージメモリA〜Dに接続さ
れたD/Aコンバータ110A〜110Dと、該D/A
コンバータ110A〜11oDに接続された512X4
80画素のカラーデイスプレー111と、を値えている
。前記共通回線116は、前記イメージプロセッサ10
8にも接続されている。カラーデイスプレー111の各
画素はRGB (赤、緑、青)の3色をそれぞれ256
段階に分けた階調表示が可能としてあり、カラー情報は
、これらRGBの組み合せにより決定されるとともに、
そのデータはディジタル値として、イメージメモリA−
Dに格納される。
-erface Bus) 112, and the host computer 1
Fuzzy controllers 11 connected to 13 and 13 respectively.
4 and a digitizer 115, a control processor 104, a CPU memory 105, an image controller 106, a measurement ROM 107 connected to the common line 116, an image processor 108 connected to the image controller 106, and an image memory A10.
9A, image memory 8109B, image memory Cl
09C and image memory D109D, D/A converters 110A to 110D connected to the image memories A to D via the common line 116, and the D/A
512X4 connected to converter 110A~11oD
It has an 80-pixel color display 111. The common line 116 connects the image processor 10
8 is also connected. Each pixel of the color display 111 has 256 colors each of RGB (red, green, blue).
It is possible to display gradations divided into stages, and color information is determined by the combination of these RGB,
The data is stored as a digital value in the image memory A-
It is stored in D.

上記構成の画体処理装置では、画像処理の対象は、顕微
m 101により例えば、第10図に模式図として示さ
れているような入力画像(光学像)としてカメラ102
に入力され、該光学像がカメラ102により電気的なア
ナログ信号に変換される。カメラ102からアナログ信
号として出力される画像信号は、A/Dコンバータ10
3でRGB3色それぞれ256階調のディジタル信号に
変換され、イメージメモリA−Dに格納されたのちホス
トコンピュータ113で処理される。
In the image processing apparatus having the above configuration, the object of image processing is performed by the camera 102 as an input image (optical image) as shown schematically in FIG.
The optical image is converted into an electrical analog signal by the camera 102. The image signal output as an analog signal from the camera 102 is sent to the A/D converter 10.
3, each of the three RGB colors is converted into a digital signal of 256 gradations, stored in the image memories A to D, and then processed by the host computer 113.

まず、2値化処理について述べる。RGBa色の内のい
ずれか一色が選定され、256階調のうちのある範囲が
11111、その他の範囲がIt OItに定められる
。ここでは、第10図に示される金属組織のフェライト
粒(線で囲まれた部分)の形状測定をする場合を例にと
って説明し、第10図の、結晶粒界に相当する黒い部分
をパ1′″とする。前述のように、RGBのうちの一色
、ここではRが選定され、256階調のうちの暗い部分
である階調O〜130の範囲をパ1′″とした。この操
作は、イメージメモリの中でRの情報が取り出され、ホ
ストコンピュータ113から、Rの130以上に相当す
る画素を識別する命令がCPUに送られ、Rの130以
下の画素のデータは、R:128、G=O1B=Oに、
その他の画素のデータは、R=0、G=O1B=Oに置
きかえられる6R=0、G=O1B=Oはデータがオフ
であることを示し、これらデータは2値化されたとき′
″OIIとなる。
First, the binarization process will be described. One of the RGBa colors is selected, and a certain range of 256 gradations is defined as 11111, and the other range is defined as It OIt. Here, we will explain the case of measuring the shape of ferrite grains (area surrounded by lines) in the metal structure shown in Fig. 10 as an example. As mentioned above, one color of RGB, R in this case, is selected, and the range of gradations O to 130, which is the dark part of the 256 gradations, is set as Pa1'''. In this operation, R information is retrieved from the image memory, a command is sent from the host computer 113 to the CPU to identify pixels corresponding to 130 or more of R, and data of R pixels of 130 or less is :128, G=O1B=O,
The data of other pixels are replaced with R=0, G=O1B=O. 6R=0, G=O1B=O indicates that the data is off, and when these data are binarized, '
``It becomes OII.

次いで置きかえられたデータが、D/Aコンバータll
0A〜110Dを介してカラーデイスプレー111に表
示される。そのあとは、Rのイメージメモリだけが使用
され、R:128の部分とR=0の部分の情報だけで処
理される。第11図は第10図の画像が上記の方法で2
値化された例であるが、粒界(黒い線の部分)が途中で
とぎれた部分や、また、結晶粒内で独立した黒い部分(
粒内炭化物やよごれ)が含まれている。
The replaced data is then transferred to the D/A converter.
It is displayed on the color display 111 via 0A to 110D. After that, only the image memory of R is used, and only the information of the R:128 part and the R=0 part is processed. Figure 11 shows that the image in Figure 10 is 2
This is an example where the grain boundary (black line part) is interrupted, or an independent black part (black line part) within the crystal grain.
Contains intragranular carbides and dirt).

これらの粒界のとぎれた部分(欠落部分、以下同じ)の
接続や、不要な部分である前記独立した黒い部分の消去
が、専門的知識をメンバシップ関数化し、ファジー推論
によって行われる。第12図は、ファジー推論により、
第11図に示された画像から、不要部分が消去されると
ともに、欠落していた粒界が接続された図である。第1
2図のように粒界が明確化されれば、そのあと、II 
I IIの部分(図の黒い部分)が′0″に、“0″の
部分(図の白い部分)が11117に反転されて第13
図に示されるように結晶粒が表示される。結晶粒が第1
3図にように表示されると、その画素の座標データがホ
ストコンピュータで処理され、対象物(結晶粒)の面積
、水平、垂直軸投影径、最大径、!大径の方向角、周囲
長等の形状測定が可能となる。
Connecting these broken portions (missing portions, hereinafter the same) of grain boundaries and erasing the independent black portions, which are unnecessary portions, are performed by converting specialized knowledge into membership functions and using fuzzy inference. Figure 12 shows that by fuzzy inference,
This is a diagram in which unnecessary portions have been deleted from the image shown in FIG. 11 and missing grain boundaries have been connected. 1st
Once the grain boundaries are clarified as shown in Figure 2, then II
I The II part (black part in the figure) is inverted to '0'', the "0" part (white part in the figure) is inverted to 11117, and the 13th
Crystal grains are displayed as shown in the figure. The crystal grain is the first
When displayed as shown in Figure 3, the coordinate data of that pixel is processed by the host computer, and the area, horizontal and vertical axis projected diameter, maximum diameter, etc. of the object (crystal grain) are calculated. It is possible to measure the shape of large diameters, such as direction angle and circumference.

次に本発明が適用された粒界の接続(欠落部分)判定方
法の一実施例について説明する。この方法は、イメージ
メモリ上の情報に基づくホストコンピュータの演算と、
ホストコンピュータに組みこまれたファジーコントロー
ラでの推論とを含んでおり、第1図は本方法の手順を示
すフローチャートである。まず2値画像から粒内炭化物
やよごれによる孤立点が不必要な部分として消去される
Next, an embodiment of a grain boundary connection (missing portion) determination method to which the present invention is applied will be described. This method involves a host computer's calculations based on information on the image memory, and
FIG. 1 is a flowchart illustrating the steps of the method. First, isolated points due to intragranular carbides and dirt are erased from the binary image as unnecessary parts.

この消去は、二値画像のうちの、値が111 IIであ
る部分(第11図で黒く表現されている部分)の面積と
その周囲長に基づいて行われる。孤立点の場合には、面
積が比較的小さく、粒界の一部分である場合に比べ、周
囲長/面積の比が、小さい。
This erasure is performed based on the area and perimeter of the portion of the binary image whose value is 111 II (the portion expressed in black in FIG. 11). In the case of an isolated point, the area is relatively small, and the ratio of perimeter/area is smaller than in the case of a part of a grain boundary.

従って、第2図に示されるように、確信度(孤立点であ
ると確信される度合)を縦軸にとり、横軸に面積および
周囲長/面積(実際には無次元化するため(周囲長)2
/(面積・4π)とされており1円の場合に最少値の1
となる)をとって、メンバシップ関数が設定される。こ
のメンバシップ関数は、孤立点は面積がある程度小さく
、(周囲長)2/(面積・4?c)が小さい(当該領域
が細長くない)という専門家の知識に基づいている。
Therefore, as shown in Figure 2, the vertical axis shows the confidence level (the degree to which it is believed that it is an isolated point), and the horizontal axis shows the area and perimeter/area (actually, to make it dimensionless (perimeter )2
/(area・4π), and in the case of 1 yen, the minimum value is 1
), the membership function is set. This membership function is based on the expert's knowledge that an isolated point has a somewhat small area and (perimeter) 2/(area·4?c) is small (the area is not elongated).

このメンバシップ関数が前件部(第2図の左半部)と呼
ばれる。上記前件部に加えて、孤立点である確率を横軸
にとり、前記確信度を縦軸にとったメンバシップ関数が
後件部として設定される(第2図の右半部)。面積(第
11図で黒く表現されている部分)の測定値(ホス1−
コンピュータによる算出値)がSl、(周囲長)2/(
面積・4π)の算出値がR1とすると、前件部で、S、
、R,に対する確信度に、mがそれぞれ求まる。前件部
で求まった確信度に、m、が後件部の確信度を示す線a
、bにそれぞれ乗算され、線a、bが線ab′に変更さ
れる。つまり、後件部の確信度の値が全体にに、m、が
乗算された値に低下し、第3図右手部上、中に示す斜線
部の形状(台形)が求まる。次いで前記2つの台形が、
第3図右下図のように確信度0を示す辺と、孤立点であ
る確率が・1である辺とをそれぞれ一致させて重ねられ
、両図形の重心を合成した重心Gが求められる。求めら
れた重心Gの位置に基づき、該重心Gの位置に対応する
確信度および孤立点である確率が第3c図上で求められ
る。本実施例においては、ある領域に対し孤立点である
確率が0.5以上で、確信度が0.2以上の場合を当該
領域が孤立点であると判定すれば妥当であった。
This membership function is called the antecedent part (left half of FIG. 2). In addition to the antecedent part, a membership function in which the probability of being an isolated point is taken on the horizontal axis and the certainty is taken on the vertical axis is set as the consequent part (right half of FIG. 2). Measured value of area (black area in Figure 11)
(value calculated by computer) is Sl, (perimeter)2/(
If the calculated value of area・4π) is R1, then in the antecedent part, S,
, R, respectively. In addition to the certainty obtained for the antecedent part, m is a line a indicating the certainty of the consequent part.
, b are respectively multiplied, and lines a and b are changed to line ab'. In other words, the confidence value of the consequent is reduced to the value multiplied by m as a whole, and the shape (trapezoid) of the hatched part shown in the upper right part of FIG. 3 is determined. Then, the two trapezoids are
As shown in the lower right diagram of FIG. 3, a side with a confidence level of 0 and a side with a probability of being an isolated point of -1 are matched and overlapped, and the center of gravity G is obtained by combining the centers of gravity of both shapes. Based on the determined position of the center of gravity G, the confidence and probability of being an isolated point corresponding to the position of the center of gravity G are determined on FIG. 3c. In this embodiment, it is appropriate to determine that a region is an isolated point when the probability of the region being an isolated point is 0.5 or more and the confidence is 0.2 or more.

次に2値画像上で黒く表現されている粒界がとぎれてい
る個所を探索し、その部分を接続する。
Next, locations where grain boundaries are interrupted, which are expressed in black on the binary image, are searched for and connected.

前述のように、画像は512X480の画素で構成され
ており、その一部が第4図に示されている形状であると
する。図の四角の枠がそれぞれひとつの画素を示し、か
つ黒枠で囲まれ、数字が記入されている画素が、第11
図で黒く表現されている領域である。この領域内の任意
の画素1(ここでは、数字1が記入されている画素)を
起点としてその周囲の前記領域内の画素が探索される。
As mentioned above, it is assumed that the image is composed of 512×480 pixels, and a portion of the image has the shape shown in FIG. Each square frame in the figure represents one pixel, and the pixel surrounded by a black frame and with a number written in it is the 11th pixel.
This is the area expressed in black in the figure. Starting from an arbitrary pixel 1 in this area (here, the pixel on which the number 1 is written), surrounding pixels in the area are searched.

画素1に隣接する画素は最大8個であるが、第4図にお
いては画素1の左下は領域に含まれないので、画素1に
隣接する画素2は7個である0次に画素2の集団に隣接
する、画素1、画素2でない画素が探索され、これが画
素3の集団となる。この探索作業が繰返えされ、ある画
素に隣接する次の画素がみつからない場合、該ある画素
(第4図では画素12)がとぎれた点(欠落部分の一端
)になる。なお、この方法では、1回で1つのとぎれた
点しか探索できないので、1回目の画素を除いて数回繰
返えされる。
There are a maximum of eight pixels adjacent to pixel 1, but in Figure 4, the lower left of pixel 1 is not included in the area, so there are seven pixels 2 adjacent to pixel 1. Pixels adjacent to pixel 1 and pixel 2 that are not pixel 1 and pixel 2 are searched, and these become a group of pixels 3. When this search operation is repeated and the next pixel adjacent to a certain pixel is not found, the certain pixel (pixel 12 in FIG. 4) becomes a broken point (one end of the missing part). Note that with this method, only one broken point can be searched at one time, so the search is repeated several times, excluding the first pixel.

とぎれた点が探索された後に接続の判定が、ファジー推
論を用いて行われる。接続の判定に用い。
After the broken points are searched, a determination of connectivity is made using fuzzy inference. Used to determine connection.

られる情報は、先に探索されたとぎれた点のなかの欠落
部分の両端をなす任意の2点間の画素数で表された距離
、前記任意の2点のそれぞれが進んでいる方向がなす角
度、該2点が接続されたときにできる閉曲線で囲まれる
部分の面積及び接続されなかったときの閉曲線(2値化
された状態ですでに形成されている閉曲線)に囲まれる
部分の縦横比である。とぎれた点の進んでいる方向は、
種々検討の結果、当該とされた点が探索されたときの最
終番号(例えば第4図の12)から5つ手前の番号の画
素集団の内、とぎれた点に最も近い画素(第4図の■)
ととぎれた点の画素(第4図の12)とを結ぶ線の方向
として定義するのが、妥当であり、そのように定義され
た。
The information obtained is the distance expressed in number of pixels between two arbitrary points that form both ends of the missing part among the broken points searched earlier, and the angle formed by the direction in which each of the two arbitrary points is moving. , the area of the part surrounded by the closed curve formed when the two points are connected, and the aspect ratio of the part surrounded by the closed curve (the closed curve already formed in the binarized state) when they are not connected. be. The direction in which the broken point is moving is
As a result of various studies, we found that the pixel closest to the broken point (in Fig. 4) is selected from among the pixel group with the number 5 before the final number (for example, 12 in Fig. 4) when the relevant point was searched. ■)
It is appropriate to define it as the direction of the line connecting the pixel at the interrupted point (12 in FIG. 4), and it was defined as such.

前記4つの情報を横軸に、確信度(前記2点が接続され
るのが正しいという確信の度合)を縦軸にとって第5A
図〜第5D図左半部に示される4個のメンバシップ関数
が設定され、これらが前件部を形成する。さらに前記4
個のメンバシップ関数に対応して、縦軸に確信度を、横
軸に前記2点間の接続の確率をとった計4個のメンバシ
ップ関数が設定され、これらが後件部を形成する。
5A, with the four pieces of information on the horizontal axis and the confidence level (the degree of confidence that the two points are correctly connected) on the vertical axis.
Four membership functions shown in the left half of FIGS. 5D to 5D are set, and these functions form the antecedent part. Furthermore, the above 4
A total of four membership functions are set, with the vertical axis representing the confidence and the horizontal axis representing the probability of connection between the two points, and these form the consequent. .

以下、前件部の4個のメンバシップ関数につき説明する
The four membership functions of the antecedent part will be explained below.

とぎれた2点間の接続を認めるには、該2点間の距離が
ある程度、小さいことが必要であり、この長さの条件が
一方の変数を画素数で表わされた2点間の長さとした第
1のメンバシップ関数として設定されている。第5A図
左半部のグラフでは長さ100以上は、確信度0としで
ある。また、とぎれた点における2点それぞれが進んで
いる方向がほぼ一致している必要があり、この方向と前
記2点を結ぶ直線とがなす角度(第6図における角度θ
)が小さいことという条件が第2のメンバシップ関数と
して設定されている。尚、第5B図では、角度θが45
度以上の場合は、確信度0である。次に2点が接続され
たときにできる閉曲線で囲まれた部分の面積が極端に小
さい場合には、結晶粒とは見なせない、そこで、対象の
2点が接続された場合の閉曲線で囲まれる部分の面積が
算出され、その面積が極端に小さくないという条件を示
す第3のメンバシップ関数が設定されている。
In order to recognize a connection between two broken points, the distance between the two points must be small to a certain extent, and this length condition makes one variable the length between the two points expressed in the number of pixels. is set as the first membership function. In the graph in the left half of FIG. 5A, lengths of 100 or more are considered to have a confidence level of 0. In addition, the directions in which the two points at the broken points are moving must be almost the same, and the angle formed by this direction and the straight line connecting the two points (angle θ in Figure 6) is required.
) is small is set as the second membership function. In addition, in FIG. 5B, the angle θ is 45
If the value is greater than or equal to 100 degrees, the confidence level is 0. Next, if the area of the part surrounded by the closed curve formed when two points are connected is extremely small, it cannot be considered a crystal grain, so it is surrounded by the closed curve formed when the two points are connected. A third membership function is set that indicates the condition that the area is not extremely small.

ここでいう面積は、第11図で、白く表現されている部
分の面積であり、1” (R:128.G:0、B:O
)の画素で囲まれた“0” (R:O。
The area referred to here is the area of the white part in Figure 11, which is 1" (R: 128.G: 0, B: O
) “0” surrounded by pixels (R:O.

G:O,B:O)の画素の数で表現される。最後に対象
の2点が接続されなかった場合の閉曲線の形の妥当性で
あるが、結晶粒は極端に細長いものはないという、専門
家の知見に基づき、接続されなかったときの閉曲線の形
が極端に細長い場合には、前記2点間が接続される確率
が高い。そこで、接続しなかった場合の閉曲線に囲まれ
る部分の最大長さ(以下、′長径という)と、該最大長
さの方向に垂直な方向の前記閉曲線に囲まれた部分の最
大長さ(以下、短径という)の比(縦横比)が算出され
、該比に対して接続した方が妥当かどうかを示す第4の
メンバシップ関数が設定されている。
It is expressed by the number of pixels (G:O, B:O). Finally, regarding the validity of the shape of the closed curve when the two points of interest are not connected, based on the knowledge of experts that crystal grains are not extremely elongated, the shape of the closed curve when the two points are not connected is determined. If it is extremely long and narrow, there is a high probability that the two points will be connected. Therefore, the maximum length of the part surrounded by the closed curve when not connected (hereinafter referred to as 'major axis') and the maximum length of the part surrounded by the closed curve in the direction perpendicular to the direction of the maximum length (hereinafter referred to as 'major axis') , short axis) is calculated, and a fourth membership function is set that indicates whether it is appropriate to connect based on the ratio.

第5A図〜第5D図の各左半部のグラフは上記4個の前
件部メンバシップ関数を表わし、まず、第11図に示さ
れる2値画像に基づいて、上記グラフの横軸の数値が算
定される0次いで、それぞれのメンバシップ関数に従っ
て前件部の確信度が。
The graphs in the left half of each of FIGS. 5A to 5D represent the four antecedent membership functions. First, based on the binary image shown in FIG. is calculated as 0, then the confidence of the antecedent according to the respective membership function.

算定され、算定されたそれぞれの確信度に基づいて、対
応する後件部の確信度を示すグラフの形が変化させられ
る0例えば、第5A図の場合、前件部で算定された確信
度がpであれば、後件部の確信度を示すグラフeの値に
前記Pが乗算され、グラフe′となる。他のメンバシッ
プ関数についても同様の演算が行われ、得られたグラフ
e′f/ 、 gl 、hlの図形が、第5E図に示さ
れるように、重ね合せられる。重ね合せられたそれぞれ
の図形の重心が合成されて重ね合された図形全体の重心
Gが算出され、該重心Gの位置から、合成された確信度
Qaおよび接続の確率Paが算出される0発明者の試算
及び専門家の知見に基づくと、合成された接続の確率が
0.6以上、確信度0゜2以上の場合、対象の2点間は
接続されるのが正しい。第12図は、第11図に示され
る2値画像に対し、上述の手順により、結晶粒内の孤立
点の消去及び結晶粒界のとぎれた個所の接続が行われた
結果を模式的に示している。
The shape of the graph showing the certainty of the corresponding consequent is changed based on each calculated certainty.0 For example, in the case of Figure 5A, the certainty calculated for the antecedent is changed. If p, the value of the graph e indicating the certainty of the consequent part is multiplied by the P, resulting in a graph e'. Similar operations are performed for other membership functions, and the resulting graphs e'f/, gl, and hl are superimposed as shown in FIG. 5E. The centroids of the respective superimposed figures are synthesized to calculate the centroid G of the entire superimposed figure, and from the position of the centroid G, the synthesized certainty factor Qa and probability of connection Pa are calculated. Based on the calculations of individuals and the knowledge of experts, if the probability of a synthesized connection is 0.6 or more and the confidence is 0.2 or more, it is correct that the two points of interest are connected. FIG. 12 schematically shows the results of eliminating isolated points within crystal grains and connecting broken portions of grain boundaries using the above-described procedure for the binary image shown in FIG. 11. ing.

第12図に示される画像に対して形状の計Jllが行わ
れるが、形状の計測(本実施例の場合、結晶粒の形状の
計測)は、図の黒い部分に囲まれた白い部分(画素の値
f# OIIの部分)が対象であり、データの取扱い上
、R:Oの部分が111 IIに、R128の部分がI
I OIIにされ、画像が反転された第13図に示され
る画像状態で行われる。
Shape measurement Jll is performed on the image shown in FIG. The value f# (OII part) is the target, and due to data handling, the R:O part is 111 II, and the R128 part is I
IOII and the image is inverted in the image state shown in FIG. 13.

上記実施例においては、画像の2値化が、階調データR
: 130以下の画素を“1″として行われたが、2値
化の画像(第11図)ではとぎれている部分が2値化さ
れる前の画像では、イメージデータの値がR:130を
こえる画素でつながっている場合があり得る。このこと
を考慮に入れ、接続判定時に、二値化前の画像において
、接続判定対象の2点間に線が薄く見えるという条件の
メンバシップ関数を追加してもよい、これは、2値化後
の画像のとぎれた2点間の画素に対して、2値化すると
きのしきい値を階調区分で20だけ、階調が薄くなる側
へ移したとき、11111となる画素の割合が算出され
、該割合が多いほど、確信度が1に近ずくメンバシップ
関数である。第7図はこのメンバシップ関数の前件部お
よび後件部を示し、第5A図〜第5D図に示されたメン
バシップ関数に加えて、同様に算出され、第5E図の重
心算出に加算される。この第5のメンバシップ関数を加
えて接続判定されることにより、接続判定の精度がさら
に向上する。
In the above embodiment, the binarization of the image is performed using the gradation data R
: Pixels of 130 or less were set as "1", but in the binarized image (Figure 11), the discontinuous part of the image before binarization shows that the image data value is R:130. There may be cases where the pixels are connected by more than one pixel. Taking this into consideration, a membership function may be added that provides a condition that the line between the two points to be determined is thin in the image before binarization when determining the connection. For the pixels between two broken points in the subsequent image, when the threshold value for binarization is shifted by 20 to the side where the gradation becomes lighter, the percentage of pixels that becomes 11111 is It is a membership function in which the confidence level approaches 1 as the ratio increases. Figure 7 shows the antecedent and consequent parts of this membership function, which are calculated in the same way in addition to the membership functions shown in Figures 5A to 5D, and added to the center of gravity calculation in Figure 5E. be done. By adding this fifth membership function to the connection determination, the accuracy of the connection determination is further improved.

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

本発明によれば、2値化画像からの専門的知識を反映し
た不必要部分の消去や、欠落部分の自動修復が可能とな
るため1機械的な数値計算による場合よりも、消去、修
復の精度が向上し、かつ、所要工数も低減される。
According to the present invention, it is possible to erase unnecessary parts from a binarized image based on expert knowledge and to automatically repair missing parts. Accuracy is improved and the required man-hours are also reduced.

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

第1図は本発明に係る画像処理方法の実施例を示すフロ
ーチャート、第2A図および第2B図は、本発明に係る
2値化画像の不必要部分の消去に用いられるメンバシッ
プ関数の実施例を示すグラフ、第3A図〜第3C図は、
第2A図、第2B図に示されるメンバシップ関数の使用
例を示すグラフ、第4図は本発明に係る2値化画像の欠
落部分の探索方法の説明図、第5A図〜第5E図は本発
明に係る欠落部分の修復に用いられるメンバシップ関数
とその使用例を示すグラフ、第6図は2点(欠落部分の
両端)を結ぶ線と一端の進行方向とのなす角の説明図、
第7図は他のメンバシップ関数の例を示すグラフ、第8
図は画像処理による金属結晶粒の形状測定のためのフロ
ーチャート、第9図は画像処理による形状測定のための
ハードウェア構成例を示すブロック図、第10図は金属
組織の入力画像の例を示す模式図、第11図は第10図
の入力画像の単純2値化画像の模式図、第12図は第1
1図に示す2値化画像に本発明に係る不必要部分の消去
と欠落部分の修復処理が行オ〕れた結果を示す模式図で
、 第13図は第1 2図が形状側 定のために反転された画像を示す模式図である。
FIG. 1 is a flowchart showing an embodiment of the image processing method according to the present invention, and FIGS. 2A and 2B are examples of membership functions used for erasing unnecessary parts of a binarized image according to the present invention. The graphs shown in Figures 3A to 3C are
2A and 2B are graphs showing usage examples of the membership functions, FIG. 4 is an explanatory diagram of the method for searching for missing parts of a binarized image according to the present invention, and FIGS. 5A to 5E are A graph showing the membership function used for repairing the missing part according to the present invention and an example of its use, FIG. 6 is an explanatory diagram of the angle formed by a line connecting two points (both ends of the missing part) and the direction of movement of one end,
Figure 7 is a graph showing other examples of membership functions;
The figure is a flowchart for measuring the shape of metal crystal grains by image processing, Figure 9 is a block diagram showing an example of a hardware configuration for shape measurement by image processing, and Figure 10 is an example of an input image of a metal structure. Schematic diagram, Figure 11 is a schematic diagram of a simple binarized image of the input image in Figure 10, Figure 12 is a schematic diagram of the input image of Figure 1.
Figure 13 is a schematic diagram showing the result of the binarized image shown in Figure 1 being subjected to the process of erasing unnecessary parts and restoring missing parts according to the present invention. FIG.

Claims (1)

【特許請求の範囲】 1、2値化して作成された画像から不必要な部分の消去
及びまたは欠落した画像の修復を行なう画像処理方法に
おいて、前記部分の面積と、前記部分の周囲長と面積の
比と、を算出し、前記面積と前記比に対応して予め定め
られた関数に基づいて前記部分が、不必要な部分かどう
かを判定することを特徴とする画像処理方法。 2、2値化して作成された画像から不必要な部分の消去
及びまたは欠落した画像の修復を行なう画像処理方法に
おいて、前記欠落部分の両端間の距離と、前記両端を結
ぶ線と前記欠落部分の一端の進行方向とがなす角と、前
記両端が接続されて形成される閉曲線内の面積と、前記
両端が接続されていない状態で形成されている閉曲線内
の前記欠落部分を含む区域の長径と短径の比と、が算出
され、前記欠落部分の両端間の距離と、前記両端を結ぶ
線と前記欠落部分の一端の進行方向とがなす角と、前記
両端が接続されて形成される閉曲線内の面積と、前記両
端が接続されていない状態で形成されている閉曲線内の
前記欠落部分を含む区域の長径と短径の比と、に夫々対
応して予め定められている関数に基づいて、前記欠落部
分の修復の要否が判定されることを特徴とする画像処理
方法。 3、欠落部分の両端間の2値化のしきい値が変えられて
2値化演算が行われ、該両端間の画素数と画像部分とな
る画素数の比が算出され、該比に対応してあらかじめ定
められた関数が、欠落部分の修復の要否の判定に加味さ
れることを特徴とする請求項2に記載の画像処理方法。 4、予め定められる関数のなかの少なくとも二つが、メ
ンバシップ関数であることを特徴とする請求項1、2も
しくは3に記載の画像処理方法。
[Claims] An image processing method for erasing an unnecessary portion and/or restoring a missing image from an image created by 1. binarization, the area of the portion, and the perimeter and area of the portion. , and determining whether the portion is an unnecessary portion based on a predetermined function corresponding to the area and the ratio. 2. In an image processing method for erasing unnecessary parts and/or restoring missing images from an image created by binarizing, the distance between both ends of the missing part, a line connecting the both ends, and the missing part The angle formed by the traveling direction of one end, the area within the closed curve formed by connecting the two ends, and the major axis of the area including the missing part within the closed curve formed when the ends are not connected. and the ratio of the short axis are calculated, and the distance between both ends of the missing portion is formed by connecting the two ends to the angle formed by the line connecting the two ends and the traveling direction of one end of the missing portion. Based on a predetermined function that corresponds to the area within the closed curve and the ratio of the major axis to the minor axis of the area including the missing part in the closed curve that is formed with both ends not connected. An image processing method characterized in that it is determined whether or not the missing portion needs to be repaired. 3. A binarization operation is performed by changing the binarization threshold between both ends of the missing part, and the ratio of the number of pixels between the two ends and the number of pixels forming the image part is calculated, and the number of pixels corresponding to the ratio is calculated. 3. The image processing method according to claim 2, wherein the predetermined function is taken into consideration in determining whether or not a missing portion needs to be repaired. 4. The image processing method according to claim 1, 2 or 3, wherein at least two of the predetermined functions are membership functions.
JP1136587A 1989-05-30 1989-05-30 Picture processing method Pending JPH032983A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1136587A JPH032983A (en) 1989-05-30 1989-05-30 Picture processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1136587A JPH032983A (en) 1989-05-30 1989-05-30 Picture processing method

Publications (1)

Publication Number Publication Date
JPH032983A true JPH032983A (en) 1991-01-09

Family

ID=15178773

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1136587A Pending JPH032983A (en) 1989-05-30 1989-05-30 Picture processing method

Country Status (1)

Country Link
JP (1) JPH032983A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100461935B1 (en) * 1996-04-15 2005-04-19 베르트질레 슈바이츠 악티엔게젤샤프트 Solenoid valve
US8074384B2 (en) 2006-05-25 2011-12-13 Clover Mfg. Co., Ltd. Auxiliary tool for handcrafting

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100461935B1 (en) * 1996-04-15 2005-04-19 베르트질레 슈바이츠 악티엔게젤샤프트 Solenoid valve
US8074384B2 (en) 2006-05-25 2011-12-13 Clover Mfg. Co., Ltd. Auxiliary tool for handcrafting

Similar Documents

Publication Publication Date Title
US6404936B1 (en) Subject image extraction method and apparatus
US6774889B1 (en) System and method for transforming an ordinary computer monitor screen into a touch screen
JP4280729B2 (en) Irradiation field region extraction method and radiation imaging apparatus
CN110705583A (en) Cell detection model training method and device, computer equipment and storage medium
CN109523527A (en) The detection method in dirty region, device and electronic equipment in image
Benz et al. Crack segmentation on UAS-based imagery using transfer learning
CN111626295B (en) Training method and device for license plate detection model
JP2021196705A (en) Image processing system, image processing method and program
JPH10164370A (en) Method and device for interpolating gradation of image, image filtering method and image filter
JP4086956B2 (en) User-assisted identification of object boundaries in raster images
CN112116585B (en) Image removal tampering blind detection method, system, device and storage medium
CN113409271A (en) Method, device and equipment for detecting oil stain on lens
JP2002140713A (en) Image processing method and image processor
WO2009104325A1 (en) Line drawing processing device, program, and line drawing processing method
JPH032983A (en) Picture processing method
US5568565A (en) Handwriting input method and apparatus
CN115690431A (en) Bar code image binarization method and device, storage medium and computer equipment
JP2018197692A (en) Damage state processing system
CN114384073A (en) Crack detection method and system based on subway tunnel
JPH064669A (en) Pattern matching device for gradation picture
JPH07121713A (en) Pattern recognition method
JP2002203233A (en) Method and apparatus for inspection
JPH1153539A (en) Circular pattern discriminating method and storage medium
JPH08272971A (en) Object recognizing method
CN117456542B (en) Image matching method, device, electronic equipment and storage medium