JP4534599B2 - Image processing method - Google Patents

Image processing method Download PDF

Info

Publication number
JP4534599B2
JP4534599B2 JP2004156816A JP2004156816A JP4534599B2 JP 4534599 B2 JP4534599 B2 JP 4534599B2 JP 2004156816 A JP2004156816 A JP 2004156816A JP 2004156816 A JP2004156816 A JP 2004156816A JP 4534599 B2 JP4534599 B2 JP 4534599B2
Authority
JP
Japan
Prior art keywords
block
area
value
block connection
connection area
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.)
Active
Application number
JP2004156816A
Other languages
Japanese (ja)
Other versions
JP2005339180A (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.)
Panasonic Corp
Panasonic Electric Works Co Ltd
Original Assignee
Panasonic Corp
Matsushita Electric Works Ltd
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 Panasonic Corp, Matsushita Electric Works Ltd filed Critical Panasonic Corp
Priority to JP2004156816A priority Critical patent/JP4534599B2/en
Publication of JP2005339180A publication Critical patent/JP2005339180A/en
Application granted granted Critical
Publication of JP4534599B2 publication Critical patent/JP4534599B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、モノクロ濃淡画像、カラー画像、距離画像のように各画素の画素値を多段階に割り当てた多値画像を、目的の領域と背景の領域とに分割する画像処理方法に関するものである。   The present invention relates to an image processing method for dividing a multivalued image in which pixel values of each pixel are assigned in multiple stages, such as a monochrome grayscale image, a color image, and a distance image, into a target area and a background area. .

近年、画像によって各種対象物の識別、検査、計測、認識を行うために画像処理技術が利用されている。この種の画像処理技術では、画像内において対象物を識別する必要があるから、画像内において対象物を抽出する技術が各種提案されている。たとえば、撮像装置と対象物との位置関係に応じて適宜方向から照明を行うことによって画像内における対象物と背景との濃度値の差が大きくなるようにしておき、濃淡画像における各画素の画素値である濃度値に対して適宜の閾値を適用して濃淡画像を二値化することにより、対象物を背景から分離する技術が広く用いられている。   In recent years, image processing techniques have been used to identify, inspect, measure, and recognize various objects using images. In this type of image processing technology, since it is necessary to identify an object in the image, various techniques for extracting the object in the image have been proposed. For example, by performing illumination from the appropriate direction according to the positional relationship between the imaging device and the target object, the difference in density value between the target object and the background in the image is increased, and the pixel of each pixel in the grayscale image A technique for separating an object from a background by binarizing a grayscale image by applying an appropriate threshold to a density value that is a value is widely used.

しかしながら、濃淡画像を単純に二値化する技術では、対象物と背景との濃度値の差が不十分な場合や背景に地模様があるような場合には、背景から対象物を分離することができないという問題を有している。たとえば、光学式文字読み取り装置では文字の周囲に図柄や地模様が存在していると、文字の認識精度が低下するという問題が生じる。また、生産ラインにおいてコンベア上を搬送される物品を撮像した画像内でパターンマッチングを行うことによって物品の種別を判別するような場合に、画像内にベルトコンベアなどの画像が含まれていると部品を特定できない場合がある。   However, the technology that simply binarizes the grayscale image separates the object from the background when the difference in density value between the object and the background is insufficient or when there is a ground pattern in the background. Have the problem of not being able to. For example, in an optical character reader, if there is a pattern or ground pattern around a character, there is a problem that the character recognition accuracy is lowered. In addition, when the type of an article is determined by performing pattern matching in an image obtained by imaging an article conveyed on a conveyor in a production line, if the image includes a belt conveyor or the like, the part May not be identified.

そこで、画像内において類似した特徴を有する部分ごとに領域を分割することによって、目的の領域を画像内から抽出する技術が種々提案されている。たとえば、写真画像の処理に関して、画像を「ライト」「中間」「シャドウ」に分割するために、画像をブロック化し、ブロックを対にして類似度を評価することによりブロックを統合するクラスタリングを行い、クラスタリングにより形成された領域について統合の履歴を参照しながら再度評価を行って輪郭を確定する技術が提案されている(たとえば、特許文献1参照)。
特開平8−167028号公報
Therefore, various techniques for extracting a target region from the image by dividing the region into parts having similar features in the image have been proposed. For example, regarding the processing of photographic images, in order to divide the image into “light”, “intermediate”, and “shadow”, clustering is performed by integrating the blocks by blocking the images and evaluating the similarity by pairing the blocks, There has been proposed a technique for re-evaluating an area formed by clustering while referring to an integration history to determine a contour (for example, see Patent Document 1).
Japanese Patent Laid-Open No. 8-167028

上述した特許文献1に記載された技術では、クラスタリングにより3種類の領域に分割しているが、ノイズが存在する場合にノイズを十分に除去する技術ではなく、とくに文字認識や部品の種別認識のように対象物の領域を背景から分離する目的では採用することができない。   In the technique described in Patent Document 1 described above, it is divided into three types of areas by clustering. However, this technique is not a technique that sufficiently removes noise when noise is present, and is particularly suitable for character recognition and component type recognition. Thus, it cannot be used for the purpose of separating the object area from the background.

本発明は上記事由に鑑みて為されたものであり、その目的は、ノイズの多い画像であっても背景となる領域と対象となる領域とを精度よく分離することが可能である画像処理方法を提供することにある。   The present invention has been made in view of the above-described reasons, and an object thereof is an image processing method capable of accurately separating a background area and a target area even in a noisy image. Is to provide.

請求項1の発明は、多値画像をそれぞれ複数個の画素を含む矩形状の複数個のブロックに分割した後に、ブロック内の画素値の分布に関する特徴量を隣接する各一対のブロック間で比較し特徴量の類似度が規定値以上である各一対のブロックには同じラベルを付与するとともに特徴量の類似度が規定値未満である各一対のブロックには異なるラベルを付与して前記多値画像内のすべてのブロックにラベルを付与し、さらに、同ラベルが付与されているブロックからなるブロック連結領域の境界部分に位置するブロックを複数個の分割ブロックに分割するとともに、分割前のブロックに隣接するブロックの前記特徴量と分割ブロックの画素値の分布に関する特徴量との類似度が規定値以上になるときに隣接するブロックと同じラベルを当該分割ブロックに付与することにより当該分割ブロックを前記ブロック連結領域を構成するブロックとして前記ブロック連結領域に統合し、分割ブロックに分割し分割ブロックをブロック連結領域に統合する処理を繰り返すことにより多値画像に含まれる全画素をいずれかのブロック連結領域に統合する第1過程と、ラスタ走査によりブロック連結領域の境界を探索し、ブロック連結領域の境界を中心として複数のブロック連結領域を含む判断領域を設定し、前記境界を挟む2個のブロック連結領域のうちの一方のブロック連結領域を着目するブロック連結領域とし、他方のブロック連結領域が判断領域に占める面積の割合に他方のブロック連結領域の平均濃度値に乗じた値を濃度評価値として求める第2過程と、前記着目するブロック連結領域の平均濃度値と濃度評価値との差をパラメータとする識別評価値を求める第3過程と、前記識別評価値と規定の閾値との大小を比較することにより前記着目するブロック連結領域と前記着目するブロック領域に対する周辺のブロック連結領域とを分離する第4過程とを有することを特徴とする。 In the first aspect of the present invention, after dividing a multi-valued image into a plurality of rectangular blocks each including a plurality of pixels, the feature values relating to the distribution of pixel values in the block are compared between each pair of adjacent blocks. The multi-value is obtained by assigning the same label to each pair of blocks in which the similarity of the feature quantity is equal to or greater than the specified value and assigning a different label to each pair of blocks in which the similarity of the feature quantity is less than the specified value. Labels all blocks in the image, and further divides the block located at the boundary of the block connected area consisting of the blocks with the same label into a plurality of divided blocks. When the similarity between the feature quantity of the adjacent block and the feature quantity related to the distribution of pixel values of the divided blocks is equal to or higher than a specified value, the same label as the adjacent block is divided. By assigning to a lock, the divided block is integrated into the block connected area as a block constituting the block connected area, and divided into divided blocks, and the process of integrating the divided block into the block connected area is repeated to obtain a multi-valued image. The first process of integrating all the included pixels into any block connection area, and the boundary of the block connection area is searched by raster scanning, and a judgment area including a plurality of block connection areas is set around the boundary of the block connection area Then, one block connection region of the two block connection regions sandwiching the boundary is set as a block connection region to which attention is paid, and the average density of the other block connection region in the ratio of the area occupied by the other block connection region to the determination region a second process of obtaining a value obtained by multiplying the value as a density evaluation value of the block coupling region the noted A third process of obtaining an identification evaluation value for the difference between the average density value and the density evaluation value as a parameter, the interest and the attention block connected region by comparing the magnitude of the identification evaluation value specified threshold value And a fourth step of separating a block connection region around the block region.

この方法によれば、隣接するブロックのうち画素値の分布が類似しているブロックに同ラベルを付与してブロック連結領域を形成しているので、かすれた文字や陰影の付いたマークなどのような対象であって、背景との画素値分布は異なるが同一領域内で画素値にばらつきが生じているような場合でも正しく領域を抽出することができる。また、ブロック連結領域の境界部分についてのみブロックを細分化し、全画素にラベルを付与するから、ブロック連結領域の境界部分では輪郭形状を正確に抽出しながらも全体では処理の負荷が少なく、しかもノイズが含まれるような画像であっても、対象を画像内から容易に抽出することができ、文字認識や物品の種別の認識などにおいて、高精度かつ高速な処理が期待できる。さらにまた、ラスタ走査によってブロック連結領域の境界を探索し、境界の周辺のブロック連結領域について濃度値を反映する濃度評価値を求め、着目するブロック連結領域の濃度値と濃度評価値との差をパラメータに持つ識別評価値を用いて着目するブロック連結領域(後述する物体領域)と着目するブロック領域に対する周辺のブロック連結領域(後述する背景領域)とに分離するから、ノイズが多く含まれているような画像であってもブロック連結領域の境界付近における濃度差を反映している濃度評価値を用いて着目するブロック連結領域と着目するブロック領域に対する周辺のブロック連結領域とを精度よく分離することが可能になる。 According to this method, blocks that have similar pixel value distribution among adjacent blocks are assigned the same label to form a block connection area, so that such as blurred characters or shaded marks, etc. Even if the pixel value distribution is different from the background but the pixel value varies within the same region, the region can be correctly extracted. In addition, since the blocks are subdivided only at the boundary part of the block connection area and labels are assigned to all the pixels, the outline shape is accurately extracted at the boundary part of the block connection area, but the overall processing load is low, and noise is also generated. Can be easily extracted from the image, and high-precision and high-speed processing can be expected in character recognition and article type recognition. Further, the boundary of the block connection area is searched by raster scanning, a density evaluation value reflecting the density value is obtained for the block connection area around the boundary, and the difference between the density value and the density evaluation value of the block connection area of interest is calculated. since separated into the block coupling region of interest block coupling region near to the block area of interest (the object region to be described later) (background region to be described later) using an identification evaluation value with the parameter, it contains many noise separating accurately and block coupling region near to the block area of interest as a block coupling region of interest using the density evaluation value reflecting the density difference in an image is a by near the boundary of the even block coupling region, such as Is possible.

その上、境界の周辺に設定した判断領域内に含まれる複数個のブロック連結領域のうちの2個について平均濃度値と占有面積とを用いて濃度評価値を決定するから、境界付近の濃度値の変化を反映させた濃度評価値を得ることができ、着目するブロック連結領域と着目するブロック領域に対する周辺のブロック連結領域との分離精度を高めることができる。とくに、判断領域内で各ブロック連結領域の占有面積の割合で重み付けをしているから、着目するブロック連結領域と着目するブロック領域に対する周辺のブロック連結領域との濃度値の相違だけではなく面積差の情報も付加することで、両者を分離できる可能性を高めることができる。 In addition, since the density evaluation value is determined using the average density value and the occupied area for two of the plurality of block connection areas included in the determination area set around the boundary, the density value near the boundary is determined. it is possible to obtain a density evaluation value that reflects the change in, it is possible to enhance the separation accuracy of the block coupling region near to the block area of interest and the focused block linking region. In particular, weighting is performed by the ratio of the occupied area of each block connection area within the judgment area, so that not only the difference in density value between the target block connection area and the surrounding block connection area with respect to the target block area , but also the area difference. By adding this information, the possibility of separating the two can be increased.

請求項2の発明は、多値画像をそれぞれ複数個の画素を含む矩形状の複数個のブロックに分割した後に、ブロック内の画素値の分布に関する特徴量を隣接する各一対のブロック間で比較し特徴量の類似度が規定値以上である各一対のブロックには同じラベルを付与するとともに特徴量の類似度が規定値未満である各一対のブロックには異なるラベルを付与して前記多値画像内のすべてのブロックにラベルを付与し、さらに、同ラベルが付与されているブロックからなるブロック連結領域の境界部分に位置するブロックを複数個の分割ブロックに分割するとともに、分割前のブロックに隣接するブロックの前記特徴量と分割ブロックの画素値の分布に関する特徴量との類似度が規定値以上になるときに隣接するブロックと同じラベルを当該分割ブロックに付与することにより当該分割ブロックを前記ブロック連結領域を構成するブロックとして前記ブロック連結領域に統合し、分割ブロックに分割し分割ブロックをブロック連結領域に統合する処理を繰り返すことにより多値画像に含まれる全画素をいずれかのブロック連結領域に統合する第1過程と、ラスタ走査によりブロック連結領域の境界を探索し、ブロック連結領域の境界を中心として複数のブロック連結領域を含む判断領域を設定し、判断領域に少なくとも一部が含まれる各ブロック連結領域のうち着目するブロック連結領域以外のブロック連結領域が判断領域に占める面積の割合を重み係数とし各ブロック連結領域の平均濃度値に重み係数を乗じて平均した加重平均値を濃度評価値として求める第2過程と、前記着目するブロック連結領域の平均濃度値と濃度評価値との差をパラメータとする識別評価値を求める第3過程と、前記識別評価値と規定の閾値との大小を比較することにより前記着目するブロック連結領域と前記着目するブロック領域に対する周辺のブロック連結領域とを分離する第4過程とを有することを特徴とする。 According to the second aspect of the present invention, after dividing a multi-valued image into a plurality of rectangular blocks each including a plurality of pixels, the feature values relating to the distribution of pixel values in the block are compared between each pair of adjacent blocks. The multi-value is obtained by assigning the same label to each pair of blocks in which the similarity of the feature quantity is equal to or greater than the specified value and assigning a different label to each pair of blocks in which the similarity of the feature quantity is less than the specified value. Labels all blocks in the image, and further divides the block located at the boundary of the block connected area consisting of the blocks with the same label into a plurality of divided blocks. When the similarity between the feature quantity of the adjacent block and the feature quantity related to the distribution of pixel values of the divided blocks is equal to or higher than a specified value, the same label as the adjacent block is divided. By assigning to a lock, the divided block is integrated into the block connected area as a block constituting the block connected area, and divided into divided blocks, and the process of integrating the divided block into the block connected area is repeated to obtain a multi-valued image. a first step of integrating any of the blocks connected region all pixels included searches block boundaries connected region by raster scan, a determination region including a plurality of blocks connected region around the boundary of the block coupling region set, the average density value of each block coupling region weighting factor the ratio of the area occupied by the block coupling region determination area other than the block coupling region of interest among the blocks connecting region including at least part the decision region a second process of obtaining a weighted average value obtained by averaging by multiplying the weighting factor as the density evaluation value and the focus The third process of obtaining an identification evaluation value using the difference between the average density value and the density evaluation value of the lock connection area as a parameter, and the block connection area of interest by comparing the identification evaluation value with a prescribed threshold value And a fourth step of separating a block connection region around the block region of interest .

この方法によれば、隣接するブロックのうち画素値の分布が類似しているブロックに同ラベルを付与してブロック連結領域を形成しているので、かすれた文字や陰影の付いたマークなどのような対象であって、背景との画素値分布は異なるが同一領域内で画素値にばらつきが生じているような場合でも正しく領域を抽出することができる。また、ブロック連結領域の境界部分についてのみブロックを細分化し、全画素にラベルを付与するから、ブロック連結領域の境界部分では輪郭形状を正確に抽出しながらも全体では処理の負荷が少なく、しかもノイズが含まれるような画像であっても、対象を画像内から容易に抽出することができ、文字認識や物品の種別の認識などにおいて、高精度かつ高速な処理が期待できる。さらにまた、ラスタ走査によってブロック連結領域の境界を探索し、境界の周辺のブロック連結領域について濃度値を反映する濃度評価値を求め、着目するブロック連結領域の濃度値と濃度評価値との差をパラメータに持つ識別評価値を用いて着目するブロック連結領域(後述する物体領域)と着目するブロック領域に対する周辺のブロック連結領域(後述する背景領域)とに分離するから、ノイズが多く含まれているような画像であってもブロック連結領域の境界付近における濃度差を反映している濃度評価値を用いて着目するブロック連結領域と着目するブロック領域に対する周辺のブロック連結領域とを精度よく分離することが可能になる。その上、境界の周辺に設定した判断領域内に含まれる複数個のブロック連結領域の全体の平均濃度値と占有面積とを用いて濃度評価値を決定するから、境界付近の濃度値の変化を反映させた濃度評価値を得ることができ、着目するブロック連結領域と着目するブロック連結領域に対する周辺のブロック連結領域との分離精度を高めることができる。とくに、判断領域内で各ブロック連結領域の占有面積の割合を重み係数に用いた濃度値の加重平均値を用いるから、着目するブロック連結領域と着目するブロック連結領域に対する周辺のブロック連結領域との濃度値の相違だけではなく面積差の情報も付加することで、両者を分離できる可能性を高めることができる。 According to this method, blocks that have similar pixel value distribution among adjacent blocks are assigned the same label to form a block connection area, so that such as blurred characters or shaded marks, etc. Even if the pixel value distribution is different from the background but the pixel value varies within the same region, the region can be correctly extracted. In addition, since the blocks are subdivided only at the boundary part of the block connection area and labels are assigned to all the pixels, the outline shape is accurately extracted at the boundary part of the block connection area, but the overall processing load is low, and noise is also generated. Can be easily extracted from the image, and high-precision and high-speed processing can be expected in character recognition and article type recognition. Further, the boundary of the block connection area is searched by raster scanning, a density evaluation value reflecting the density value is obtained for the block connection area around the boundary, and the difference between the density value and the density evaluation value of the block connection area of interest is calculated. It contains a lot of noise because it separates into the block connection area of interest (object area described later) and the block connection area around the block area of interest (background area described later) using the identification evaluation value of the parameter. Even in such an image, the block connection region of interest and the block connection regions around the block region of interest are accurately separated using the density evaluation value reflecting the density difference near the boundary of the block connection region. Is possible. In addition, since the density evaluation value is determined using the overall average density value and the occupied area of the plurality of block connection areas included in the determination area set around the boundary, the change in density value near the boundary is determined. it is possible to obtain a density evaluation value that reflects, it is possible to enhance the separation accuracy of the block coupling region near to the block coupling region of interest and the focused block linking region. In particular, since the weighted average value of the density values using the ratio of the occupied area of each block connection area in the judgment area as a weighting factor is used, the block connection area of interest and the block connection areas around the block connection area of interest are By adding not only the density value difference but also the area difference information, it is possible to increase the possibility of separating the two.

請求項3の発明は、請求項1または請求項2の発明において、前記第2過程では、求めた前記濃度評価値を着目するブロック連結領域の画素値とする評価画像データを生成し、濃度評価値が一度求められたブロック連結領域については濃度評価値を再度求めないことを特徴とする。 According to a third aspect of the present invention, in the first or second aspect of the present invention, in the second step, evaluation image data is generated in which the obtained density evaluation value is used as a pixel value of a block connection area to which attention is focused, and density evaluation is performed. It is characterized in that the density evaluation value is not obtained again for the block connection area whose value has been obtained once.

この方法によれば、1つの画像内において濃度評価値を一旦求めたブロック連結領域については、その後に濃度評価値を再度求めることがないから、少ない演算量で濃度評価値を求めることができ、処理の高速化が期待できる。   According to this method, since the density evaluation value is not obtained again for the block connection area in which the density evaluation value is once obtained in one image, the density evaluation value can be obtained with a small amount of calculation. High speed processing can be expected.

本発明の方法によれば、隣接するブロックのうち画素値の分布が類似しているブロックに同ラベルを付与してブロック連結領域を形成しているので、かすれた文字や陰影の付いたマークなどのような対象であって、背景との画素値分布は異なるが同一領域内で画素値にばらつきが生じているような場合でも正しく領域を抽出することができるという利点がある。また、ブロック連結領域の境界部分についてのみブロックを細分化し、全画素にラベルを付与するから、ブロック連結領域の境界部分では輪郭形状を正確に抽出しながらも全体では処理の負荷が少なく、しかもノイズが含まれるような画像であっても、対象を画像内から容易に抽出することができ、文字認識や物品の種別の認識などにおいて、高精度かつ高速な処理が期待できる。さらにまた、ラスタ走査によってブロック連結領域の境界を探索し、境界の周辺のブロック連結領域について濃度値を反映する濃度評価値を求め、着目するブロック連結領域の濃度値と濃度評価値との差をパラメータに持つ識別評価値を用いて着目するブロック連結領域(後述する物体領域)と着目するブロック連結領域に対する周辺のブロック連結領域(後述する背景領域)とに分離するから、ノイズが多く含まれているような画像であってもブロック連結領域の境界付近における濃度差を反映している濃度評価値を用いて着目するブロック連結領域と着目するブロック連結領域に対する周辺のブロック連結領域とを精度よく分離することが可能になるという効果を奏する。 According to the method of the present invention, blocks having similar pixel value distribution among adjacent blocks are given the same label to form a block connection area, so that a blurred character, a shaded mark, etc. There is an advantage that a region can be correctly extracted even when the pixel value distribution is different from the background but the pixel value varies within the same region. In addition, since the blocks are subdivided only at the boundary part of the block connection area and labels are assigned to all the pixels, the outline shape is accurately extracted at the boundary part of the block connection area, but the overall processing load is low, and noise is also generated. Can be easily extracted from the image, and high-precision and high-speed processing can be expected in character recognition and article type recognition. Further, the boundary of the block connection area is searched by raster scanning, a density evaluation value reflecting the density value is obtained for the block connection area around the boundary, and the difference between the density value and the density evaluation value of the block connection area of interest is calculated. Since the block connection area (object area described later) and the block connection area around the block connection area (background area described later) with respect to the target block connection area are separated by using the identification evaluation value of the parameter, a lot of noise is included. separating accurately and block coupling region near to the block coupling region of interest and block coupling region the focused using the density evaluation value reflecting the density difference be an image of the block coupling region in the vicinity of the boundary of being There is an effect that it becomes possible to do.

本実施形態では、図2に示すように、文字が表記された対象物1をCCDカメラのような撮像装置2を用いて撮像し、撮像装置2により得られた画像内において文字の領域を他の領域から分離する場合を例として説明する。撮像装置2としてはモノクロ信号を出力するものを想定する。撮像装置2の出力は後述の処理を行う画像処理装置10に入力される。撮像装置2の出力はアナログ信号であって画像処理装置10に設けたA/D変換器11においてデジタル信号に変換された後、画像処理装置10に設けた記憶手段12に格納される。記憶手段12は、A/D変換器11から出力された濃淡画像を一時的に記憶する一時記憶領域および濃淡画像に対して後述する各種処理を行う間に発生するデータを一時的に記憶する作業記憶領域を備えるメモリと、各種データを長期的に記憶するためのハードディスク装置のような記憶装置とを含む。記憶手段12における一時記憶領域に格納される濃淡画像は、画素がマトリクス状に配列されるとともに各画素に多段階の画素値が設定される多値画像になる。なお、本実施形態では、濃淡画像(グレー画像)を用いるから以下では画素値として濃度値を用いるが、多値画像としてはカラー画像や距離画像を用いることができ、カラー画像では画素値として色相あるいは彩度を用いればよく、距離画像では画素値として距離を用いることになる。また、カラー画像では、適宜の基準色との色差を用いて各画素に1つの画素値を対応させたり、L表色系の明度L色度a,bの3つの値を1画素の画素値として対応させてもよい。 In the present embodiment, as shown in FIG. 2, an object 1 on which characters are written is imaged using an imaging device 2 such as a CCD camera, and other character regions are displayed in the image obtained by the imaging device 2. As an example, a case of separation from the region will be described. The imaging device 2 is assumed to output a monochrome signal. The output of the imaging device 2 is input to an image processing device 10 that performs processing described later. The output of the imaging device 2 is an analog signal that is converted into a digital signal by the A / D converter 11 provided in the image processing device 10 and then stored in the storage means 12 provided in the image processing device 10. The storage unit 12 temporarily stores the grayscale image output from the A / D converter 11 and temporarily stores data generated during various processes described later on the grayscale image. A memory having a storage area and a storage device such as a hard disk device for storing various data for a long period of time are included. The grayscale image stored in the temporary storage area in the storage unit 12 is a multivalued image in which pixels are arranged in a matrix and multi-stage pixel values are set for each pixel. In this embodiment, since a grayscale image (gray image) is used, a density value is used as a pixel value in the following. However, a color image or a distance image can be used as a multivalued image, and a hue value is used as a pixel value in a color image. Alternatively, saturation may be used, and the distance is used as the pixel value in the distance image. Further, in a color image, one pixel value is associated with each pixel using a color difference from an appropriate reference color, or the lightness L * chromaticity a * , b * of L * a * b * color system is 3 One value may correspond as a pixel value of one pixel.

画像処理装置10はマイクロコンピュータを主構成とし、記憶手段12に格納した画像に対して図3に示す処理を実行することによって、本実施形態の目的である文字の領域を他の領域から分離する。なお、画像処理装置10にはCRTあるいは液晶表示器を用いたモニタ3が付設され、記憶手段12に格納された画像や処理中の画像をモニタ3で監視することが可能になっている。   The image processing apparatus 10 includes a microcomputer as a main component, and performs the processing shown in FIG. 3 on the image stored in the storage unit 12, thereby separating the character area, which is the object of the present embodiment, from other areas. . Note that the image processing apparatus 10 is provided with a monitor 3 using a CRT or a liquid crystal display, so that the image stored in the storage means 12 and the image being processed can be monitored by the monitor 3.

いま、画像処理装置10において、記憶手段12に格納された画像内から文字の領域を抽出するものとする(すなわち、画像内を文字の領域と他の領域とに分割する)。また、記憶手段12に格納された画像の文字の領域には、不連続部分(左右両部分の間に隙間)や明暗のむらの大きい部分が存在している場合があるものとする。このような画像では、画素値(濃度値)で単純に二値化すると、不連続部分の存在する文字はひとまとまりに(1文字として)扱うことができず、明暗のむらの大きい文字は形状を明確に抽出することができなくなる。さらに、画像内には撮像手段2により生じるノイズが含まれていることもあり、ノイズが含まれていると二値化した画像内で文字と同じ画素値の画素が不規則に発生することがある。つまり、文字以外の情報が含まれていたり、本来は1文字であるのにひとまとまりに扱うことができない情報が含まれていたり、文字の形状が不明瞭であったりする場合には、光学的文字読み取り装置などにおいて文字を認識しようとするときに、元の画像の濃度値を二値化しただけでは得られる情報に過不足が生じ、文字の認識率が低下する。   Assume that the image processing apparatus 10 extracts a character area from the image stored in the storage unit 12 (that is, divides the image into a character area and another area). In addition, in the character area of the image stored in the storage unit 12, there may be a discontinuous portion (a gap between the left and right portions) or a portion with large unevenness in brightness. In such an image, if binarization is simply performed with pixel values (density values), characters with discontinuous portions cannot be handled as a whole (as one character), and characters with large unevenness of light and darkness have a shape. It becomes impossible to extract clearly. Furthermore, noise generated by the image pickup means 2 may be included in the image. If noise is included, pixels having the same pixel value as characters may be irregularly generated in the binarized image. is there. In other words, when information other than characters is included, information that cannot be handled as a whole although it is originally a single character, or the shape of characters is unclear, optical When trying to recognize a character in a character reader or the like, if the density value of the original image is only binarized, the information obtained will be excessive or insufficient, and the character recognition rate will decrease.

そこで、文字以外の不要な情報(以下、「背景領域」という)を画像内から除去し、さらに文字ごとに1つのまとまった領域として扱うことを可能にするとともに、文字の中で濃度値にばらつきがあっても文字の形状をほぼ正確に抽出することを可能にすることが要求される。以下では、文字のような目的の領域を「物体領域」と呼ぶ。光学的文字読み取り装置においては、文字の認識率を向上させるために、文字の領域である物体領域と背景領域とを分離することが前処理として要求される。また、物品の種別をパターンマッチングによって認識するような場合にも、パターンマッチングの精度を高めるために、物品の領域である物体領域と背景領域とを分離することが前処理として要求される。   Therefore, unnecessary information other than characters (hereinafter referred to as “background region”) can be removed from the image, and can be handled as a single region for each character, and the density value varies among characters. Even if there is, it is required to be able to extract the shape of the character almost accurately. Hereinafter, a target area such as a character is referred to as an “object area”. In an optical character reader, in order to improve the character recognition rate, it is required as a pre-process to separate an object region, which is a character region, and a background region. Even when the type of article is recognized by pattern matching, separation of the object area and the background area, which is the article area, is required as preprocessing in order to increase the accuracy of pattern matching.

このような前処理を行うために、本実施形態では記憶手段12に格納された濃淡画像に対して、図3に示す手順の処理を行って物体領域と背景領域とを分離する。すなわち、まず画像分割処理部13では、記憶手段12に格納された濃淡画像を2の累乗個(nを正整数として2個)の画素を一辺とする正方領域であるブロックB(図4参照)に分割する(S1)。ブロックBのサイズは、文字を物体領域とする場合であれば、ブロックBの一辺が文字の線幅程度になるように設定される。このようなブロックBのサイズは画像における空間周波数に基づいて自動的に設定することができる。 In order to perform such pre-processing, in the present embodiment, the procedure shown in FIG. 3 is performed on the grayscale image stored in the storage unit 12 to separate the object region and the background region. That is, first, in the image division processing unit 13, the grayscale image stored in the storage means 12 is a block B (see FIG. 4) that is a square region having one side of a power of 2 (2 n pixels where n is a positive integer). (S1). The size of the block B is set so that one side of the block B is about the line width of the character if the character is an object region. The size of such a block B can be automatically set based on the spatial frequency in the image.

次に、画像分割処理部13で得られた各ブロックBは特徴量演算部14に引き渡され、各ブロックBの画素値の分布に関する特徴量がそれぞれ求められる(S2)。本実施形態では特徴量としてブロックBに含まれる各画素の濃度値の平均値および標準偏差を用いる。各ブロックBについて求めた特徴量は追跡処理部15において比較され、着目しているブロックBに隣接するブロックBであって着目しているブロックBとの特徴量の類似度が規定値以上であるブロックBを追跡する(S3)。隣接する各一対のブロックBの類似度が規定値以上であるときには両ブロックBに同じラベルを付与することによって、同ラベルを付与した複数個のブロックBからなるブロック連結領域を形成する。すなわち、着目するブロックBに対して特徴量の類似度が規定値以上になるような隣接するブロックBを順次追跡し、追跡されたブロックBによって図5に示すような形でブロック連結領域が形成される(図5において濃淡の異なるひとまとまりの部分がそれぞれブロック連結領域になる)。追跡可能であったブロックBについては、ブロック連結領域ごとにラベルを付与して記憶手段12に格納する。隣接するブロックBの特徴量を比較してブロック連結領域を追跡する処理手順については後述する。   Next, each block B obtained by the image division processing unit 13 is transferred to the feature amount calculation unit 14, and the feature amount relating to the distribution of the pixel values of each block B is obtained (S2). In the present embodiment, the average value and standard deviation of the density values of each pixel included in the block B are used as the feature amount. The feature amount obtained for each block B is compared in the tracking processing unit 15, and the similarity between the feature amount of the block B adjacent to the target block B and the target block B is equal to or greater than a specified value. Block B is tracked (S3). When the similarity between each pair of adjacent blocks B is equal to or greater than a specified value, the same label is assigned to both blocks B, thereby forming a block connection region composed of a plurality of blocks B to which the same label is assigned. That is, adjacent blocks B whose feature amount similarity is equal to or greater than a predetermined value with respect to the target block B are sequentially tracked, and block connected regions are formed by the tracked blocks B in the form shown in FIG. (In FIG. 5, a group of different shades is a block connection area). For the block B that can be traced, a label is assigned to each block connection area and stored in the storage unit 12. A processing procedure for comparing block feature areas by comparing feature quantities of adjacent blocks B will be described later.

一方、上述のようにしてブロックBを追跡して濃淡画像に複数個のブロック連結領域が形成されると、異なるラベルが付与されたブロック連結領域の境界部分のブロックBをブロック分割処理部16に引き渡す(S4)。ブロック分割処理部16ではブロック連結領域の境界部分である各ブロックBを縦横にそれぞれ2分割した分割ブロックBn(=B1、nは正整数、図6参照)を形成する(S5,S6)。つまり、分割ブロックB1に含まれる画素数はブロックBの画素数の4分の1になる。ブロック分割処理部16において生成された分割ブロックB1は、特徴量演算部14に引き渡されて特徴量が求められ、分割ブロックB1について求めた特徴量は追跡処理部15において周囲のブロックBの特徴量との類似度が評価される。分割ブロックB1の特徴量と周囲のブロックBの特徴量との類似度が規定値以上であるときには、分割ブロックB1に周囲のブロックBと同じラベルが付与され、この分割ブロックB1は周囲のブロックBと同じブロック連結領域に統合される(S7)。このようなラベル付けの処理によって各分割ブロックB1にラベルが付与され、ブロック連結領域の境界部分では分割ブロックB1の単位でブロック連結領域の形状が微細化される。このようにして、ブロック連結領域の境界部分には分割ブロックB1が並ぶから、分割ブロックB1をブロックBと等価に扱い、分割ブロックB1をさらに分割ブロックB2に分割して上述の処理を繰り返し、最終的には1画素単位まで分割する(S8,S9)。ここにおいて、分割ブロックBnを用いて形成したブロック連結領域を記憶手段12に格納するのはもちろんのことである。上述のようにしてすべてのブロックBと分割ブロックBn(nは正整数)とにラベルが付与されれば各ブロック連結領域が物体領域または背景領域であると考えられるから、物体領域と背景領域とを分離することが可能になる。   On the other hand, when the block B is tracked as described above and a plurality of block connection areas are formed in the grayscale image, the block B at the boundary of the block connection areas to which different labels are assigned is transferred to the block division processing unit 16. Deliver (S4). The block division processing unit 16 forms divided blocks Bn (= B1, n is a positive integer, see FIG. 6) obtained by dividing each block B, which is a boundary portion of the block connection area, into two vertically and horizontally (S5, S6). That is, the number of pixels included in the divided block B1 is a quarter of the number of pixels in the block B. The divided block B1 generated in the block division processing unit 16 is delivered to the feature amount calculation unit 14 to obtain the feature amount, and the feature amount obtained for the divided block B1 is obtained from the feature amount of the surrounding block B in the tracking processing unit 15. The similarity to is evaluated. When the similarity between the feature amount of the divided block B1 and the feature amount of the surrounding block B is equal to or greater than the specified value, the same label as the surrounding block B is given to the divided block B1, and the divided block B1 is the surrounding block B1. (S7). By such labeling processing, a label is given to each divided block B1, and the shape of the block connection area is refined in units of the division block B1 at the boundary portion of the block connection area. In this way, since the divided blocks B1 are arranged at the boundary portion of the block connection area, the divided block B1 is treated as equivalent to the block B, the divided block B1 is further divided into divided blocks B2, and the above processing is repeated. Specifically, it is divided into units of one pixel (S8, S9). Here, it goes without saying that the block connection area formed using the divided blocks Bn is stored in the storage means 12. If all the blocks B and the divided blocks Bn (n is a positive integer) are labeled as described above, each block connection region is considered to be an object region or a background region. Can be separated.

上述した処理により、画像からブロック連結領域が抽出され、図7に示すように、各ブロック連結領域Di(i=1〜17)にそれぞれラベルが付与される。ところで、図7に示す画像を生成した原画像は「8」という文字を含むグレー画像であって、文字が背景よりも暗い(濃度値が小さい)が、原画像において文字を簡単には判別できない程度に多くのノイズ(文字の周辺に水滴や泡が存在する場合など)が含まれている場合を想定している。ブロック連結領域Diを抽出した段階では1文字となるべき領域が複数個のブロック連結領域Diに分割され、このままでは文字として認識することができない。そこで、本実施形態では、隣接するブロック連結領域Diにそれぞれ含まれる画素の濃度値の差を反映した評価値(以下では、「識別指標値」と呼ぶ)を用いることによって、各ブロック連結領域Diを背景領域と物体領域とに分離する技術を提供する。識別指標値rviは、後述するように、各ブロック連結領域Diに含まれる画素の濃度値の差に相当するパラメータを含み、コントラストと同様にブロック連結領域Diの区別のしやすさを表している。背景領域と物体領域とを分離すれば、物体領域の位置関係から文字を判別することが可能になる。 Through the processing described above, block connection areas are extracted from the image, and labels are assigned to the respective block connection areas Di (i = 1 to 17) as shown in FIG. By the way, the original image generated from the image shown in FIG. 7 is a gray image including the character “8”, and the character is darker than the background (the density value is small), but the character cannot be easily identified in the original image. It is assumed that there is a lot of noise (such as when there are water droplets or bubbles around the character). At the stage of extracting the block connection area Di, the area that should be one character is divided into a plurality of block connection areas Di, and cannot be recognized as characters as it is. Therefore, in the present embodiment, each block connection region Di is used by using an evaluation value (hereinafter referred to as “identification index value”) that reflects a difference in density value of pixels included in adjacent block connection regions Di. Is provided for separating the image into a background area and an object area. As will be described later, the identification index value rvi includes a parameter corresponding to the difference in density value of the pixels included in each block connection area Di, and represents the ease of distinguishing the block connection area Di like the contrast. . If separating the background region and the object region, it is possible to determine the character from the positional relationship of the object body region.

ラベルを付与したブロック連結領域Diの生成後に各ブロック連結領域Diを背景領域と物体領域とに分離する処理手順は、図1のようになる。すなわち、まず画像の全体についてラスタ走査を行うことにより、ブロック連結領域Diの境界を探索する(S1)。ブロック連結領域Diの境界が発見されると、発見された位置を中心として所定範囲の判断領域Ddを設定する(S2)。判断領域Ddは等間隔で分布した複数個の判断ポイントPdを含んでおり、判断領域Ddに少なくとも一部が含まれる各ブロック連結領域Diの中の判断ポイントPdの個数が求められる(S3)。要するに、各ブロック連結領域Diが判断領域Ddに占める面積の指標が判断ポイントPdの個数として求められる。   A processing procedure for separating each block connection area Di into a background area and an object area after the generation of the block connection area Di to which the label is attached is as shown in FIG. That is, the boundary of the block connection area Di is first searched by performing raster scanning on the entire image (S1). When the boundary of the block connection area Di is found, the determination area Dd within a predetermined range is set around the found position (S2). The determination area Dd includes a plurality of determination points Pd distributed at equal intervals, and the number of determination points Pd in each block connection area Di at least partially included in the determination area Dd is obtained (S3). In short, an index of the area occupied by each block connection region Di in the determination region Dd is obtained as the number of determination points Pd.

次に、判断領域Ddに含まれる各ブロック連結領域Diについて、周辺とのコントラストを評価するために、まず判断領域Ddの中で着目するブロック連結領域Diを除いた周辺の濃度値の目安を求める(S4)。以下では、各ブロック連結領域Diの周辺の濃度値の目安を着目するブロック連結領域Diに対する濃度評価値SaIiと呼ぶ。濃度評価値SaIiは、着目するブロック連結領域Diを除いた周辺のブロック連結領域Diが判断領域Ddに占める面積(判断ポイントPdの個数を用いる)と、各ブロック連結領域Diの濃度値の平均値(以下では、「平均濃度値」と呼ぶ)Iaiとを用いて算出する。したがって、着目するブロック連結領域Diの平均濃度値Iaiと濃度評価値SaIiとの差は、着目するブロック連結領域Diと周辺とのコントラストを反映する。   Next, in order to evaluate the contrast with the periphery of each block connection area Di included in the determination area Dd, first, a standard of the density value of the periphery excluding the block connection area Di of interest in the determination area Dd is obtained. (S4). Below, the standard of the density value around each block connection area Di is referred to as the density evaluation value SaIi for the block connection area Di to which attention is paid. The density evaluation value SaIi is an area (using the number of determination points Pd) occupied by the peripheral block connection area Di excluding the block connection area Di of interest in the determination area Dd, and the average value of the density values of the block connection areas Di. (Hereinafter referred to as “average density value”) Iai. Therefore, the difference between the average density value Iai and the density evaluation value SaIi of the block connection area Di of interest reflects the contrast between the block connection area Di of interest and the surrounding area.

上述のように、着目するブロック連結領域Diの平均濃度値Iaiと濃度評価値SaIiとの差はコントラストを反映しているから、識別指標値rviとして用いることが可能である。ただし、識別指標値rviは物体領域と背景領域とを分離する指標に用いるから、濃度値だけではなくブロック連結領域Diの面積もパラメータとして含んでいるほうが、物体領域と背景領域との分離が容易になると考えられる。   As described above, since the difference between the average density value Iai and the density evaluation value SaIi of the block connection area Di of interest reflects the contrast, it can be used as the identification index value rvi. However, since the identification index value rvi is used as an index for separating the object region and the background region, it is easier to separate the object region and the background region by including not only the density value but also the area of the block connection region Di as a parameter. It is thought that it becomes.

そこで、本実施形態では、識別指標値rviとして、ブロック連結領域Diの平均濃度値Iaiと濃度評価値SaIiとの差に、着目するブロック連結領域Diの全体の画素数ndiを乗じた値を用いる(S5)。すなわち、背景領域と物体領域とでは濃度値の差が大きいから、背景領域となるブロック連結領域Diの平均濃度値Iaiと当該ブロック連結領域Diに対する濃度評価値SaIiとの差の絶対値は比較的大きい値になり、しかも、一般に背景領域は物体領域に比較して面積が大きいから、背景領域となるブロック連結領域Diの画素数ndiを平均濃度値Iaiと濃度評価値SaIiとの差に乗じて求めた識別指標値rviの絶対値は、物体領域について求めた識別指標値rviの絶対値に比較して有意の差で大きくなると考えられる。   Therefore, in the present embodiment, as the identification index value rvi, a value obtained by multiplying the difference between the average density value Iai and the density evaluation value SaIi of the block connection area Di by the total number of pixels ndi of the block connection area Di of interest is used. (S5). That is, since the difference in density value between the background area and the object area is large, the absolute value of the difference between the average density value Iai of the block connection area Di serving as the background area and the density evaluation value SaIi for the block connection area Di is relatively Since the background area is generally larger than the object area, the number of pixels ndi of the block connection area Di serving as the background area is multiplied by the difference between the average density value Iai and the density evaluation value SaIi. It is considered that the absolute value of the obtained identification index value rvi increases with a significant difference compared to the absolute value of the identification index value rvi obtained for the object region.

本実施形態は、このような知見に基づいて各ブロック連結領域Diの識別指標値rviを求めており、適宜の閾値Thを用いて識別指標値rviを2値化することにより、各ブロック連結領域Diを背景領域と物体領域とに分離している。閾値Thを設定するにあたっては、画像の全体において識別指標値rviの平均値arvを求め(S6)、識別指標値rviの平均値arvと識別指標値rviの最大値または最小値との間で閾値Thを設定する(S7)。閾値Thの求め方については後述する。   In the present embodiment, the identification index value rvi of each block connection area Di is obtained based on such knowledge, and each block connection area is binarized by binarizing the identification index value rvi using an appropriate threshold Th. Di is separated into a background area and an object area. In setting the threshold value Th, an average value arv of the identification index value rvi is obtained in the entire image (S6), and the threshold value is determined between the average value arv of the identification index value rvi and the maximum value or the minimum value of the identification index value rvi. Th is set (S7). A method for obtaining the threshold Th will be described later.

以下の説明では、図7に示す場合を例とする。図示例では、ブロック連結領域Diが17個設けられており、2個のブロック連結領域D1,D2は背景領域に属し、残りのブロック連結領域D3〜D17は物体領域に属している。また、ブロック連結領域D1は物体領域よりも明るく(濃度値が高く)、ブロック連結領域D2は物体領域よりも暗いものとする。   In the following description, the case shown in FIG. 7 is taken as an example. In the illustrated example, 17 block connection areas Di are provided, the two block connection areas D1 and D2 belong to the background area, and the remaining block connection areas D3 to D17 belong to the object area. Further, it is assumed that the block connection area D1 is brighter (the density value is higher) than the object area, and the block connection area D2 is darker than the object area.

上述したように、各ブロック連結領域Diについて、濃度評価値SaIiを求めるには各ブロック連結領域Diの平均濃度値Iaiが必要であり、識別指標値rviを求めるにはブロック連結領域Diの画素数ndiが必要である。そこで、各ブロック連結領域Diごとに平均濃度値Iaiおよび画素数ndiを求める。以下の説明では、各ブロック連結領域Diの平均濃度値Iaiおよび画素数ndiとして表1に示す値を用いる。   As described above, for each block connection area Di, the average density value Iai of each block connection area Di is required to obtain the density evaluation value SaIi, and the number of pixels in the block connection area Di is required to obtain the identification index value rvi. ndi is required. Therefore, the average density value Iai and the number of pixels ndi are obtained for each block connection area Di. In the following description, the values shown in Table 1 are used as the average density value Iai and the number of pixels ndi of each block connection area Di.

Figure 0004534599
Figure 0004534599

図1のステップS1として説明したように、ブロック連結領域Diの境界はラスタ走査により求める。すなわち、隣接する2個のブロック連結領域Diの間の境界上の画素を1画素刻みのラスタ走査により探索し、ブロック連結領域Diのラベルが変化した位置を2個のブロック連結領域Diの境界上の画素とする。また、ステップS2のように、求めた画素の周辺に判断領域Ddを設定し、判断領域Ddに少なくとも一部が含まれるブロック連結領域Diを用いて濃度評価値SaIiを求める。   As described in step S1 in FIG. 1, the boundary of the block connection area Di is obtained by raster scanning. That is, a pixel on the boundary between two adjacent block connection areas Di is searched by raster scanning in increments of one pixel, and the position where the label of the block connection area Di is changed is located on the boundary between the two block connection areas Di. Pixels. Further, as in step S2, the determination area Dd is set around the obtained pixel, and the density evaluation value SaIi is obtained using the block connection area Di including at least a part of the determination area Dd.

判断領域Ddは図8に示す例では31画素×31画素の正方形状の領域であり、判断領域Ddには1画素の大きさの判断ポイントPdを等間隔で縦横に7個ずつ配列してある。つまり、判断領域Ddには合計49個の判断ポイントPdが設定され、隣り合う判断ポイントPdの距離は5画素に設定してある(判断ポイントPdの間に4画素入る)。ただし、図8に示している判断領域Ddの大きさ、判断ポイントPdの間隔、判断ポイントPdの個数は一例であって、使用者が適宜に設定できるように設定入力部を設ける。判断領域Ddは複数個のブロック連結領域Diを含んでいれば、必ずしも正方形状でなくてもよく、たとえば円形状などの判断領域Ddを設定することも可能である。ただし、正方形状の判断領域Ddは設定が容易であり、後述する演算も容易である。   In the example shown in FIG. 8, the determination area Dd is a 31 × 31 square area, and in the determination area Dd, seven determination points Pd each having a size of one pixel are arranged at equal intervals in the vertical and horizontal directions. . That is, a total of 49 determination points Pd are set in the determination area Dd, and the distance between adjacent determination points Pd is set to 5 pixels (4 pixels are included between the determination points Pd). However, the size of the determination area Dd, the interval between the determination points Pd, and the number of the determination points Pd shown in FIG. 8 are merely examples, and a setting input unit is provided so that the user can set as appropriate. The determination area Dd does not necessarily have a square shape as long as it includes a plurality of block connection areas Di. For example, the determination area Dd having a circular shape or the like can be set. However, the square-shaped determination area Dd is easy to set and the calculation described later is easy.

図8に示す例では、ラスタ走査によりブロック連結領域D1とブロック連結領域D3との境界の画素が検出され、この画素を中心画素(図において符号pcで示した画素)として判断領域Ddを設定している。判断領域Ddには、境界を挟む2個のブロック連結領域D1,D3のほか、ブロック連結領域D2,D4も含まれる。つまり、ラスタ走査により探索して求めた境界の位置の周辺に存在する4個のブロック連結領域D1〜D4が判断領域Ddに含まれる。これらの4個のブロック連結領域D1〜D4にそれぞれ含まれる画素を用いて濃度評価値SaIiが求められる。   In the example shown in FIG. 8, a pixel at the boundary between the block connection area D1 and the block connection area D3 is detected by raster scanning, and a determination area Dd is set with this pixel as a central pixel (a pixel indicated by reference numeral pc in the drawing). ing. The determination area Dd includes block connection areas D2 and D4 in addition to the two block connection areas D1 and D3 that sandwich the boundary. That is, four block connection areas D1 to D4 existing around the boundary position obtained by searching by raster scanning are included in the determination area Dd. The density evaluation value SaIi is obtained using the pixels included in each of these four block connection areas D1 to D4.

図8に示す例では、判断領域Ddに4個のブロック連結領域D1〜D4が含まれ、かつ各ブロック連結領域D1〜D4に含まれる判断ポイントPdの個数がそれぞれ31個、12個、4個、2個になっている。各連結領域Diに含まれる判断ポイントPdの個数をniで表すと、n1=31、n2=12、n3=4、n4=2になる。また、図から明らかなように、隣接するブロック連結領域D1〜D4の対は、(D1,D3)(D2,D3)(D2,D4)になる。濃度評価値SaIiは、以下のいずれかの方法によって求める。   In the example shown in FIG. 8, the determination area Dd includes four block connection areas D1 to D4, and the number of determination points Pd included in each of the block connection areas D1 to D4 is 31, 12, and 4, respectively. There are two. When the number of determination points Pd included in each connected region Di is represented by ni, n1 = 31, n2 = 12, n3 = 4, and n4 = 2. Further, as is apparent from the figure, the pair of adjacent block connection regions D1 to D4 is (D1, D3) (D2, D3) (D2, D4). The density evaluation value SaIi is obtained by one of the following methods.

各ブロック連結領域Diに対する濃度評価値SaIiは、上述したように、判断領域Ddに少なくとも一部が含まれるブロック連結領域Diのうち着目するブロック連結領域Diを除く周辺のブロック連結領域Diの濃度値の目安であるから、もっとも簡単な濃度評価値SaIiとしては、隣接する2個のブロック連結領域Diのうちの一方を着目するブロック連結領域Diとし、他方のブロック連結領域Diの平均濃度値Iaiを用いことができる。   As described above, the density evaluation value SaIi for each block connection area Di is the density value of the block connection areas Di around the block connection area Di excluding the target block connection area Di among the block connection areas Di at least partially included in the determination area Dd. Therefore, as the simplest density evaluation value SaIi, one of two adjacent block connection areas Di is set as a block connection area Di of interest, and the average density value Iai of the other block connection area Di is set as Can be used.

図8に示した例では、判断領域Ddにおいて隣接するブロック連結領域Diは、(D1,D3)(D2,D3)(D2,D4)の組合せであるが、判断領域Ddを設定した境界はブロック連結領域D1とブロック連結領域D3との境界であるから、(D1,D3)の組合せについて濃度評価値SaI1,SaI3を求める。すなわち、ブロック連結領域D3に着目すれば濃度評価値SaI3はブロック連結領域D1の平均濃度値Ia1であって220になり、ブロック連結領域D1に着目すれば濃度評価値SaI1はブロック連結領域D3の平均濃度値Ia3であって35になる。   In the example shown in FIG. 8, the adjacent block connection area Di in the determination area Dd is a combination of (D1, D3) (D2, D3) (D2, D4), but the boundary where the determination area Dd is set is a block. Since this is the boundary between the connection region D1 and the block connection region D3, the density evaluation values SaI1 and SaI3 are obtained for the combination of (D1, D3). That is, if attention is focused on the block connection area D3, the density evaluation value SaI3 is the average density value Ia1 of the block connection area D1, which is 220. If attention is paid to the block connection area D1, the density evaluation value SaI1 is the average of the block connection area D3. The density value Ia3 is 35.

上述の方法で濃度評価値SaIiを求める場合には、ブロック連結領域Diのラベルが変化した境界がどのブロック連結領域Diの境界であるかがわかればよいから判断領域Ddは必要ではない。ただし、各ブロック連結領域Diの平均濃度値Iaiに代えて、判断領域Ddの中で各ブロック連結領域Diに含まれる各判断ポイントPdごとに濃度値を求め、各ブロック連結領域Diごとに求めた濃度値の平均値を濃度評価値SaIiに用いることも可能であって、この場合には演算量は増加するものの、判断領域Ddの中で濃度値の平均値を求めるから、境界の近傍領域の濃度値の変化を反映しやすくなる。具体的には、判断領域Ddの中でm行n列の位置の判断ポイントPdの濃度値をI(m,n)とし、境界を挟む2個のブロック連結領域Di,Djのうちの一方のブロック連結領域Diに対する濃度評価値SaIiを、数1によって求めるのである。つまり、ブロック連結領域Diに対する濃度評価値SaIiは、他方のブロック連結領域Djの濃度値の平均値になる。数1において、(m,n)は判断領域Ddのうちブロック連結領域Djに含まれる判断ポイントPdの位置を表し、njはブロック判断領域Djに含まれる判断ポイントPdの個数である。   When the density evaluation value SaIi is obtained by the above-described method, the determination area Dd is not necessary because it is only necessary to know which block connection area Di is the boundary where the label of the block connection area Di is changed. However, instead of the average density value Iai of each block connection area Di, a density value is obtained for each judgment point Pd included in each block connection area Di in the judgment area Dd, and obtained for each block connection area Di. It is also possible to use the average value of the density values as the density evaluation value SaIi. In this case, although the amount of calculation increases, the average value of the density values is obtained in the determination area Dd. It becomes easier to reflect changes in density values. Specifically, the density value of the determination point Pd at the position of m rows and n columns in the determination region Dd is I (m, n), and one of the two block connection regions Di and Dj across the boundary is set. The density evaluation value SaIi for the block connection area Di is obtained by Equation 1. That is, the density evaluation value SaIi for the block connection area Di is an average value of the density values of the other block connection area Dj. In Equation 1, (m, n) represents the position of the determination point Pd included in the block connection region Dj in the determination region Dd, and nj is the number of determination points Pd included in the block determination region Dj.

Figure 0004534599
Figure 0004534599

数1によって判断領域Ddの中で各ブロック連結領域Diの濃度値の平均値を求める方法は境界付近の濃度値の変化を反映しているものの演算量が増加する。そこで、各ブロック判断領域Diの濃度値の平均値に代えて、各ブロック判断領域Diの平均濃度値Iaiに各ブロック連結領域Diが判断領域Ddに占める面積の割合を重み係数として重み付けした値を用いるようにしてもよい。この値は、平均濃度値に重み係数を乗じるだけの簡単な演算であるから、数1を用いる場合よりも演算量を低減することができる。   Although the method of obtaining the average value of the density values of each block connection area Di in the determination area Dd by Expression 1, the calculation amount increases although the change of the density value near the boundary is reflected. Therefore, instead of the average value of the density values of each block determination area Di, a value obtained by weighting the average density value Iai of each block determination area Di as a weighting factor is the ratio of the area occupied by each block connection area Di to the determination area Dd. You may make it use. Since this value is a simple calculation by simply multiplying the average density value by a weighting factor, the amount of calculation can be reduced as compared with the case of using Equation 1.

すなわち、重み係数は、各ブロック連結領域Diに含まれる判断ポイントPdの個数をniとし、判断領域Ddに含まれる判断ポイントPdの全数をn0(=49)とすると、ni/n0になる。したがって、各ブロック連結領域Diに対する濃度評価値SaIiを求める際に、各ブロック連結領域Diごとに求める値は、平均濃度値Iaiを用いて、Iai・ni/n0になる。各ブロック連結領域D1〜D4ごとに求める値は、以下のようになる。
D1:220×31/49=139.18
D2:130×12/49=31.84
D3:35×4/49=2.86
D4:30×2/49=1.22
図8に示す例では、判断領域Ddを設定した境界がブロック連結領域D1とブロック連結領域D3との境界であるから、ブロック連結領域D1に対する濃度評価値SaI1はブロック連結領域D3から求められる値であって2.86になり、ブロック連結領域D3に対する濃度評価値SaI3はブロック連結領域D1から求められる値であって139.18になる。
That is, the weighting coefficient is ni / n0, where ni is the number of determination points Pd included in each block connection area Di and n0 (= 49) is the total number of determination points Pd included in the determination area Dd. Therefore, when obtaining the density evaluation value SaIi for each block connection area Di, the value obtained for each block connection area Di is Iai · ni / n0 using the average density value Iai. The values obtained for each of the block connection areas D1 to D4 are as follows.
D1: 220 × 31/49 = 139.18
D2: 130 × 12/49 = 31.84
D3: 35 × 4/49 = 2.86
D4: 30 × 2/49 = 1.22
In the example shown in FIG. 8, since the boundary where the determination area Dd is set is the boundary between the block connection area D1 and the block connection area D3, the density evaluation value SaI1 for the block connection area D1 is a value obtained from the block connection area D3. Therefore, the density evaluation value SaI3 for the block connection area D3 is a value obtained from the block connection area D1 and is 139.18.

重み係数ni/n0を用いる演算は、各ブロック連結領域Diが判断領域Ddに占める面積の割合を反映しており、物体領域が文字に基づく場合には判断領域Ddにおいて背景領域のほうが物体領域よりも占有面積が大きくなるから、背景領域のほうが重み係数が大きくなる。上述した重み係数は、背景領域の濃度値が物体領域の濃度値よりも高い場合(背景領域が物体領域よりも明るい場合)に用いる値であって、背景領域に対する濃度評価値SaIiと物体領域に対する濃度評価値SaIiとの比を大きくすることになり、背景領域に対する濃度評価値SaIiが物体領域に対する濃度評価値SaIiに比べて大幅に小さくなる。たとえば、平均濃度値Iaiを用いる場合には濃度評価値SaI1,SaI3はそれぞれ35,220であって6.29倍であるのに対して、重み係数ni/n0を乗じた場合には濃度評価値SaI1,SaI3はそれぞれ2.86,139.18であって48.66倍になる。なお、背景領域が物体領域よりも暗い場合には、(1−ni/n0)を重み係数とすればよい。   The calculation using the weighting factor ni / n0 reflects the proportion of the area occupied by each block connection area Di in the determination area Dd. When the object area is based on characters, the background area in the determination area Dd is more than the object area. Since the occupied area also increases, the background region has a larger weight coefficient. The weighting factor described above is a value used when the density value of the background area is higher than the density value of the object area (when the background area is brighter than the object area), and the density evaluation value SaIi for the background area and the object area The ratio with the density evaluation value SaIi is increased, and the density evaluation value SaIi for the background area is significantly smaller than the density evaluation value SaIi for the object area. For example, when the average density value Iai is used, the density evaluation values SaI1 and SaI3 are 35, 220 and 6.29 times, respectively, whereas when the weight coefficient ni / n0 is multiplied, the density evaluation value is obtained. SaI1 and SaI3 are 2.86 and 139.18, respectively, which is 48.66 times. If the background area is darker than the object area, (1-ni / n0) may be used as a weighting factor.

上述した各方法によって求められる濃度評価値SaIiは、境界を挟む2個のブロック連結領域Diのみを対象にして求めているが、境界の周辺の全体の濃度値を反映しているとは言えない。そこで、境界の周辺の全体の濃度値を反映させた濃度評価値SaIiとして、判断領域Ddに少なくとも一部が含まれる各ブロック連結領域Diのうち着目するブロック連結領域Di以外のブロック連結領域Diにおける平均濃度値Iaiの加重平均値を用いる方法を示す。加重平均値を求めるための重み係数には、判断領域Ddに少なくとも一部が含まれるブロック連結領域Diのうちで、着目するブロック連結領域Diを除いた各ブロック連結領域Diが判断領域Ddに占める面積の割合を用いる。つまり、重み係数は、各ブロック連結領域Diに含まれる判断ポイントPdの個数をniで表すとすると、着目するブロック連結領域Diを除くブロック連結領域Diに含まれる判断ポイントPdの個数niを用いて、それぞれni/Σniと表される。   The density evaluation value SaIi obtained by each of the methods described above is obtained only for the two block connection regions Di sandwiching the boundary, but cannot be said to reflect the entire density value around the boundary. . Therefore, as the density evaluation value SaIi reflecting the entire density value around the boundary, the block connection area Di other than the target block connection area Di among the block connection areas Di at least partially included in the determination area Dd. A method of using a weighted average value of the average density value Iai will be described. In the weight coefficient for obtaining the weighted average value, among the block connection areas Di at least partially included in the determination area Dd, each block connection area Di excluding the block connection area Di of interest occupies the determination area Dd. Use the area ratio. In other words, if the number of determination points Pd included in each block connection region Di is represented by ni, the weighting coefficient uses the number ni of determination points Pd included in the block connection region Di excluding the block connection region Di of interest. Are represented as ni / Σni, respectively.

たとえば、図8においてブロック連結領域D3に対する濃度評価値SaI3を求めようとすれば、ブロック連結領域D1,D2,D4にそれぞれ含まれる判断ポイントPdの個数が31,12,2であるから、各ブロック連結領域D1,D2,D4に対する重み係数は、それぞれ31/(31+12+2),12/(31+12+2),2/(31+12+2)であって、各平均濃度値Ia1,Ia2,Ia4は、それぞれ220,130,30であるから、SaI3=(220×31+130×12+30×2)/(31+12+2)=187.56になる。同様にして、SaI1,SaI2,SaI4はそれぞれ以下のように求めることができる。
SaI1=(130×12+35×4+30×2)/(12+4+2)=97.78
SaI2=(220×31+35×4+30×2)/(31+4+2)=189.73
SaI4=(220×31+130×12+35×4)/(31+12+4)=181.28
上述の演算で求めた濃度評価値SaIiは、着目するブロック連結領域Diの周辺の平均濃度値Iaiが高いほど大きい値になり、周辺のブロック連結領域Diが判断領域Ddに占める割合が大きいほど重み係数ni/Σniが小さくなる。一般に背景領域は物体領域よりも面積が大きいから、背景領域の平均濃度値Iaiが物体領域の平均濃度値Iaiよりも高い場合には、上述の演算によって、物体領域の濃度評価値SaIiは背景領域の濃度評価値SaIiよりも大きい値になる。
For example, in FIG. 8, if the density evaluation value SaI3 for the block connection area D3 is to be obtained, the number of determination points Pd included in the block connection areas D1, D2, and D4 is 31, 12, 2, respectively. The weighting factors for the connected regions D1, D2, and D4 are 31 / (31 + 12 + 2), 12 / (31 + 12 + 2), and 2 / (31 + 12 + 2), respectively, and the average density values Ia1, Ia2, and Ia4 are 220, 130, Since it is 30, SaI3 = (220 × 31 + 130 × 12 + 30 × 2) / (31 + 12 + 2) = 187.56. Similarly, SaI1, SaI2, and SaI4 can be obtained as follows.
SaI1 = (130 × 12 + 35 × 4 + 30 × 2) / (12 + 4 + 2) = 97.78
SaI2 = (220 × 31 + 35 × 4 + 30 × 2) / (31 + 4 + 2) = 189.73
SaI4 = (220 × 31 + 130 × 12 + 35 × 4) / (31 + 12 + 4) = 181.28
The density evaluation value SaIi obtained by the above calculation becomes larger as the average density value Iai around the block connection area Di of interest is higher, and the weight is increased as the ratio of the block connection area Di around the determination area Dd is larger. The coefficient ni / Σni becomes small. In general, since the background area has a larger area than the object area, when the average density value Iai of the background area is higher than the average density value Iai of the object area, the density evaluation value SaIi of the object area is calculated by the above calculation. The density evaluation value SaIi is larger.

上述のいずれかの方法で濃度評価値SaIiを求めた後には(図1のステップS4)、濃度評価値SaIiを用いて識別指標値rviを求めることができる。識別指標値rviは、各ブロック連結領域Diに含まれる画素の濃度値の差を反映する値であって、着目するブロック連結領域Diと周辺のブロック連結領域Diとの濃度値の差を反映する識別指標値rviは、着目するブロック連結領域Diの平均濃度値をIai、着目するブロック連結領域Diの全体の画素数をndi、濃度評価値をSaIiとすると、次式で表すことができる。
rvi=(Slai−Iai)×ndi
たとえば、ブロック連結領域D1〜D4について、各ブロック連結領域D1〜D4に関する平均濃度値Ia1〜Ia4の加重平均値を濃度評価値SaI1〜SaI4に用いる場合を例として、識別指標値rv1〜rv4を求めると、以下のようになる。
rv1=(97.78−220)×5300=−647766
rv2=(189.73−130)×3100=185163
rv3=(187.56−35)×250=38140
rv4=(181.28−30)×22=3328.16
上述のようにして求めた識別指標値rviは、周辺よりも濃度値が高いブロック連結領域Diでは負の値になり、また背景領域のほうが物体領域よりも画素数が多いから背景領域のほうが絶対値が大きくなる。つまり、物体領域よりも明るい背景領域(たとえば、ブロック連結領域D1)の識別指標値rviは、絶対値が大きく符号が負になる。識別指標値rviを求めるために用いる濃度評価値SaIiは、必ずしも各ブロック連結領域Dいにおける平均濃度値の加重平均値である必要はなく、上述したいずれかの方法で求めた濃度評価値SaIiを用いることが可能である。
After the density evaluation value SaIi is obtained by any of the methods described above (step S4 in FIG. 1), the identification index value rvi can be obtained using the density evaluation value SaIi. The identification index value rvi is a value that reflects the difference in density value of the pixels included in each block connection area Di, and reflects the difference in density value between the block connection area Di of interest and the surrounding block connection area Di. The identification index value rvi can be expressed by the following equation, where Iai is the average density value of the block connection area Di of interest, ndi is the total number of pixels of the block connection area Di of interest, and SaIi is the density evaluation value.
rvi = (Slai-Iai) × ndi
For example, with respect to the block connection areas D1 to D4, the identification index values rv1 to rv4 are obtained by using, as an example, the weighted average values of the average density values Ia1 to Ia4 related to the block connection areas D1 to D4 as the density evaluation values SaI1 to SaI4. And the following.
rv1 = (97.78−220) × 5300 = −647766
rv2 = (189.73−130) × 3100 = 185163
rv3 = (187.56-35) × 250 = 38140
rv4 = (181.28-30) × 22 = 3328.16
The identification index value rvi obtained as described above is a negative value in the block connection area Di having a higher density value than the surrounding area, and the background area has a larger number of pixels than the object area. The value increases. That is, the identification index value rvi of the background area (for example, the block connection area D1) brighter than the object area has a large absolute value and a negative sign. The density evaluation value SaIi used for obtaining the identification index value rvi does not necessarily need to be a weighted average value of the average density values in each block connection region D. The density evaluation value SaIi obtained by any of the methods described above is used. It is possible to use.

画像の全体で物体領域を背景領域から分離するためには、すべてのブロック連結領域Diについて識別指標値rviを決定しなければならない。ただし、ラスタ走査によってブロック連結領域Diのラベルが変化する境界が見つかるたびに当該境界について識別指標値rviを求める演算を行うとすれば、同じ組合せのブロック連結領域Diの境界を何度も検出することになって演算量が増加し、しかも各ブロック連結領域Diに対する識別指標値rviを一意に定めることができないから、ブロック連結領域Diごとに複数個の識別指標値rviから1つの値を決定するための演算も必要になる。   In order to separate the object area from the background area in the entire image, it is necessary to determine the identification index value rvi for all the block connection areas Di. However, if the calculation for obtaining the identification index value rvi for the boundary is found every time a boundary where the label of the block connection area Di is changed by raster scanning, the boundary of the block connection area Di of the same combination is detected many times. As a result, the amount of calculation increases, and the identification index value rvi for each block connection area Di cannot be uniquely determined. Therefore, one value is determined from a plurality of identification index values rvi for each block connection area Di. The calculation for this is also needed.

そこで、本実施形態では、1つのブロック連結領域Diについて識別指標値rviを求めた後に、求めた識別指標値rviを当該ブロック連結領域Diの全画素の画素値とする評価画像データを生成し、評価画像データにおいて画素値が決まったブロック連結領域Diについては、当該画像の処理が終了するまでは画素値の変更を行わないようにしている。つまり、評価画像データにおいては、各ブロック連結領域Diについて画像値となる識別指標値rviを1回だけ求めることになり、ブロック連結領域Diごとの識別指標値rviの決定が容易になり演算量が少なくなるから、処理の高速化を図ることができる。   Therefore, in this embodiment, after obtaining the identification index value rvi for one block connection area Di, evaluation image data is generated with the obtained identification index value rvi as the pixel values of all the pixels in the block connection area Di, For the block connection area Di whose pixel value is determined in the evaluation image data, the pixel value is not changed until the processing of the image is completed. That is, in the evaluation image data, the identification index value rvi serving as an image value is obtained only once for each block connection area Di, and the determination of the identification index value rvi for each block connection area Di is facilitated and the amount of calculation is large. Therefore, the processing speed can be increased.

さらに、評価画像データにおいて識別指標値rviが設定されたブロック連結領域Diについては、ラスタ走査によって当該ブロック連結領域Diと他のブロック連結領域Diとの境界が見つかっても、識別指標値rviを設定したときと同じブロック連結領域Diの間の境界であるときには判断領域Ddを設定せず、異なるブロック連結領域Diの境界であるときにのみ判断領域Ddを設定する。また、新たに設定された判断領域Ddに含まれるブロック連結領域Diのすべてについて、評価画像データにおいて画素値がすでに設定されているときには、当該判断領域Ddによる識別指標値rviの演算は行わないようにする。このように、識別指標値rviが一旦決まったブロック連結領域Diについてはできるだけ重複した演算を防止することによって、演算量を低減することができ処理の高速化を図ることができる。   Further, for the block connection area Di for which the identification index value rvi is set in the evaluation image data, the identification index value rvi is set even if a boundary between the block connection area Di and another block connection area Di is found by raster scanning. The determination area Dd is not set when the boundary is between the same block connection areas Di as when the determination is made, and the determination area Dd is set only when the boundary is between different block connection areas Di. Further, when pixel values have already been set in the evaluation image data for all the block connection areas Di included in the newly set determination area Dd, the calculation of the identification index value rvi by the determination area Dd is not performed. To. As described above, the block connection area Di once the identification index value rvi is determined is prevented from being overlapped as much as possible, so that the amount of calculation can be reduced and the processing speed can be increased.

以下では、各ブロック連結領域Diについて求めた識別指標値rviを用いて物体領域を背景領域から分離する技術について説明する。物体領域を背景領域から分離するには、識別指標値rviに対する閾値Thを設定し、識別指標値rviと閾値Thとの大小を比較する。   Hereinafter, a technique for separating the object region from the background region using the identification index value rvi obtained for each block connection region Di will be described. In order to separate the object region from the background region, a threshold value Th for the identification index value rvi is set, and the magnitudes of the identification index value rvi and the threshold value Th are compared.

閾値Thを設定するために、まず数2によって画像の全体での識別指標値rviの平均値arvを求める。この平均値arvは、画像の全体におけるコントラストの目安になる。ただし、数2においてkは画像内のブロック連結領域Diの個数である。   In order to set the threshold Th, first, an average value arv of the identification index value rvi in the entire image is obtained by Equation 2. This average value arv is a measure of contrast in the entire image. In Equation 2, k is the number of block connection regions Di in the image.

Figure 0004534599
Figure 0004534599

物体領域と背景領域とを分離する閾値Thは、数2で求めた平均値arvに基づいて下式を用いて設定する。下式における係数αは物体領域と背景領域との濃度値の関係によって適宜値に設定される。すなわち、係数αは利用者が適宜に入力することができる。ただし、係数αの規定値としては0.2が設定されている。
Th=arv+α・(Imax−arv)
ここに、|I|maxは、背景領域が物体領域よりも明るい(濃度値が高い)場合には識別指標値rviの最大値を用い、背景領域が物体領域よりも暗い場合には識別指標値rviの最小値を用いる。上式は識別指標値rviの|I|maxと平均値arvとの差のα倍を平均値arvに加算した値を閾値Thに用いるものであって、係数αを0.2とすれば、平均値arvよりもやや|I|max寄りに閾値Thを設定することになる。
The threshold value Th that separates the object region and the background region is set using the following equation based on the average value arv obtained by Equation 2. The coefficient α in the following expression is appropriately set depending on the density value relationship between the object area and the background area. That is, the user can input the coefficient α as appropriate. However, 0.2 is set as the specified value of the coefficient α.
Th = arv + α · (Imax−arv)
Here, | I | max uses the maximum value of the identification index value rvi when the background area is brighter than the object area (the density value is higher), and the identification index value when the background area is darker than the object area. The minimum value of rvi is used. The above formula uses a value obtained by adding α times the difference between | I | max of the identification index value rvi and the average value arv to the average value arv as the threshold Th, and if the coefficient α is 0.2, The threshold value Th is set slightly closer to | I | max than the average value arv.

上式により求められる閾値Thとの大小関係によって識別指標値rviを分離すれば、物体領域と背景領域とを容易に分離することができる。つまり、背景領域が物体領域よりも明るい場合は識別指標値rviが閾値Thよりも大きくなるブロック連結領域Diが物体領域であり、背景領域が物体領域よりも暗い場合には識別指標値rviが閾値Thよりも小さくなるブロック連結領域Diが物体領域になる。実際の画像では物体領域に対して背景領域が明るい場所と暗い場所とが混在している場合があり、この場合には閾値Thは平均値arvの両側に設定される。つまり、物体領域の上下限を決める2個の閾値Thの間の範囲と、上限の閾値Thを超えて最大値までの範囲と、下限の閾値Thを下回って最小値までの範囲との3段階に分けることができる。   If the identification index value rvi is separated based on the magnitude relationship with the threshold Th obtained by the above equation, the object region and the background region can be easily separated. That is, when the background area is brighter than the object area, the block connection area Di whose identification index value rvi is larger than the threshold value Th is the object area, and when the background area is darker than the object area, the identification index value rvi is the threshold value. A block connection area Di smaller than Th becomes an object area. In an actual image, a place where the background area is light and dark may be mixed with respect to the object area. In this case, the threshold Th is set on both sides of the average value arv. That is, three steps of a range between two threshold values Th that determine the upper and lower limits of the object region, a range that exceeds the upper limit threshold Th and reaches a maximum value, and a range that falls below the lower limit threshold Th and reaches a minimum value. Can be divided into

ところで、一般に撮像時の照明やTVカメラの位置関係によっては背景の濃度値にむらが生じる。とくに、撮像対象を一方向から照明している場合には画像内の特定方向において背景の濃度値にほぼ一定の勾配が生じ、濃度値が徐々に増加または減少する。上述した処理手順では画像の全体を処理対象としているが、濃度値に勾配が生じているような場合には、数2によって求められる識別指標値rviの平均値arvは、物体領域と背景領域との間の値ではなく、背景に対する中間の値になる可能性があり、このような平均値arvによって閾値Thを設定しても背景領域と物体領域とを正確に分離することは困難になる。   By the way, in general, the density value of the background varies depending on the lighting and the positional relationship of the TV camera. In particular, when the imaging target is illuminated from one direction, a substantially constant gradient occurs in the background density value in a specific direction in the image, and the density value gradually increases or decreases. In the processing procedure described above, the entire image is a processing target. However, when a gradient occurs in the density value, the average value arv of the identification index value rvi obtained by Equation 2 is the object region, the background region, May be an intermediate value with respect to the background, and even if the threshold value Th is set by such an average value arv, it is difficult to accurately separate the background region and the object region.

そこで、図9に示すように、画像内を比較的小さい複数の検査領域Fi(図示例ではi=1〜9)に分割し、各検査領域Fiごとに上述した処理を行うようにすれば、背景における濃度値の変化の影響を軽減することができ、背景領域と物体領域とを正確に分離することが可能になる。検査領域Fiは画像内で目的の物体領域を含む対象領域Tiを複数に分割することにより設定される。各検査領域Fiは、物体領域として抽出しようとする既知の検査対象の大きさに合わせて互いに等しい大きさに設定される。たとえば、検査対象が文字であれば検査領域Fiの大きさを文字の大きさ程度に設定する。また、背景に濃度勾配が生じているときには、濃度勾配の方向に沿って検査領域Fiを並べる。あるいはまた、検査対象が文字列であれば、文字列の全体を含むように対象領域Tiを設定し、文字列の並ぶ方向に検査領域Fiを並べる。   Therefore, as shown in FIG. 9, if the image is divided into a plurality of relatively small inspection areas Fi (i = 1 to 9 in the illustrated example) and the above-described processing is performed for each inspection area Fi, The influence of the density value change in the background can be reduced, and the background area and the object area can be accurately separated. The inspection area Fi is set by dividing the target area Ti including the target object area into a plurality of parts in the image. Each inspection area Fi is set to have the same size according to the size of a known inspection object to be extracted as an object area. For example, if the inspection target is a character, the size of the inspection area Fi is set to be about the size of the character. When a density gradient is generated in the background, the inspection areas Fi are arranged along the direction of the density gradient. Alternatively, if the inspection target is a character string, the target area Ti is set so as to include the entire character string, and the inspection area Fi is arranged in the direction in which the character strings are arranged.

上述したように、検査領域Fiは対象領域Tiを分割することにより設定しているから、1個の検査対象が複数個の検査領域Fiに分割されることがある。そこで、図9のように設定した検査領域Fiを、検査領域Fiの配列方向において検査領域Fiの半分の幅寸法分だけ偏移させた検査領域Fj(図示例ではj=11〜19)を設定する(図10参照)。この検査領域Fjを設定すれば、検査領域Fiと検査領域Fjとの一部が互いに重複するから、1つの検査対象の大部分がいずれかの検査領域Fi,Fjに含まれる確率が高まり、背景領域と物体領域とを正確に分離することが可能になる。   As described above, since the inspection area Fi is set by dividing the target area Ti, one inspection target may be divided into a plurality of inspection areas Fi. Therefore, an inspection region Fj (j = 11 to 19 in the illustrated example) is set by shifting the inspection region Fi set as shown in FIG. 9 by the half width of the inspection region Fi in the arrangement direction of the inspection region Fi. (See FIG. 10). If this inspection area Fj is set, the inspection area Fi and the inspection area Fj partially overlap each other, so that the probability that most of one inspection object is included in any of the inspection areas Fi and Fj increases. It becomes possible to accurately separate the region and the object region.

上述のようにして設定した検査領域Fi,Fjのどちらにおいて検査対象の大部分が含まれているかを判断するには、以下の処理手順を用いる。すなわち、図11(a)に示すように検査領域Fiにおいて物体領域Ebを求めた後、対象領域Tiの中でそれぞれひとまとまりとみなせる物体領域Ebに分離する。ひとまとまりとみなせる物体領域Ebは、製品に刻印した文字列のような既知情報を用いる場合には既知情報と物体領域Ebとのパターンマッチングによって類似度の高い領域を抽出すればよく、既知情報を用いることができない場合には抽出された物体領域Ebの間隔を用いる。   In order to determine which of the inspection areas Fi and Fj set as described above contains most of the inspection object, the following processing procedure is used. That is, as shown in FIG. 11A, after obtaining the object region Eb in the inspection region Fi, the object region Eb is separated into the object regions Eb that can be regarded as a group in the target region Ti. The object region Eb that can be regarded as a single unit can be extracted by extracting a region with high similarity by pattern matching between the known information and the object region Eb when using known information such as a character string stamped on a product. If it cannot be used, the interval between the extracted object regions Eb is used.

ひとまとまりとみなせる物体領域Ebが抽出されると、まとまりごとの重心位置Jn(n=1,2,…)を求め、検査領域Fi,Fjの各中心位置Ci,Cjと重心位置Jnとの距離を求める。距離の演算はすべての検査領域Fi,Fjについて行うのではなく、ひとまとまりとみなせる物体領域Ebが含まれる検査領域Fi,Fjについてのみ行えばよい。図示例では、「A」の文字とみなせる物体領域Ebが、検査領域F1,F2,F11に含まれているから、物体領域Ebの重心位置J1と検査領域F1,F2,F11の中心位置C1,C2,C11との距離をそれぞれ求める。求めた距離が最小になる検査領域(図示例ではF11)では、1つの検査対象の大部分が含まれる可能性が高くなるから、この検査領域F11において、物体領域と背景領域とを分離する処理を再び行えば、物体領域と背景領域とを精度よく分離することが可能になる。   When the object region Eb that can be regarded as a unit is extracted, the center of gravity position Jn (n = 1, 2,...) Is obtained for each unit, and the distance between the center positions Ci and Cj of the inspection regions Fi and Fj and the center of gravity position Jn. Ask for. The calculation of the distance is not performed for all the inspection areas Fi and Fj, but only for the inspection areas Fi and Fj including the object area Eb that can be regarded as a unit. In the illustrated example, the object area Eb that can be regarded as the character “A” is included in the inspection areas F1, F2, and F11. Therefore, the center position C1 of the object area Eb and the center positions C1, C1 of the inspection areas F1, F2, and F11 are included. The distances from C2 and C11 are obtained. In the inspection area (F11 in the illustrated example) in which the obtained distance is the minimum, there is a high possibility that most of one inspection object is included. Therefore, in this inspection area F11, the object area and the background area are separated. If it is performed again, the object region and the background region can be accurately separated.

たとえば、図11(a)に示す例では、「A」と「P」との文字に相当する物体領域Ebがそれぞれ検査対象になるが、検査領域Fiにおいては境界線が「A」と「P」との各文字をほぼ半分に分断するように設定されており、検査領域F2においては「A」と「P」との文字の一部ずつが含まれている。これに対して、図11(b)に示す検査領域Fjにおいては各検査領域F11,F12に「A」と「P」との文字のほぼ全体がそれぞれ含まれるから、検査領域F11,F12において物体領域と背景領域とを分離すれば、検査対象に対応する物体領域を背景領域から正確に分離できる可能性が高くなる。   For example, in the example shown in FIG. 11A, the object areas Eb corresponding to the characters “A” and “P” are to be inspected, but in the inspection area Fi, the boundary lines are “A” and “P”. Is set so as to be divided almost in half, and the inspection area F2 includes a part of each of the characters “A” and “P”. On the other hand, in the inspection area Fj shown in FIG. 11B, since the inspection areas F11 and F12 include almost the entire characters “A” and “P”, the objects in the inspection areas F11 and F12 are included. If the region and the background region are separated, there is a high possibility that the object region corresponding to the inspection target can be accurately separated from the background region.

本発明の実施形態を示す動作説明図である。It is operation | movement explanatory drawing which shows embodiment of this invention. 同上のブロック図である。It is a block diagram same as the above. 同上の動作の概要を示す動作説明図である。It is operation | movement explanatory drawing which shows the outline | summary of operation | movement same as the above. 同上においてブロックを設定した状態の動作説明図である。It is operation | movement explanatory drawing in the state which set the block in the same as the above. 同上においてブロック連結領域を形成した状態の動作説明図である。It is operation | movement explanatory drawing in the state which formed the block connection area | region in the same as the above. 同上の動作説明図である。It is operation | movement explanatory drawing same as the above. 同上の動作説明図である。It is operation | movement explanatory drawing same as the above. 同上の動作説明図である。It is operation | movement explanatory drawing same as the above. 同上の動作説明図である。It is operation | movement explanatory drawing same as the above. 同上の動作説明図である。It is operation | movement explanatory drawing same as the above. 同上の動作説明図である。It is operation | movement explanatory drawing same as the above.

符号の説明Explanation of symbols

1 対象物
2 撮像装置
3 モニタ
10 画像処理装置
11 A/D変換器
12 記憶手段
13 画像分割処理装置
14 特徴量演算部
15 追跡処理部
16 ブロック分割処理部
DESCRIPTION OF SYMBOLS 1 Object 2 Imaging device 3 Monitor 10 Image processing device 11 A / D converter 12 Storage means 13 Image division processing device 14 Feature amount calculation unit 15 Tracking processing unit 16 Block division processing unit

Claims (3)

多値画像をそれぞれ複数個の画素を含む矩形状の複数個のブロックに分割した後に、ブロック内の画素値の分布に関する特徴量を隣接する各一対のブロック間で比較し特徴量の類似度が規定値以上である各一対のブロックには同じラベルを付与するとともに特徴量の類似度が規定値未満である各一対のブロックには異なるラベルを付与して前記多値画像内のすべてのブロックにラベルを付与し、さらに、同ラベルが付与されているブロックからなるブロック連結領域の境界部分に位置するブロックを複数個の分割ブロックに分割するとともに、分割前のブロックに隣接するブロックの前記特徴量と分割ブロックの画素値の分布に関する特徴量との類似度が規定値以上になるときに隣接するブロックと同じラベルを当該分割ブロックに付与することにより当該分割ブロックを前記ブロック連結領域を構成するブロックとして前記ブロック連結領域に統合し、分割ブロックに分割し分割ブロックをブロック連結領域に統合する処理を繰り返すことにより多値画像に含まれる全画素をいずれかのブロック連結領域に統合する第1過程と、ラスタ走査によりブロック連結領域の境界を探索し、ブロック連結領域の境界を中心として複数のブロック連結領域を含む判断領域を設定し、前記境界を挟む2個のブロック連結領域のうちの一方のブロック連結領域を着目するブロック連結領域とし、他方のブロック連結領域が判断領域に占める面積の割合に他方のブロック連結領域の平均濃度値に乗じた値を濃度評価値として求める第2過程と、前記着目するブロック連結領域の平均濃度値と濃度評価値との差をパラメータとする識別評価値を求める第3過程と、前記識別評価値と規定の閾値との大小を比較することにより前記着目するブロック連結領域と前記着目するブロック領域に対する周辺のブロック連結領域とを分離する第4過程とを有することを特徴とする画像処理方法。 After dividing the multivalued image into a plurality of rectangular blocks each including a plurality of pixels, the feature values related to the distribution of pixel values in the block are compared between adjacent pairs of blocks, and the similarity of the feature values is determined. The same label is assigned to each pair of blocks that are equal to or greater than the specified value, and a different label is assigned to each pair of blocks that have a feature value similarity less than the specified value to all the blocks in the multi-valued image. The feature value of the block adjacent to the block before dividing the block is divided into a plurality of divided blocks, and the block located at the boundary portion of the block connection area composed of the blocks to which the label is attached is assigned. When the similarity between the divided block and the feature value relating to the pixel value distribution of the divided block exceeds a specified value, the same label as the adjacent block is given to the divided block All the pixels included in the multi-valued image by repeating the process of integrating the divided block into the block connected area as a block constituting the block connected area and dividing the divided block into the block connected area. The boundary of the block connection area is searched by raster scanning , a determination area including a plurality of block connection areas is set around the boundary of the block connection area, and the boundary One block connection area of two block connection areas sandwiching the block is defined as a block connection area of interest, and the ratio of the area occupied by the other block connection area to the determination area is multiplied by the average density value of the other block connection area. a second process of obtaining a value as the density evaluation value, the average density value and the density Review of blocks connected region the noted Third step and said identification evaluation value and the focus is near to the block region the noted block coupling region block by comparing the magnitude of the specified threshold value to determine the identity evaluation value for the difference between the value and the parameter An image processing method comprising: a fourth step of separating the connection area. 多値画像をそれぞれ複数個の画素を含む矩形状の複数個のブロックに分割した後に、ブロック内の画素値の分布に関する特徴量を隣接する各一対のブロック間で比較し特徴量の類似度が規定値以上である各一対のブロックには同じラベルを付与するとともに特徴量の類似度が規定値未満である各一対のブロックには異なるラベルを付与して前記多値画像内のすべてのブロックにラベルを付与し、さらに、同ラベルが付与されているブロックからなるブロック連結領域の境界部分に位置するブロックを複数個の分割ブロックに分割するとともに、分割前のブロックに隣接するブロックの前記特徴量と分割ブロックの画素値の分布に関する特徴量との類似度が規定値以上になるときに隣接するブロックと同じラベルを当該分割ブロックに付与することにより当該分割ブロックを前記ブロック連結領域を構成するブロックとして前記ブロック連結領域に統合し、分割ブロックに分割し分割ブロックをブロック連結領域に統合する処理を繰り返すことにより多値画像に含まれる全画素をいずれかのブロック連結領域に統合する第1過程と、ラスタ走査によりブロック連結領域の境界を探索し、ブロック連結領域の境界を中心として複数のブロック連結領域を含む判断領域を設定し、判断領域に少なくとも一部が含まれる各ブロック連結領域のうち着目するブロック連結領域以外のブロック連結領域が判断領域に占める面積の割合を重み係数とし各ブロック連結領域の平均濃度値に重み係数を乗じて平均した加重平均値を濃度評価値として求める第2過程と、前記着目するブロック連結領域の平均濃度値と濃度評価値との差をパラメータとする識別評価値を求める第3過程と、前記識別評価値と規定の閾値との大小を比較することにより前記着目するブロック連結領域と前記着目するブロック領域に対する周辺のブロック連結領域とを分離する第4過程とを有することを特徴とする画像処理方法。 After dividing the multivalued image into a plurality of rectangular blocks each including a plurality of pixels, the feature values related to the distribution of pixel values in the block are compared between adjacent pairs of blocks, and the similarity of the feature values is determined. The same label is assigned to each pair of blocks that are equal to or greater than the specified value, and a different label is assigned to each pair of blocks that have a feature value similarity less than the specified value to all the blocks in the multi-valued image. The feature value of the block adjacent to the block before dividing the block is divided into a plurality of divided blocks, and the block located at the boundary portion of the block connection area composed of the blocks to which the label is attached is assigned. When the similarity between the divided block and the feature value relating to the pixel value distribution of the divided block exceeds a specified value, the same label as the adjacent block is given to the divided block All the pixels included in the multi-valued image by repeating the process of integrating the divided block into the block connected area as a block constituting the block connected area and dividing the divided block into the block connected area. The boundary of the block connection area is searched by raster scanning, and a determination area including a plurality of block connection areas is set around the boundary of the block connection area. The ratio of the area occupied by the block connection area other than the target block connection area to the judgment area among the block connection areas that are at least partially included in is determined by multiplying the average density value of each block connection area by the weight coefficient and averaging A second process of obtaining the weighted average value as a density evaluation value, and the block connection region of interest The third process of obtaining the identification evaluation value using the difference between the average density value and the density evaluation value as a parameter, and comparing the size of the identification evaluation value with a specified threshold value, and the block connection region of interest and the focus of attention. fourth images processing how to; and a step of separating the block coupling region near to the block area. 前記第2過程では、求めた前記濃度評価値を着目するブロック連結領域の画素値とする評価画像データを生成し、濃度評価値が一度求められたブロック連結領域については濃度評価値を再度求めないことを特徴とする請求項1または請求項2に記載の画像処理方法。 In the second process, evaluation image data is generated with the obtained density evaluation value as a pixel value of the block connection area to which attention is paid, and the density evaluation value is not obtained again for the block connection area for which the density evaluation value has been obtained once. image processing how according to claim 1 or claim 2, characterized in that.
JP2004156816A 2004-05-26 2004-05-26 Image processing method Active JP4534599B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004156816A JP4534599B2 (en) 2004-05-26 2004-05-26 Image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004156816A JP4534599B2 (en) 2004-05-26 2004-05-26 Image processing method

Publications (2)

Publication Number Publication Date
JP2005339180A JP2005339180A (en) 2005-12-08
JP4534599B2 true JP4534599B2 (en) 2010-09-01

Family

ID=35492688

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004156816A Active JP4534599B2 (en) 2004-05-26 2004-05-26 Image processing method

Country Status (1)

Country Link
JP (1) JP4534599B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5398519B2 (en) * 2009-12-25 2014-01-29 キヤノン株式会社 Object identification device, object identification method, and program
JP2012093131A (en) * 2010-10-25 2012-05-17 Panasonic Corp Distance image sensor
JP6703672B1 (en) * 2019-07-16 2020-06-03 株式会社テクムズ Defect detection method for inspection target product, apparatus therefor, and computer program therefor
CN115320258A (en) * 2022-08-09 2022-11-11 深圳市国人光速科技有限公司 Method and system for simultaneously spraying and printing circuit board identification characters and variable dynamic two-dimensional codes

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004030188A (en) * 2002-06-25 2004-01-29 Matsushita Electric Works Ltd Method, apparatus and program for dividing image into areas

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004030188A (en) * 2002-06-25 2004-01-29 Matsushita Electric Works Ltd Method, apparatus and program for dividing image into areas

Also Published As

Publication number Publication date
JP2005339180A (en) 2005-12-08

Similar Documents

Publication Publication Date Title
CN107705288A (en) Hazardous gas spillage infrared video detection method under pseudo- target fast-moving strong interferers
CN106446750A (en) Bar code reading method and device
CN110335233B (en) Highway guardrail plate defect detection system and method based on image processing technology
CN105678318B (en) The matching process and device of traffic sign
CN109740572A (en) A kind of human face in-vivo detection method based on partial color textural characteristics
CN103914708A (en) Food variety detection method and system based on machine vision
KR101549495B1 (en) An apparatus for extracting characters and the method thereof
KR101813223B1 (en) Method and apparatus for detecting and classifying surface defect of image
CN113012096A (en) Display screen sub-pixel positioning and brightness extraction method, device and storage medium
Saidane et al. Robust binarization for video text recognition
JP4062987B2 (en) Image area dividing method, image area dividing apparatus, and image area dividing program
JP4534599B2 (en) Image processing method
Kusanti et al. Combination of otsu and canny method to identify the characteristics of solo batik as Surakarta traditional batik
Salih et al. Adaptive local exposure based region determination for non-uniform illumination and low contrast images
Zhang et al. A license plate recognition system based on tamura texture in complex conditions
CN111951322A (en) Camera module quality detection method and device and computer storage medium
CN103778431A (en) Medical image characteristic extracting and identifying system based on two-directional grid complexity measurement
Peres et al. Automatic segmentation of digital images applied in cardiac medical images
Guo et al. Fault diagnosis of power equipment based on infrared image analysis
CN111160080A (en) Intelligent automobile appearance consistency detection system based on image recognition
JP2005184787A (en) Image processing method and device
KR101667877B1 (en) Feature detecting method for fish image and fish identification method using feature of fish image
Yang et al. A novel binarization approach for license plate
CN113989307A (en) Image semantic segmentation method, electronic device and storage medium
KR20030005342A (en) Finding objects in an image

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070313

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100208

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100216

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100419

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20100525

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100607

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130625

Year of fee payment: 3

R151 Written notification of patent or utility model registration

Ref document number: 4534599

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151