JPH06150002A - Image segmenting method and shading correcting method - Google Patents
Image segmenting method and shading correcting methodInfo
- Publication number
- JPH06150002A JPH06150002A JP4302060A JP30206092A JPH06150002A JP H06150002 A JPH06150002 A JP H06150002A JP 4302060 A JP4302060 A JP 4302060A JP 30206092 A JP30206092 A JP 30206092A JP H06150002 A JPH06150002 A JP H06150002A
- Authority
- JP
- Japan
- Prior art keywords
- image
- threshold value
- segmentation method
- contour
- threshold
- 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 47
- 238000011156 evaluation Methods 0.000 claims abstract description 12
- 238000003709 image segmentation Methods 0.000 claims description 15
- 238000003705 background correction Methods 0.000 claims description 5
- 238000005520 cutting process Methods 0.000 claims description 5
- 238000003708 edge detection Methods 0.000 claims description 2
- 238000009499 grossing Methods 0.000 claims description 2
- 238000001914 filtration Methods 0.000 abstract 1
- 230000011218 segmentation Effects 0.000 abstract 1
- 230000006870 function Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 7
- 238000005286 illumination Methods 0.000 description 6
- 238000004364 calculation method Methods 0.000 description 5
- 238000000342 Monte Carlo simulation Methods 0.000 description 2
- 239000003086 colorant Substances 0.000 description 2
- 230000007423 decrease Effects 0.000 description 2
- 230000001419 dependent effect Effects 0.000 description 2
- 239000000284 extract Substances 0.000 description 2
- 238000000605 extraction Methods 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 238000004088 simulation Methods 0.000 description 2
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000002922 simulated annealing Methods 0.000 description 1
Landscapes
- Image Input (AREA)
- Image Processing (AREA)
- Facsimile Image Signal Circuits (AREA)
- Image Analysis (AREA)
Abstract
Description
【発明の詳細な説明】Detailed Description of the Invention
【0001】[0001]
【産業上の利用分野】本発明は、画像セグメンテーショ
ン方法、及び、画像中から文字などを抜き出す2値化の
方法に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image segmentation method and a binarization method for extracting characters from an image.
【0002】[0002]
【従来の技術】産業の各分野において、画像の認識,画
像のシミュレーションなどの画像を用いた応用が広く行
なわれている。例えば、工業用テレビの画像中から製造
されている部品を抜き出す、風景の画像の中から特定の
対象物を抜き出す等の処理が必要である。この処理を画
像セグメンテーションという観点で整理,分類すること
ができる。2. Description of the Related Art In various fields of industry, image-based applications such as image recognition and image simulation are widely used. For example, it is necessary to extract a manufactured part from an image of an industrial television, extract a specific object from an image of a landscape, and the like. This process can be organized and classified in terms of image segmentation.
【0003】この画像セグメンテーション技術は大きく
二つに分けられる。第一の方法はしきい値による識別で
あり、具体的には、i行j列画素の値をa(i,j)とし
たとき、それぞれの成分での最小最大のしきい値Σとし
たとき、次の範囲を切り出す。This image segmentation technique is roughly divided into two. The first method is identification by a threshold value. Specifically, when the value of the pixel in the i-th row and the j-th column is a (i, j), the minimum and maximum threshold value Σ for each component is set. When, cut out the following range.
【0004】a(i,j)<Σ (または、 a(i,j)>Σ) ただし、画像中に、照明のむらなどの偏りがある場合に
は、全画像に同一のしきい値を用いると切り出す形状に
歪みがでるので、しきい値を画像中の位置に依存させる
方法が用いられる。これについては、工業用画像処理,
昭晃堂,1988年刊の第27頁から第31頁に説明されて
いる(公知例1)。図6(a)では、座標軸601の上
に全面一定値のしきい値面602があり、図6(b)で
は、座標軸603の上に、場所に依存して変化するしき
い値面604が示されている。また、同じ公知例によれ
ば、画像によってしきい値を変更させる浮動型のしきい
値処理も行なわれている。ただし、こちらは、画像中で
のしきい値は一定である。A (i, j) <. SIGMA. (Or a (i, j)>. SIGMA.) However, if there is unevenness in the image such as uneven illumination, the same threshold value is used for all images. Since the shape to be cut out is distorted, a method of making the threshold value dependent on the position in the image is used. For this, industrial image processing,
It is described on pages 27 to 31 of Shokoido, 1988 (known example 1). In FIG. 6A, a threshold surface 602 having a constant value over the entire surface is provided on the coordinate axis 601, and in FIG. 6B, a threshold surface 604 that changes depending on the location is provided on the coordinate axis 603. It is shown. Further, according to the same publicly known example, floating type threshold value processing for changing the threshold value according to an image is also performed. However, here, the threshold value in the image is constant.
【0005】第2の方法は画像のエッジの情報、すなわ
ち、画像中の画素の値の変化する部分の情報を用いるも
のである。これらの方法は、画像中のシーンの理解や認
識のため研究されてきたものであるが、これについて
は、P.H.バラード他著,コンピュータ ビジョン,プ
レンティス ホール社刊(D.H.Ballard,C.B.Brown著Co
mputer Vision,Prentice-Hall,Inc.)(1982)第
4章 バウンダリ デテクション(Boundary Detectio
n)(以下、公知例2と呼ぶ)に述べられている。基本
的には、画像中の隣接する画素間の色や画像濃度の差の
大きい所をエッジとして求め、これをつなぐことにより
輪郭を求める。エッジを求めるために用いられるのは次
のようなものである。The second method uses the information of the edge of the image, that is, the information of the portion where the value of the pixel in the image changes. These methods have been studied for understanding and recognizing scenes in images, and are described by PH Ballard et al., Computer Vision, Prentice Hall, Inc. (DHBallard, CB Brown Co.
mputer Vision, Prentice-Hall, Inc. (1982) Chapter 4 Boundary Detectio
n) (hereinafter referred to as known example 2). Basically, a portion having a large difference in color or image density between adjacent pixels in an image is obtained as an edge, and the contour is obtained by connecting the edges. The following is used to find the edge.
【0006】白黒濃淡画像の場合、i,j画素をa
(i,j)で表す。i方向が横方向に、j方向が縦方向に
対応する。In the case of a monochrome gray-scale image, i, j pixels are set to a
It is represented by (i, j). The i direction corresponds to the horizontal direction and the j direction corresponds to the vertical direction.
【0007】(1)一次微分: 横方向:a(i+1,j)−a(i,j), 縦方向:a(i,j+1)−a(i,j), 絶対値:SQRT((a(i+1,j)−a(i,j))**
2+(a(i,j+1)−a(i,j))**2) など、ただしA**2はAの二乗、SQRT( )は平
方根を表わす。(1) First derivative: Horizontal direction: a (i + 1, j) -a (i, j), Vertical direction: a (i, j + 1) -a (i, j), Absolute value: SQRT ((a (i + 1, j) -a (i, j)) **
2+ (a (i, j + 1) -a (i, j)) ** 2), etc., where A ** 2 is the square of A and SQRT () is the square root.
【0008】(2)2次微分: 横方向:a(i+1,j)−2a(i,j)+a(i−
1,j), 縦方向:a(i,j+1)−2a(i,j)+a(i,
j−1), 両方向:a(i+1,j)+a(i−1,j)+a(i,j
+1)+a(i,j−1)−4a(i,j) など。(2) Second derivative: Lateral direction: a (i + 1, j) -2a (i, j) + a (i-
1, j), vertical direction: a (i, j + 1) -2a (i, j) + a (i,
j-1), both directions: a (i + 1, j) + a (i-1, j) + a (i, j
+1) + a (i, j-1) -4a (i, j) and so on.
【0009】(3)ゼロクロッシング 2次微分が正から負へ、あるいは、負から正へ変化する
点。位置以外に強度の情報を用いる場合には、その変化
の度合い(3次微分に相当する)を用いる。(3) Zero crossing A point at which the second derivative changes from positive to negative or from negative to positive. When the intensity information is used in addition to the position, the degree of change (corresponding to the third derivative) is used.
【0010】また、第1の方法と第2の方法の両者を併
用したものとして、白黒濃淡の画像に対して適用される
スーパースライス法がある。これについては、コンピュ
ータグラフィクス アンド イメージ プロセシング誌
(Computer Graphics andImage Processing)vol.1
1 pp.1−12(1979)に論じられている(公知例
3)。また、別冊OplusE「画像処理アルゴリズムの最
新動向」(1986)第14章III にも解説がある(公知
例4)。この方法は、基本的には第1の方法のしきい値
法であるが、そのしきい値を決めるのにエッジ情報を用
いる。具体的に説明すると、白黒濃淡画像の場合でしき
い値Σを決めるとする。画像の(i,j)画素をa
(i,j)として、a(i,j)>Σの場合の領域を切
り出す場合、切り出された領域の輪郭と、a(i,j)
からエッジ検出処理を行なった結果の一致度が最大にな
るΣを探索するのがスーパースライス法である。Further, as a combination of both the first method and the second method, there is a super slice method applied to a black and white image. About this, Computer Graphics and Image Processing vol.1
1 pp.1-12 (1979) (known example 3). There is also a commentary in Chapter 14 III, "Latest Trends of Image Processing Algorithms" (1986) in a separate volume OplusE (Prior Art Example 4). This method is basically the threshold method of the first method, but uses edge information to determine the threshold value. More specifically, it is assumed that the threshold value Σ is determined in the case of a grayscale image. Let (i, j) pixels of the image be a
When an area where a (i, j)> Σ is cut out as (i, j), the contour of the cut out area and a (i, j)
The super slicing method searches for Σ that maximizes the degree of coincidence as a result of edge detection processing.
【0011】[0011]
【発明が解決しようとする課題】上記従来技術で述べた
公知例には、それぞれ次にあげるような問題点がある。The known examples described in the above-mentioned prior art have the following problems.
【0012】公知例1では、しきい値処理を行なう対象
が様々で、かつ、照明のむらなどが画像により異なるよ
うな状況では良好な結果が得られないという問題点があ
る。In the known example 1, there is a problem that a good result cannot be obtained in a situation in which various objects are subjected to the threshold processing and the unevenness of illumination or the like varies depending on the image.
【0013】公知例2では、エッジ(画像中で、画素値
が急変するところ)がはっきりしている場合には有効で
あるが、単純に用いると、求めたい輪郭が切れたり、輪
郭と関係ない部分のエッジを拾ったりして困難な場合が
多い。In the second known example, it is effective when the edge (where the pixel value changes abruptly in the image) is clear, but if it is simply used, the desired contour is cut or has nothing to do with the contour. It is often difficult to pick up the edge of a part.
【0014】公知例3,4では、画像中で一定のしきい
値を用いるものであり、照明むらなどがある場合に対応
できない。In the known examples 3 and 4, a fixed threshold value is used in the image, and it is not possible to deal with uneven illumination.
【0015】本発明の目的は、照明むらなどにより、画
像中でのしきい値を場所により変化させる必要があり、
かつ、画像により異なるような場合にも、しきい値を自
動的に与える手段を提供することにある。また、求めら
れたしきい値を用いて、逆に濃淡むらの補正(いわゆる
シェーディング補正)を行なう手段を提供することにあ
る。The object of the present invention is to change the threshold value in the image depending on the location due to uneven lighting, etc.
Further, it is to provide a means for automatically giving a threshold value even when it varies depending on the image. Another object of the present invention is to provide a means for correcting uneven density (so-called shading correction) by using the obtained threshold value.
【0016】[0016]
【課題を解決するための手段】本発明では、上記目的を
達成するため、公知例3,4の方法で、画像中で一定と
していたしきい値に代わり、場所により変化するしきい
値面を導入するため、近接するしきい値の変化量という
新たな要素を考え、これと、従来公知例3,4で用いら
れていたエッジと輪郭の一致度と合わせて評価尺度と
し、これを最小とするしきい値面をもって2値化を行な
うものである。In order to achieve the above object, the present invention introduces a threshold plane that changes depending on the location in place of the threshold that was constant in the image by the method of known examples 3 and 4. For this reason, a new element called the amount of change in the threshold value that is close to is considered, and this is combined with the degree of coincidence between the edge and the contour used in the conventionally known examples 3 and 4, and the evaluation scale is set to the minimum. Binarization is performed with a threshold plane.
【0017】[0017]
【作用】場所に依存するしきい値をσ(i,j)とす
る。例えば、a(i,j)>σ(i,j)の領域を求め
るしきい値処理を考える。隣接するしきい値の変化量が
少ないという条件を表現する方法は各種あるが、例え
ば、数1で表現する。ただし、**2は平方をあらわ
す。## EQU2 ## The threshold value depending on the location is σ (i, j). For example, consider threshold processing for obtaining a region of a (i, j)> σ (i, j). There are various methods of expressing the condition that the amount of change in adjacent threshold values is small. However, ** 2 represents a square.
【0018】[0018]
【数1】 [Equation 1]
【0019】領域の輪郭は種々の方法で検出することが
できるが、最も典型的には、対象とする小領域のすべて
の画素に関して十字型の空間フィルタをかけることであ
る。すなわち、i,j画素が、代表色側、すなわち切り
だされる場合に、b(i,j)=1,逆に不要な場合にb
(i,j)=0とする。あるパラメータについて切りだ
し処理を行なった場合、すべての画素について、b
(i,j)が求まっている。十字型の空間フィルタと
は、次の数2の条件を満たすとき、その画素が輪郭であ
ると判定する。Region contours can be detected in a variety of ways, but most typically it is a cross-shaped spatial filter on all pixels of the small region of interest. That is, when the i, j pixel is on the representative color side, that is, when it is cut out, b (i, j) = 1, and conversely b when it is unnecessary.
Let (i, j) = 0. When cutout processing is performed for a certain parameter, for all pixels, b
(I, j) has been obtained. The cross-shaped spatial filter determines that the pixel is a contour when the condition of the following expression 2 is satisfied.
【0020】[0020]
【数2】(1)b(i,j)=1 かつ (2)b(i−1,j),b(i+1,j),b(i,j
−1),b(i,j+1) のなかに1と0が両方ある。## EQU2 ## (1) b (i, j) = 1 and (2) b (i-1, j), b (i + 1, j), b (i, j)
There are both 1 and 0 in -1) and b (i, j + 1).
【0021】ただし、画像の端の4辺上の画素について
は処理を行なわない。However, the processing is not performed for the pixels on the four sides of the edge of the image.
【0022】この後、公知例3,4のように、孤立点除
去などの処理を行なうこともあるが輪郭画像を用いるこ
とは大略同じである。Thereafter, as in known examples 3 and 4, processing such as isolated point removal may be performed, but the use of a contour image is almost the same.
【0023】次にエッジ画像であるが、公知例2で述べ
た方法等で作成することができる。すなわち、1次微分
の絶対値やゼロクロッシングをとることでエッジ画像が
作成できる。ゼロクロッシングを例に説明すると、i,
j画素がゼロクロッシングのときc(i,j)=1、そ
うでないときc(i,j)=0とする。このエッジ画像
を作成する前に、画像の平滑化を行なうことも余分な雑
音を拾わないため採用可能であり、また、エッジ画像に
孤立点除去や細線化の処理を行なうこともできる。Next, regarding the edge image, it can be created by the method described in the known example 2. That is, an edge image can be created by taking the absolute value of the first derivative or zero crossing. Taking zero crossing as an example, i,
When the j pixel has zero crossing, c (i, j) = 1, and otherwise c (i, j) = 0. It is possible to perform smoothing of the image before creating the edge image because it does not pick up extra noise, and it is also possible to perform isolated point removal or thinning processing on the edge image.
【0024】しきい値が、適切に選択されているときに
は、輪郭とエッジが一致する部分が多いはずである。そ
こで、輪郭とエッジの一致度を計算する。一致度は、絶
対値残差和,正規化相関値などがあり、それぞれ数3で
表わされる。When the threshold value is properly selected, there should be many portions where the contour and the edge match. Therefore, the degree of coincidence between the contour and the edge is calculated. The degree of coincidence includes a sum of absolute residuals, a normalized correlation value, and the like, each of which is represented by Equation 3.
【0025】[0025]
【数3】 [Equation 3]
【0026】ただし、sqrt( )は平方根の関数、X*
*2はXの平方、b*,c*はそれぞれ、bとcの平均
値を表わす。絶対値残差和は小さい程一致度がよく、正
規化相関は大きい程一致度がよい。また、添字を記入し
ていないΣは、画素に関する和(i,jに関する和)で
ある。Where sqrt () is a square root function, X *
* 2 is the square of X, and b * and c * are the average values of b and c, respectively. The smaller the absolute value residual sum, the better the degree of coincidence, and the larger the normalized correlation, the better the degree of coincidence. Further, Σ without a subscript is a sum for pixels (a sum for i, j).
【0027】この後、u,vを正定数として、最終的に
次のような評価関数を定義する。ここでは、2例を示
す。After that, u and v are positive constants, and the following evaluation function is finally defined. Two examples are shown here.
【0028】[0028]
【数4】E1=u・(隣接しきい値の変化度)−v・
(正規化相関値) あるいは、[Equation 4] E1 = u · (degree of change of adjacent threshold value) −v ·
(Normalized correlation value) Alternatively,
【0029】[0029]
【数5】E2=u・(隣接しきい値の変化度)+v・
(絶対値残差和) 第2項の符号の違いは、正規化相関値は一致度が良いほ
ど大きくなるのに対し、絶対値残差和は、逆に小さくな
るという理由による。なお、隣接しきい値の変化度も一
致度もここに述べたものに限られるわけではない。[Equation 5] E2 = u · (change of adjacent threshold value) + v ·
(Sum of absolute value residuals) The difference in the sign of the second term is that the normalized correlation value increases as the degree of coincidence increases, whereas the sum of absolute value residuals decreases. The degree of change in the adjacent threshold value and the degree of coincidence are not limited to those described here.
【0030】これらの評価関数のうち、採用したものを
最小にするσ(i,j)を求めれば、場所ごとに最適化
した、スーパースライス法(公知例3,4)を行なった
ことになるわけである。最適化の手法は各種あるが、例
えば、シミュレーティドアニーリングあるいはモンテカ
ルロシミュレーションとよばれる方法がある。これにつ
いては、ニューラルネットワーク情報処理,産業図書
(1988年)第31頁から第33頁に解説されてい
る。モンテカルロ法の通常の手順によれば、まず、ある
温度T(パラメータ)を設定した状態で以下の操作を行
なう。If σ (i, j) that minimizes the employed one of these evaluation functions is obtained, the super slicing method (known examples 3 and 4) optimized for each location is performed. That is why. There are various optimization methods, and for example, there is a method called simulated annealing or Monte Carlo simulation. This is described in Neural Network Information Processing, Industrial Books (1988), pages 31 to 33. According to the usual procedure of the Monte Carlo method, first, the following operation is performed with a certain temperature T (parameter) set.
【0031】(1)一様乱数をふり、しきい値を動かし
てみる画素を決定する(実用的には、この操作を行なわ
ず、画像中で、順々に動かしていってもよい)。 (2)一様乱数をふり、(1)で決定された画素にしき
い値の動かし方を決める。σ(i,j)にある値を加減
することになる。一般には、この大きさまで乱数できめ
るが、+eか−eかのどちらかを決めるだけでもよい。 (3)評価関数の変化量ΔEを計算する。 (4)ΔEが負なら、無条件で(2)の試行を存続させ
る。ΔEが0ならば(2)の試行を元に戻す。ΔEが正な
らば、一様乱数をふり、exp(−ΔE/T)との大小を比
較する。一様乱数のほうが大ならば、(2)の試行を元
に戻す。そうでないならば、試行を保存する。この操作
を画素の数だけ行なうことを、1モンテカルロステップ
という。(1) A uniform random number is applied to determine a pixel for which the threshold value is to be moved (in practice, this operation may be skipped and the pixel may be moved sequentially in the image). (2) A uniform random number is sprinkled to determine how to move the threshold value to the pixel determined in (1). A certain value of σ (i, j) will be added or subtracted. In general, random numbers up to this size can be used, but it is also possible to determine either + e or -e. (3) The change amount ΔE of the evaluation function is calculated. (4) If ΔE is negative, the trial of (2) continues unconditionally. If ΔE is 0, the trial of (2) is returned. If ΔE is positive, a uniform random number is pretended and the magnitude of exp (−ΔE / T) is compared. If the uniform random number is larger, the trial of (2) is undone. If not, save the trial. Performing this operation for the number of pixels is called one Monte Carlo step.
【0032】次に、シミュレーションの手順を説明す
る。 (1)しきい値面を初期配置に置く。仮りに、画像が0
から255で表現された白黒濃淡画像であったばあいに
は、例えば、σ(i,j)=127とする。 (2)高温(典型的なΔEより十分大な温度)でしばら
く動かす。 (3)温度を徐々に下げる。Next, the simulation procedure will be described. (1) Place the threshold plane in the initial position. If the image is 0
If the image is a black-and-white grayscale image represented by 1 to 255, σ (i, j) = 127, for example. (2) Move for a while at a high temperature (a temperature sufficiently higher than typical ΔE). (3) Gradually lower the temperature.
【0033】以上の操作により、最適化が行なわれ、結
果的に、しきい値面σ(i,j)、及びそれできりださ
れる領域が決定される。By the above operation, the optimization is performed, and as a result, the threshold plane σ (i, j) and the area produced by it are determined.
【0034】これまでの説明では、1画素ごとに試行す
ることにしていたが、計算時間の節約のため、図7
(a)のように、画像701を小画像702に分けるこ
ともできる。すなわち、それぞれの小画像の中ではしき
い値σ(i,j)は一定値とし、しきい値の変化率はそ
れぞれの小画像間の値の差の二乗和をとるなどするわけ
であり、計算量の飛躍的削減が図れる。図7(b)座標
軸703上に、小画像の上で一定値である、小画像上の
しきい値704のような状況を考えるわけである。この
後、各小画像の中央の値が決定されたσ(i,j)であ
るとして、各画素のσ(i,j)については補間処理を
行なう。In the above description, the trial is made for each pixel, but in order to save the calculation time, FIG.
The image 701 can be divided into small images 702 as shown in FIG. That is, in each small image, the threshold value σ (i, j) is set to a constant value, and the rate of change of the threshold value is obtained by taking the square sum of the difference between the values between the small images. The amount of calculation can be dramatically reduced. A situation such as a threshold 704 on the small image, which is a constant value on the small image on the coordinate axis 703 in FIG. 7B, is considered. Thereafter, assuming that the central value of each small image is the determined σ (i, j), interpolation processing is performed for σ (i, j) of each pixel.
【0035】また、以上のように求められた場所に依存
するしきい値を元にして、逆に画像の濃淡むらの補正を
行なうことができる。すなわち、しきい値面をσ(i,
j)、元の画像をa(i,j)としたとき、σ(i,
j)の大きいところは照明や撮像系の具合で明るいむら
ができていると考えられる。これを用いて、乗算,加減
算などによりシェーディング補正ができる。具体的に
は、σ*をσの平均値、a1(i,j)を補正値とし
て、数6の補正式がある。この補正式を作用させること
により、画像の濃淡むらの補正された画像が得られる。Further, based on the location-dependent threshold value obtained as described above, it is possible to conversely correct the unevenness in the image density. That is, the threshold plane is defined by σ (i,
j), when the original image is a (i, j), σ (i,
It is considered that the large j) has bright unevenness due to the condition of the illumination and the imaging system. By using this, shading correction can be performed by multiplication, addition / subtraction, or the like. Specifically, there is a correction formula of Expression 6 in which σ * is an average value of σ and a1 (i, j) is a correction value. By applying this correction formula, it is possible to obtain an image in which unevenness in image density is corrected.
【0036】[0036]
【数6】 a1(i,j)=a(i,j)・σ(i,j)/σ* a1(i,j)=a(i,j)−(σ(i,j)−σ
*)## EQU00006 ## a1 (i, j) = a (i, j) .sigma. (I, j) /. Sigma.a1 (i, j) = a (i, j)-(. Sigma. (I, j)-. Sigma.
*)
【0037】[0037]
【実施例】以下、本発明の一実施例である、白黒濃淡画
像中から特定対象物を切り出す計算機システムについ
て、図1から図7を用いて説明する。この実施例では、
画像を小画像に分けた場合のものであるが、各画素につ
いて最適化をする場合には、小画像が1画素からなると
想定して、かつ、図2ステップ202の補間処理が不要
であるとすれば、全く同様である。DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS A computer system for cutting out a specific object from a grayscale image, which is an embodiment of the present invention, will be described below with reference to FIGS. In this example,
Although the image is divided into small images, in the case of optimizing each pixel, it is assumed that the small image is composed of one pixel and that the interpolation process of step 202 in FIG. 2 is unnecessary. If so, it is exactly the same.
【0038】まず、図5は本発明の実施例のブロック図
であって、コンピュータ501,デイジタル化された画
像を蓄えるメモリ503、画像あるいは、文字表示を行
うCRT502,写真をディジタル画像として画像を入
力する画像入力装置507,キーボード504,ボタン
506のついたマウス505より構成されている。First, FIG. 5 is a block diagram of an embodiment of the present invention, in which a computer 501, a memory 503 for storing a digitalized image, a CRT 502 for displaying an image or characters, and a photograph as a digital image are input as an image. Image input device 507, keyboard 504, mouse 505 with buttons 506.
【0039】ここで、マウス505の機能について説明
する。コンピュータ501上の制御プログラムにより、
マウス505で指示された平面位置に従い、CRT50
2上に小さな矢印が表示され、マウス505を動かすこ
とにより、操作者はこの矢印をCRT502の画面上で
自由に動かすことができる。また、マウス505上のボ
タン506を押すと、CRT502上の画面中の矢印の
先の位置情報がコンピュータ501に送られ、その上で
動作するソフトウェアで用いることができる。The function of the mouse 505 will be described below. By the control program on the computer 501,
CRT50 according to the plane position designated by mouse 505
A small arrow is displayed above 2, and by moving the mouse 505, the operator can freely move this arrow on the screen of the CRT 502. Further, when the button 506 on the mouse 505 is pressed, the positional information at the tip of the arrow on the screen of the CRT 502 is sent to the computer 501 and can be used by software operating on the computer 501.
【0040】以下、この操作を「ピックする」という用
語を用いることにする。In the following, the term "pick" will be used for this operation.
【0041】また、CRT502上に表示される画像の
質については、縦横1000×1000すなわち1画面百万画素
程度で、赤青緑それぞれ256階調で合計1670万色
程度のものが一般的であるので、本実施例でもこの程度
の画質のものを用いる。本実施例では、白黒の濃淡画像
を取り扱うので、このディスプレイで表示する場合に
は、赤青緑を同じ値にした256階調が表示される。白
黒濃淡画像用のディスプレイを用いる計算機システムで
も実施可能であるし、画素数や表示色数はこれらに限定
されるものではない。画像入力装置507もこれに対応
できるものを用いる。Regarding the quality of the image displayed on the CRT 502, it is general that the vertical and horizontal directions are 1000 × 1000, that is, one screen has one million pixels, and red, blue and green have 256 gradations and a total of about 16.7 million colors. Therefore, the image quality of this level is used also in this embodiment. In the present embodiment, since a grayscale image of black and white is handled, when displayed on this display, 256 gradations with the same values of red, blue and green are displayed. A computer system using a display for black and white grayscale images can be used, and the number of pixels and the number of display colors are not limited to these. The image input device 507 is also compatible with this.
【0042】次に、図1から図4は、本発明の実施例の
処理手順のフローチャートである。このうち、図1は処
理全体の概略を示す図、図2は図1ステップ103の詳
細、図3は図2ステップ201の詳細、図4は図3ステ
ップ305の詳細を表すものである。Next, FIGS. 1 to 4 are flowcharts of the processing procedure of the embodiment of the present invention. Of these, FIG. 1 is a diagram showing the outline of the entire processing, FIG. 2 is a detail of step 103 of FIG. 1, FIG. 3 is a detail of step 201 of FIG. 2, and FIG. 4 is a detail of step 305 of FIG.
【0043】図1のステップ101では画像を入力し表
示する。ステップ102ではエッジ画像を作成する。本
実施例では、ゼロクロッシングを用いることにする。ス
テップ103では、しきい値面の決定を行なう。この識
別処理の詳細については後述する。ステップ104で
は、決定されたしきい値面に従い領域を切り出す。ステ
ップ105では切りだし結果を表示する。In step 101 of FIG. 1, an image is input and displayed. In step 102, an edge image is created. In this embodiment, zero crossing is used. In step 103, the threshold plane is determined. The details of this identification processing will be described later. In step 104, a region is cut out according to the determined threshold plane. In step 105, the cutting result is displayed.
【0044】図2はステップ103の詳細を説明するも
のである。ステップ201では小画像に分けて最適化し
しきい値面を決定する。これについては詳細を後述す
る。ステップ202では、作用で述べたように、小画像
の結果から補間処理をして、1画素ごとのしきい値を求
める。FIG. 2 illustrates the details of step 103. In step 201, the threshold value plane is determined by optimizing the small image. This will be described in detail later. In step 202, as described in the operation, interpolation processing is performed from the result of the small image to obtain the threshold value for each pixel.
【0045】図3は、図2ステップ201の詳細の説明
図である。ステップ301では、しきい値の初期値を設
定する。作用で説明したように、σ(i,j)=127
とする。ステップ302からステップ311までは繰返
しのループである。単純に一定回数(例えば500モン
テカルロステップ)繰り返す方法を採用する。その際、
パラメータTのスケジュールも予め設定しておく。初期
値T0として、100モンテカルロステップまではT
0、次の100モンテカルロステップはT0/2、つぎ
の100モンテカルロステップは更にその半分、という
ようにこの実施例では決めることにする。ステップ30
2はその温度パラメータTを設定する。ステップ303
では乱数生成を行ない、どの小画像のしきい値を動かし
てみるかを決める。ステップ304では、再び乱数生成
を行ない、決定された小画像のしきい値をどれだけ増加
させるか、あるいは、減少させるかを決める。ステップ
305では評価関数の計算を行なう。この詳細については
後述する。ステップ306では、評価関数の変化量ΔE
が、正,負,零によっての分岐処理である。正の場合に
はステップ307にいき、再び乱数rを生成して、exp
(−ΔE/T)との大小を見る。大きいか等しい場合に
はステップ309にいき、小さい場合には、ステップ3
10にいく。ステップ309では試行を存続させる。ス
テップ306で負の場合には、やはり、ステップ309
に進む。ステップ306で零だった場合には、試行を元
に戻す。ステップ311では再試行するかどうかの判定
を行なう。この実施例では、モンテカルロステップ数を
予め決めているので、ここでは、その回数判定のみ行な
う。FIG. 3 is a detailed explanatory diagram of step 201 in FIG. In step 301, the initial value of the threshold value is set. As described in the action, σ (i, j) = 127
And Steps 302 to 311 are an iterative loop. A method of simply repeating a certain number of times (for example, 500 Monte Carlo steps) is adopted. that time,
The schedule of the parameter T is also set in advance. Initial value T0, T up to 100 Monte Carlo steps
In this embodiment, 0, the next 100 Monte Carlo steps are T0 / 2, and the next 100 Monte Carlo steps are half that. Step 30
2 sets the temperature parameter T. Step 303
Then, generate a random number and decide which small image threshold to move. In step 304, random numbers are generated again to determine how much to increase or decrease the threshold value of the determined small image. Step
At 305, the evaluation function is calculated. The details will be described later. In step 306, the evaluation function change amount ΔE
Is a branch process with positive, negative, and zero. If it is positive, go to step 307 and generate a random number r again, exp
See the magnitude of (-ΔE / T). If larger or equal, go to step 309; if smaller, step 3
Go to 10. In step 309, the trial continues. If step 306 is negative, again step 309
Proceed to. If it is zero in step 306, the trial is returned. In step 311, it is determined whether to retry. In this embodiment, since the number of Monte Carlo steps is predetermined, only the number of times is determined here.
【0046】図4は、図3ステップ305の処理の詳細
の説明図である。ステップ401はしきい値処理による
領域を抽出する。ステップ402では十字フィルタをか
けることにより、輪郭を抽出する。ステップ403で
は、一致度を計算するが、この実施例では正規化相関値
を採用する。ステップ404では、小画像間のしきい値
の差の二乗和を求める。ステップ405では、一致度と
ステップ404で計算されたしきい値の変化量にもとづ
いて評価関数を計算する。作用で述べたように、この実
施例では正規化相関値を採用しているので、作用で説明
したように、その場合の式を用いる。FIG. 4 is an explanatory diagram of details of the process of step 305 of FIG. Step 401 extracts a region by threshold processing. In step 402, the cross filter is applied to extract the contour. In step 403, the degree of coincidence is calculated. In this embodiment, the normalized correlation value is adopted. In step 404, the sum of squares of the threshold difference between the small images is calculated. In step 405, the evaluation function is calculated based on the degree of coincidence and the amount of change in the threshold value calculated in step 404. As described in the operation, since the normalized correlation value is adopted in this embodiment, the equation in that case is used as described in the operation.
【0047】本実施例では、濃淡むらの影響を除いた、
高精度な領域切りだしを行なうことができる。In this embodiment, the effect of uneven density is removed.
High-precision area cutting can be performed.
【0048】次に、第2の実施例として、シェーディン
グ補正方法につき説明する。第1の実施例と全く同様に
しきい値σ(i,j)を求めた後、作用で説明したよう
に、σの平均値を求めて補正する。本実施例によれば、
予め照明むらを計測しておかなくても、シェーディング
補正を行なうことができる。Next, a shading correction method will be described as a second embodiment. After the threshold value σ (i, j) is obtained in exactly the same manner as in the first embodiment, the average value of σ is obtained and corrected as described in the operation. According to this embodiment,
Shading correction can be performed without measuring uneven illumination in advance.
【0049】[0049]
【発明の効果】本発明には、白黒濃淡画像の領域情報と
エッジ情報を組み合わせて領域切りだしを行なうスーパ
ースライス法において、場所ごとに異なるしきい値を自
動的に決定し、より正確な輪郭の領域を自動的に切りだ
すことができる。また、照明のむらなど、事前に計測す
る必要なく補正できる。As described above, according to the present invention, in the super-slicing method for cutting out a region by combining the region information and the edge information of a black-and-white grayscale image, different thresholds are automatically determined for each place, and a more accurate contour is obtained. The area of can be automatically cut out. Further, it is possible to correct the unevenness of illumination without the need to measure in advance.
【図1】本発明の1実施例の処理のフローチャート。FIG. 1 is a flowchart of processing according to an embodiment of the present invention.
【図2】本発明の1実施例の処理のフローチャート。FIG. 2 is a flowchart of processing according to the first embodiment of the present invention.
【図3】本発明の1実施例の処理のフローチャート。FIG. 3 is a flowchart of processing according to the first embodiment of the present invention.
【図4】本発明の1実施例の処理のフローチャート。FIG. 4 is a flowchart of processing according to the first embodiment of the present invention.
【図5】本発明の1実施例のブロック図。FIG. 5 is a block diagram of an embodiment of the present invention.
【図6】本発明の原理の説明図。FIG. 6 is an explanatory diagram of the principle of the present invention.
【図7】本発明の原理の説明図。FIG. 7 is an explanatory diagram of the principle of the present invention.
401…しきい値処理による領域抽出、402…輪隔抽
出、403…一致度の計算、404…変化量の計算、4
05…評価関数の算出。401 ... Area extraction by threshold processing, 402 ... Wheel space extraction, 403 ... Calculation of coincidence degree, 404 ... Calculation of change amount, 4
05 ... Calculation of evaluation function.
Claims (13)
れた画像中から場所に応じたしきい値で特定の対象を切
り出し、あるいは、2値化する方法において、しきい値
を決定する際、(1)切りだされた結果の領域の輪郭
と、エッジ検出処理を行なった結果のエッジ画像との一
致度がよい、(2)近接するしきい値の変化量が小さい
という二つの要素よりなる評価尺度を満たすよう最適化
し、しきい値を決定することを特徴とする画像セグメン
テーション方法。1. A method of cutting out or binarizing a specific object from a digitally represented image on a computer system with a threshold value according to a location, and when determining the threshold value: Evaluation consisting of two elements: 1) the degree of coincidence between the contour of the cut-out result area and the edge image as a result of the edge detection processing is good, and (2) the amount of change in the adjacent threshold value is small. An image segmentation method characterized by optimizing to satisfy a scale and determining a threshold value.
の微分の絶対値あるいはその平方である画像セグメンテ
ーション方法。2. The image segmentation method according to claim 1, wherein the edge image is an absolute value of an image differential or its square.
のゼロクロッシングである画像セグメンテーション方
法。3. The image segmentation method according to claim 1, wherein the edge image is zero crossing of an image.
のラプラシアンの絶対値またはその平方である画像セグ
メンテーション方法。4. The image segmentation method according to claim 1, wherein the edge image is the absolute value of the Laplacian of the image or its square.
絶対値残差和である画像セグメンテーション方法。5. The image segmentation method according to claim 1, wherein the degree of coincidence is the sum of absolute residuals between the images.
正規化相関値である画像セグメンテーション方法。6. The image segmentation method according to claim 1, wherein the degree of coincidence is a normalized correlation value between images.
は、その画素が領域中にあり、かつその上下左右の4画
素が領域であるものとそうでないものを両方含むという
条件で決定したものである画像セグメンテーション方
法。7. The contour according to claim 1, wherein the contour of the contour image is determined on the condition that the pixel is in a region and that the four pixels on the upper, lower, left and right sides are both a region and a region other than the region. An image segmentation method that is.
する前に、画像に平滑化処理を施す画像セグメンテーシ
ョン方法。8. The image segmentation method according to claim 1, wherein a smoothing process is performed on the image before the edge image is created.
立点除去または細線化処理を施す画像セグメンテーショ
ン方法。9. The image segmentation method according to claim 1, wherein the edge image is subjected to isolated point removal or thinning processing.
立点除去を施す画像セグメンテーション方法。10. The image segmentation method according to claim 1, wherein isolated points are removed from the contour image.
量は隣接画素のしきい値の差の二乗和である画像セグメ
ンテーション方法。11. The image segmentation method according to claim 1, wherein the change amount of the threshold value is the sum of squares of the difference between the threshold values of adjacent pixels.
量は、画像を複数の小画像に分割し、それぞれの小画像
の中ではしきい値を一定とした場合の、小画像間のしき
い値の差の二乗和である画像セグメンテーション方法。12. The amount of change in the threshold value according to claim 1, wherein the image is divided into a plurality of small images, and the threshold value is constant in each small image. An image segmentation method that is the sum of squared differences between thresholds.
ディジタル的に表現された画像中の濃淡むらを補正する
際、前記場所に応じて変化するしきい値処理を行ない、
決定されたしきい値をもって、補正後のしきい値が場所
によらない一定値になるように濃淡を補正するシェーデ
ィング補正方法。13. The method according to claim 1, wherein when correcting unevenness in light and shade in an image digitally expressed on a computer system, threshold processing that changes according to the place is performed.
A shading correction method that corrects shading so that the corrected threshold value becomes a constant value that does not depend on the location with the determined threshold value.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP4302060A JPH06150002A (en) | 1992-11-12 | 1992-11-12 | Image segmenting method and shading correcting method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP4302060A JPH06150002A (en) | 1992-11-12 | 1992-11-12 | Image segmenting method and shading correcting method |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH06150002A true JPH06150002A (en) | 1994-05-31 |
Family
ID=17904434
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP4302060A Pending JPH06150002A (en) | 1992-11-12 | 1992-11-12 | Image segmenting method and shading correcting method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH06150002A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100512831B1 (en) * | 2001-07-26 | 2005-09-07 | 캐논 가부시끼가이샤 | Image processing method, apparatus and program storage medium |
-
1992
- 1992-11-12 JP JP4302060A patent/JPH06150002A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100512831B1 (en) * | 2001-07-26 | 2005-09-07 | 캐논 가부시끼가이샤 | Image processing method, apparatus and program storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111415363B (en) | Image edge identification method | |
US6803920B2 (en) | Method and apparatus for digital image segmentation using an iterative method | |
JP3679512B2 (en) | Image extraction apparatus and method | |
CN107784669A (en) | A kind of method that hot spot extraction and its barycenter determine | |
CN111915704A (en) | Apple hierarchical identification method based on deep learning | |
CN110648349A (en) | Weld defect segmentation method based on background subtraction and connected region algorithm | |
CN112991193B (en) | Depth image restoration method, device and computer-readable storage medium | |
CN109540925B (en) | Complex ceramic tile surface defect detection method based on difference method and local variance measurement operator | |
CN108389215B (en) | Edge detection method and device, computer storage medium and terminal | |
JP6823486B2 (en) | Crack detection method | |
CN110930321A (en) | Blue/green screen digital image matting method capable of automatically selecting target area | |
JP3814353B2 (en) | Image segmentation method and image segmentation apparatus | |
JP3659426B2 (en) | Edge detection method and edge detection apparatus | |
US5892841A (en) | Process for automatic detection of the assessable areas in images of mechanical components | |
CN113505622A (en) | Test system and method for automatically identifying multiple bar codes and LED lamps | |
CN110930358B (en) | Solar panel image processing method based on self-adaptive algorithm | |
CN110298816B (en) | Bridge crack detection method based on image regeneration | |
JP2000048120A (en) | Method for extracting character area of gray level image and recording medium having recorded the program thereon | |
CN113223098B (en) | Preprocessing optimization method for image color classification | |
CN111476810B (en) | Image edge detection method and device, electronic equipment and storage medium | |
CN112270683B (en) | IHC digital preview image identification and organization foreground segmentation method and system | |
JPH06150002A (en) | Image segmenting method and shading correcting method | |
CN112052859B (en) | License plate accurate positioning method and device in free scene | |
JP2001209808A (en) | System and method for extracting object, and storage medium with stored program for object extraction | |
CN117911419A (en) | Method and device for detecting steel rotation angle enhancement of medium plate, medium and equipment |