JP4661529B2 - Image processing device - Google Patents
Image processing device Download PDFInfo
- Publication number
- JP4661529B2 JP4661529B2 JP2005316722A JP2005316722A JP4661529B2 JP 4661529 B2 JP4661529 B2 JP 4661529B2 JP 2005316722 A JP2005316722 A JP 2005316722A JP 2005316722 A JP2005316722 A JP 2005316722A JP 4661529 B2 JP4661529 B2 JP 4661529B2
- Authority
- JP
- Japan
- Prior art keywords
- pixel
- label
- unit
- image data
- stored
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Landscapes
- Image Analysis (AREA)
Description
本発明は、画像データを走査して、画像データに含まれる連結された画素群からなる図形の特徴量を算出する画像処理装置に関する。 The present invention relates to an image processing apparatus that scans image data and calculates a feature amount of a graphic composed of connected pixel groups included in the image data.
従来より、カメラにより撮像された画像データから、文字、絵等の図形を認識するための画像処理装置として、連結された画素群からなる図形の面積、重心、周囲長等の特徴量を算出するものが知られている。 Conventionally, as image processing devices for recognizing figures such as characters and pictures from image data captured by a camera, feature quantities such as area, center of gravity, and perimeter of a figure composed of connected pixel groups are calculated. Things are known.
そして、このような画像処理装置として、取得した画像データを、各画素毎に、図形の要素となる図形画素(例えば、黒画素)であるか、図形画素以外の背景画素(例えば、白画素)であるかを表す二値データに変換し、次に、図形の識別情報であるラベルを、連結された図形画素に同一のラベルが付与されるように、各図形画素毎に付与し、更に、同一のラベルが付与された画素群を1つの図形として、この画素群の特徴量を算出することで、画像データに含まれる図形の特徴量を算出する装置が提案されている(例えば特許文献1等参照)。
しかしながら、上記提案の画像処理装置では、画像データを走査して、各画素毎にラベルを付与すると共に、図形の特徴量を算出する処理を行うが、ラベルを付与する図形画素が、異なるラベルにより特定される別の図形同士を連結する画素である場合には、これらの異なるラベルにより特定される図形は、1つの図形を形成するものであるとして、このような画素を処理する度に、画像データを構成する全ての画素から、これらのラベルが付与された図形画素を検索してラベルを一致させ、ラベルを一致させた図形画素からなる画素群の特徴量を算出するようにしている。 However, the proposed image processing apparatus scans the image data and assigns a label to each pixel and calculates the feature amount of the graphic. The graphic pixel to which the label is applied depends on a different label. In the case of pixels that connect other specified graphics, it is assumed that the graphics specified by these different labels form one graphic, and every time such pixels are processed, the image The graphic pixels to which these labels are assigned are searched from all the pixels constituting the data, the labels are matched, and the feature amount of the pixel group including the graphic pixels with the matched labels is calculated.
このため、1つの画素に対する処理に時間がかかり、次の画素の処理を開始するタイミングが遅くなるので、1画面の画像データの走査時間が長くなるという問題があった。そして、この画像データの走査時間は、ビデオカメラが1画面分の画像データを出力するのに要する時間(一般的に、1秒間に30画面分の画像データを出力するため、約33ms)より長くなるために、上記提案の画像装置においては、カメラから入力された画像データを、連続的に処理することができなかった。 For this reason, the processing for one pixel takes time, and the timing for starting the processing for the next pixel is delayed, which causes a problem that the scanning time of image data for one screen becomes long. The scanning time of the image data is longer than the time required for the video camera to output the image data for one screen (generally, about 33 ms because the image data for 30 screens is output per second). Therefore, in the proposed image apparatus, the image data input from the camera cannot be processed continuously.
本発明は、こうした問題に鑑みなされたもので、画像データに含まれる連結された画素群からなる図形の特徴量を算出する画像処理装置において、1画面の画像データの走査時間を短縮し、画像データを連続的に処理できるようにすることを目的とする。 The present invention has been made in view of such problems, and in an image processing apparatus that calculates a feature amount of a graphic composed of connected pixel groups included in image data, the scanning time of image data on one screen is shortened, and the image The purpose is to enable continuous processing of data.
かかる目的を達成するためになされた請求項1に記載の発明においては、画像データが入力されると、二値化手段が、その画像データを、各画素毎に、図形の要素となる図形画素であるか、図形画素以外の背景画素であるかを表す二値データに変換する。すると、画素判定手段が、二値化手段により二値データに変換された画像データを走査して、この画像データから図形画素を順次注目画素として抽出し、抽出した注目画素の周囲の画素のラベルを画素情報記憶手段から取得し、取得した周囲の画素のラベルに基づいて、この注目画素が、新たな図形を形成する新規画素であるか、または、既に形成された図形の一部となる追加画素であるかを判定し、この注目画素が追加画素である場合には、更に、この追加画素が複数の異なる図形を連結させる連結画素であるか否かを判定する。 In the invention according to claim 1, which is made to achieve the above object, when image data is inputted, the binarizing means converts the image data into graphic pixels which become graphic elements for each pixel. Or binary data representing whether the pixel is a background pixel other than a graphic pixel. Then, the pixel determination unit scans the image data converted into binary data by the binarization unit, sequentially extracts graphic pixels as the target pixel from the image data, and labels the pixels around the extracted target pixel. From the pixel information storage means, and based on the acquired labels of surrounding pixels, the pixel of interest is a new pixel that forms a new figure or an addition that becomes a part of an already formed figure It is determined whether the pixel of interest is an additional pixel. If the pixel of interest is an additional pixel, it is further determined whether the additional pixel is a connected pixel that connects a plurality of different figures.
そして、画素判定手段により注目画素が新規画素であると判定されると、新規ラベル発行手段が、新規にラベルを発行し、画素判定手段により注目画素が連結画素であると判定されると、連結情報格納手段が、この連結画素にて複数の図形が連結されていることを表す連結情報を連結情報記憶手段に格納する。 When the pixel determination unit determines that the target pixel is a new pixel, the new label issuing unit issues a new label, and when the pixel determination unit determines that the target pixel is a connected pixel, The information storage means stores connection information indicating that a plurality of figures are connected at the connection pixel in the connection information storage means.
更に、画素判定手段により注目画素が新規画素であると判定されると、初期値設定手段が、新規ラベル発行手段により発行された新規ラベルをラベル記憶手段に格納すると共に、この新規ラベルにて特定される図形の特徴量として、初期値を特徴量記憶手段に格納し、更に、新規ラベルを注目画素のラベルとして画素情報記憶手段に格納する。また、画素判定手段により注目画素が追加画素であると判定されると、既存値更新手段が、特徴量記憶手段に記憶された図形の特徴量のうち、この追加画素がその一部となる図形の特徴量を更新し、更に、この追加画素がその一部となる図形のラベルを注目画素のラベルとして画素情報記憶手段に格納する。 Further, when the pixel determination unit determines that the pixel of interest is a new pixel, the initial value setting unit stores the new label issued by the new label issuing unit in the label storage unit and specifies the new label. The initial value is stored in the feature amount storage unit as the feature amount of the figure to be processed, and the new label is stored in the pixel information storage unit as the label of the target pixel. In addition, when the pixel determination unit determines that the target pixel is an additional pixel, the existing value update unit includes a figure in which the additional pixel is a part of the feature amount of the figure stored in the feature amount storage unit. The feature amount is updated, and the label of the graphic in which the additional pixel is a part thereof is stored in the pixel information storage means as the label of the target pixel.
そして、画素判定手段による1画面分の画像データの走査が終了し、画素判定手段の判定に基づく、新規ラベル発行手段、連結情報格納手段、初期値設定手段、既存値更新手段の動作が完了すると、特徴量更新手段が、連結情報記憶手段に記憶された連結情報に基づいて、ラベル記憶手段に記憶されたラベルのうち、同一図形と認識された各図形のラベルを書き換えて一致させ、特徴量記憶手段に記憶された図形の特徴量のうち、ラベルが一致される前の各ラベルにて特定される各図形の特徴量を合成し、合成した特徴量を一致されたラベルにて特定される図形の特徴量として特徴量記憶手段に格納する。 When the scanning of the image data for one screen by the pixel determining unit is completed, the operations of the new label issuing unit, the link information storing unit, the initial value setting unit, and the existing value updating unit based on the determination of the pixel determining unit are completed. The feature amount updating means rewrites and matches the labels of the respective figures recognized as the same figure among the labels stored in the label storage means based on the connection information stored in the connection information storage means, Of the feature quantities of the figure stored in the storage means, the feature quantities of each figure specified by each label before matching the labels are synthesized, and the synthesized feature quantities are specified by the matched labels. It is stored in the feature amount storage means as the feature amount of the figure.
つまり、本発明の画像処理装置においては、1画面分の画像データの走査をする間は、特徴量を完全には算出せず、特徴量を算出するために必要な情報のみをラベル記憶手段、連結情報記憶手段、特徴量記憶手段に格納し、1画面分の画像データの走査を終了してから、走査時に各記憶手段に記憶された情報に基づいて図形の特徴量を算出する。このため、画像データを走査しつつ、図形の特徴量を算出する場合に比べ、画像データの走査時間を短縮することができ、例えば、カメラ等の撮像装置から1画面毎に順次入力される画像データから、画像データに含まれる図形の特徴量を算出する場合にも、撮像装置が画像データを出力するタイミングに間に合うように画像データを走査することができ、連続して処理を行うことができる。 That is, in the image processing apparatus of the present invention, while scanning image data for one screen, the feature amount is not completely calculated, and only the information necessary for calculating the feature amount is stored in the label storage unit, After the scanning of the image data for one screen is completed and stored in the connection information storage means and the feature amount storage means, the feature amount of the figure is calculated based on the information stored in each storage means at the time of scanning. For this reason, the scanning time of the image data can be shortened as compared with the case where the feature amount of the graphic is calculated while scanning the image data. For example, images sequentially input from the imaging device such as a camera for each screen. Even when the feature amount of a graphic included in image data is calculated from the data, the image data can be scanned in time for the timing at which the imaging apparatus outputs the image data, and processing can be performed continuously. .
ところで、画素判定手段により1画面の画像データが走査され、上記各手段により図形の特徴量を算出するためのデータの各記憶手段への格納が完了する時間と、特徴量更新手段が、記憶手段群に記憶されたデータに基づいて図形の特徴量を算出する時間とを合わせた時間が、画素判定手段が、1画面分の画像データの取得を開始してから次の画面の画像データの取得を開始するまでの時間よりも短い場合には、画素判定手段が、次の画面の画像データの走査を開始する時点において、走査の終了した画像データに含まれる図形の特徴量の算出も終了している。しかしながら、各手段を構成するロジック回路、または、CPU等の性能により、画素判定手段が、次の画面の画像データの走査を開始する時点において、特徴量更新手段による前の画面の図形の特徴量の算出が終了していない場合があり、この場合には、特徴量更新手段が使用中の各記憶手段に、次の画面の情報が書き込まれてしまい、特徴量更新手段が算出中の前の画面の図形の特徴量が正確に算出できなくなるという問題がある。
そこで、請求項1の発明のように、記憶手段群を複数設け、1画面分の画像データの走査にて得られた図形の特徴量を算出するための情報を、初期値設定手段と、既存値更新手段と、連結情報格納手段とが、複数の記憶手段群に順次書き込み、特徴量更新手段が、複数の記憶手段群を順次選択するようにすれば、特徴量更新手段が、初期値設定手段と、既存値更新手段と、連結情報格納手段とが、共通に使用している記憶手段群を同時に使用しないようにすることができる。よって、特徴量更新手段が使用中である記憶手段群に、上記各手段により次の画像の情報が書き込まれることを防止できるので、確実に図形の特徴量の算出を行うことができる。また、特徴量更新手段による特徴量の算出と画素判定手段による画像データの走査とを並列に行うことができるので、画像データを取り込む速度を上げることも可能となる。
また、請求項2の発明では、前記請求項1の発明と同様に、画像データが入力されると、二値化手段が、その画像データを、各画素毎に、図形の要素となる図形画素であるか、図形画素以外の背景画素であるかを表す二値データに変換する。すると、画素判定手段が、二値化手段により二値データに変換された画像データを走査して、この画像データから図形画素を順次注目画素として抽出し、抽出した注目画素の周囲の画素のラベルを画素情報記憶手段から取得し、取得した周囲の画素のラベルに基づいて、この注目画素が、新たな図形を形成する新規画素であるか、または、既に形成された図形の一部となる追加画素であるかを判定し、この注目画素が追加画素である場合には、更に、この追加画素が複数の異なる図形を連結させる連結画素であるか否かを判定する。
そして、画素判定手段により注目画素が新規画素であると判定されると、新規ラベル発行手段が、新規にラベルを発行し、画素判定手段により注目画素が連結画素であると判定されると、連結情報格納手段が、この連結画素にて複数の図形が連結されていることを表す連結情報を連結情報記憶手段に格納する。
更に、画素判定手段により注目画素が新規画素であると判定されると、初期値設定手段が、新規ラベル発行手段により発行された新規ラベルをラベル記憶手段に格納すると共に、この新規ラベルにて特定される図形の特徴量として、初期値を特徴量記憶手段に格納し、更に、新規ラベルを注目画素のラベルとして画素情報記憶手段に格納する。また、画素判定手段により注目画素が追加画素であると判定されると、既存値更新手段が、特徴量記憶手段に記憶された図形の特徴量のうち、この追加画素がその一部となる図形の特徴量を更新し、更に、この追加画素がその一部となる図形のラベルを注目画素のラベルとして画素情報記憶手段に格納する。
そして、画素判定手段による1画面分の画像データの走査が終了し、画素判定手段の判定に基づく、新規ラベル発行手段、連結情報格納手段、初期値設定手段、既存値更新手段の動作が完了すると、特徴量更新手段が、連結情報記憶手段に記憶された連結情報に基づいて、ラベル記憶手段に記憶されたラベルのうち、同一図形と認識された各図形のラベルを書き換えて一致させ、特徴量記憶手段に記憶された図形の特徴量のうち、ラベルが一致される前の各ラベルにて特定される各図形の特徴量を合成し、合成した特徴量を一致されたラベルにて特定される図形の特徴量として特徴量記憶手段に格納する。
つまり、請求項2の発明の画像処理装置においては、1画面分の画像データの走査をする間は、特徴量を完全には算出せず、特徴量を算出するために必要な情報のみをラベル記憶手段、連結情報記憶手段、特徴量記憶手段に格納し、1画面分の画像データの走査を終了してから、走査時に各記憶手段に記憶された情報に基づいて図形の特徴量を算出する。このため、画像データを走査しつつ、図形の特徴量を算出する場合に比べ、画像データの走査時間を短縮することができ、例えば、カメラ等の撮像装置から1画面毎に順次入力される画像データから、画像データに含まれる図形の特徴量を算出する場合にも、撮像装置が画像データを出力するタイミングに間に合うように画像データを走査することができ、連続して処理を行うことができる。
ところで、画像処理装置には、請求項1に記載のように、記憶手段群を複数設けても良いが、この場合には、多くの記憶領域が必要となる。ここで、一般的に、特徴量更新手段が、記憶手段群に記憶された情報から、1画面分の画像データに含まれる図形の特徴量の算出を行う時間は、1画面毎に画像データを出力するカメラ等の撮像装置が、画像データを出力してから次の画像データを出力するまでの時間よりも十分に短く、各記憶手段へのデータの格納が完了した後、短時間のうちに図形の特徴量の算出は終了する。つまり、カメラ等の撮像装置から出力された画像データを、撮像装置から直接取得するような場合には、図形の特徴量の算出を行うための情報を記憶するための記憶手段群は、2つあれば十分である。
そこで、請求項2の発明のように、記憶手段群を2つ設け、この記憶手段群が交互に使用されるようにすると、特に、カメラ等の撮像装置により撮像された画像データを、撮像装置から直接取得するような場合には、特徴量更新手段が特徴量を算出している間に、次の画像データの情報が、特徴量更新手段が使用している記憶手段群に書き込まれることはなく、最小限の記憶領域で、確実に図形の特徴量を算出することが可能となる。
ところで、連結情報格納手段は、連結している図形のラベルの組合せを連結情報記憶手段に順次格納するように構成してもよいが、この場合、ラベルの組合せを記憶するための記憶領域を多く必要とする。そこで、請求項3に記載のように、画素判定手段により、注目画素が図形を連結する連結画素であると判定されると、連結情報格納手段が、図形を特定する全てのラベルのうち、2つのラベルからなる全てのラベルの組合せに対し、連結状態、または、非連結状態を設定するようにするとよく、このようにすれば、連結情報格納手段が、一度記憶したラベルの組合せを、再度記憶してしまうことがなく無駄に記憶領域を使用することを防止できる。また、特徴量更新手段が、特徴量を算出する際には、同じラベルの組合せに対して、何度もラベルの書き換えを試みることがないので、処理時間を短縮することができる。
By the way, image data of one screen is scanned by the pixel determining means, and the time for completing the storage of the data for calculating the feature quantity of the figure in each storage means by each of the above means, and the feature quantity updating means are stored in the storage means. Acquisition of image data for the next screen after the pixel determination means starts acquiring image data for one screen, which is the time combined with the time for calculating the feature amount of the figure based on the data stored in the group When the pixel determination means starts scanning the image data of the next screen, the calculation of the feature amount of the graphic included in the scanned image data is also completed. ing. However, at the time when the pixel determination unit starts scanning the image data of the next screen due to the performance of the logic circuit constituting each unit or the CPU, the feature amount of the graphic on the previous screen by the feature amount update unit In this case, the information on the next screen is written in each storage means being used by the feature amount update means, and the feature amount update means before the calculation is in progress. There is a problem that the feature amount of the figure on the screen cannot be calculated accurately.
Therefore, as in the first aspect of the invention, there are provided a plurality of storage means groups, and information for calculating the feature amount of the figure obtained by scanning the image data for one screen includes the initial value setting means and the existing value setting means. If the value updating unit and the linked information storage unit sequentially write to the plurality of storage unit groups, and the feature amount updating unit sequentially selects the plurality of storage unit groups, the feature amount updating unit sets the initial value. It is possible to prevent the means, the existing value updating means, and the linked information storage means from simultaneously using the storage means group that is used in common. Therefore, it is possible to prevent the information of the next image from being written into the storage means group that is being used by the feature quantity update means, so that the feature quantity of the figure can be reliably calculated. Further, since the calculation of the feature amount by the feature amount update unit and the scanning of the image data by the pixel determination unit can be performed in parallel, it is possible to increase the speed of capturing the image data.
In the invention of claim 2, as in the invention of claim 1, when image data is input, the binarizing means converts the image data into graphic pixels which are graphic elements for each pixel. Or binary data representing whether the pixel is a background pixel other than a graphic pixel. Then, the pixel determination unit scans the image data converted into binary data by the binarization unit, sequentially extracts graphic pixels as the target pixel from the image data, and labels the pixels around the extracted target pixel. From the pixel information storage means, and based on the acquired labels of surrounding pixels, the pixel of interest is a new pixel that forms a new figure or an addition that becomes a part of an already formed figure It is determined whether the pixel of interest is an additional pixel. If the pixel of interest is an additional pixel, it is further determined whether the additional pixel is a connected pixel that connects a plurality of different figures.
When the pixel determination unit determines that the target pixel is a new pixel, the new label issuing unit issues a new label, and when the pixel determination unit determines that the target pixel is a connected pixel, The information storage means stores connection information indicating that a plurality of figures are connected at the connection pixel in the connection information storage means.
Further, when the pixel determination unit determines that the pixel of interest is a new pixel, the initial value setting unit stores the new label issued by the new label issuing unit in the label storage unit and specifies the new label. The initial value is stored in the feature amount storage unit as the feature amount of the figure to be processed, and the new label is stored in the pixel information storage unit as the label of the target pixel. In addition, when the pixel determination unit determines that the target pixel is an additional pixel, the existing value update unit includes a figure in which the additional pixel is a part of the feature amount of the figure stored in the feature amount storage unit. The feature amount is updated, and the label of the graphic in which the additional pixel is a part thereof is stored in the pixel information storage means as the label of the target pixel.
When the scanning of the image data for one screen by the pixel determining unit is completed, the operations of the new label issuing unit, the link information storing unit, the initial value setting unit, and the existing value updating unit based on the determination of the pixel determining unit are completed. The feature amount updating means rewrites and matches the labels of the respective figures recognized as the same figure among the labels stored in the label storage means based on the connection information stored in the connection information storage means, Of the feature quantities of the figure stored in the storage means, the feature quantities of each figure specified by each label before matching the labels are synthesized, and the synthesized feature quantities are specified by the matched labels. It is stored in the feature amount storage means as the feature amount of the figure.
In other words, in the image processing apparatus according to the second aspect of the present invention, the feature amount is not completely calculated while scanning the image data for one screen, and only the information necessary for calculating the feature amount is labeled. A feature value of a figure is calculated based on information stored in each storage means at the time of scanning after being stored in a storage means, a connection information storage means, and a feature value storage means, and scanning of image data for one screen is completed. . For this reason, the scanning time of the image data can be shortened as compared with the case where the feature amount of the graphic is calculated while scanning the image data. For example, images sequentially input from the imaging device such as a camera for each screen. Even when the feature amount of a graphic included in image data is calculated from the data, the image data can be scanned in time for the timing at which the imaging apparatus outputs the image data, and processing can be performed continuously. .
By the way, as described in claim 1, the image processing apparatus may be provided with a plurality of storage means groups, but in this case, a large number of storage areas are required. Here, in general, the time for the feature amount updating unit to calculate the feature amount of the graphic included in the image data for one screen from the information stored in the storage unit group is the image data for each screen. The imaging device such as a camera to output is sufficiently shorter than the time from the output of image data to the output of the next image data, and in a short time after the storage of data in each storage means is completed. The calculation of the feature amount of the figure ends. That is, when image data output from an imaging device such as a camera is directly acquired from the imaging device, there are two storage means groups for storing information for calculating the feature quantity of the figure. If there is enough.
Therefore, when two storage means groups are provided and the storage means groups are used alternately as in the second aspect of the invention, in particular, image data captured by an imaging apparatus such as a camera is captured by the imaging apparatus. When the feature amount update unit calculates the feature amount, the next image data information is written to the storage unit group used by the feature amount update unit. Therefore, it is possible to reliably calculate the feature amount of the figure with the minimum storage area.
By the way, the connection information storage means may be configured to sequentially store the combination of labels of connected figures in the connection information storage means, but in this case, the storage area for storing the combination of labels is increased. I need. Therefore, as described in claim 3 , when the pixel determination unit determines that the target pixel is a connection pixel that connects the graphics, the connection information storage unit stores 2 of all the labels that specify the graphic. It is preferable to set a connected state or a non-connected state for all label combinations consisting of one label, and in this way, the connection information storage means stores again the combination of labels once stored. It is possible to prevent the storage area from being used in vain. In addition, when the feature amount updating unit calculates the feature amount, it does not attempt to rewrite the label repeatedly for the same label combination, so that the processing time can be shortened.
ところで、ラベル記憶手段において、発行順位の遅い方のラベルの発行順の領域が書き換えられていない場合は、ラベルの組合せの各発行順の領域に記憶されたラベルのうち、発行順位の遅い方のラベルの発行順の領域に記憶されたラベルは、必ず、発行順位の早い方のラベルの発行順の領域に記憶されたラベルより遅い発行順位のラベルである。そして、連結情報格納手段にてラベルの組合せに対して設定された状態を、特徴量更新手段が、発行順位の早いラベルを含む組合せから順に読み出すようにすると、上述した場合において、発行順位の遅い方のラベルに書き換えられる組合せは、まだ読み出されておらず、ラベル記憶手段において、発行順位の遅い方のラベルに書き換えられた領域は存在しない。 By the way, in the label storage means, when the issue order area of the label with the later issue order is not rewritten, the label with the later issue order among the labels stored in the issue order areas of the label combination. The label stored in the label issue order area is always the label with the issue order later than the label stored in the issue order area of the label with the earlier issue order. Then, when the feature amount updating unit reads the state set for the combination of labels in the connection information storage unit in order from the combination including the label with the earlier issuance order, in the above-described case, the issuance order is slow. The combination that can be rewritten to the label has not been read yet, and there is no area that has been rewritten to the label with the later issue order in the label storage means.
そこで、請求項4に記載のように、特徴量更新手段が、ラベル記憶手段において、連結状態が設定されたラベルの組合せのうちの発行順位の遅い方のラベルの発行順の領域が書き換えられているか否かを判断するようにし、書き換えられていない場合には、この領域を単純に発行順位の早い方のラベルの発行順の領域に記憶されたラベルに書き換えるようにすると、ラベル記憶手段を検索する回数を減らすことができ、図形の特徴量の算出時間を短縮することができる。 Therefore, as described in claim 4 , the feature amount updating means rewrites the label issue order area of the label with the later issue order out of the combination of labels in which the connection state is set in the label storage means. If it has not been rewritten, this area is simply rewritten with the label stored in the issue order area of the label with the earlier issue order, and the label storage means is searched. It is possible to reduce the number of times of performing the calculation, and it is possible to shorten the calculation time of the feature amount of the figure.
また、請求項1〜請求項4の何れか1項に記載の画像処理装置において、初期値設定手段及び既存値更新手段は、請求項5に記載のように、注目画素のラベルをレジスタに一旦格納し、次の注目画素のラベルを格納する際には、このレジスタに記憶された前の注目画素のラベルを、ラインバッファにおける前の注目画素に対応する領域に格納した後に、次の注目画素のラベルをレジスタに格納するように構成するとよい。このようにすると、例えば、1画面分の画素のラベルを記憶可能な記憶手段を設けて、1画面を構成する全画素のラベルを記憶しておく場合に比べ、記憶領域が少なくてすむ。 In the image processing apparatus according to any one of claims 1 to 4, the initial value setting means and the existing value updating means, as claimed in claim 5, once the label of the pixel of interest in the register When storing the label of the next target pixel, the label of the previous target pixel stored in this register is stored in the area corresponding to the previous target pixel in the line buffer, and then the next target pixel is stored. The label may be stored in a register. In this case, for example, a storage unit capable of storing the labels of the pixels for one screen is provided, and the storage area can be reduced as compared with the case where the labels of all the pixels constituting one screen are stored.
一方、請求項1〜請求項5の何れか1項に記載の画像処理装置には、請求項6に記載のように、撮像装置から画像データを直接取得可能に構成された第1画像取得手段を設けるようにしてもよい。このようにすると、カメラ等の撮像装置により撮像された画像データを、撮像装置から直接取得することができ、撮像装置が画像データを送信するタイミングで、画像データを走査し、連続して処理を行うことができる。 On the other hand, according to the image processing apparatus according to any one of claim 1 to claim 5, as described in claim 6, the first image acquisition unit that is capable of acquiring constructed directly image data from the imaging device May be provided. In this way, image data captured by an imaging device such as a camera can be acquired directly from the imaging device, and the image data is scanned and processed continuously at the timing when the imaging device transmits image data. It can be carried out.
そして、請求項1〜請求項6の何れか1項に記載の画像処理装置には、請求項7に記載のように、画像データが記憶された記憶媒体から画像データを取得可能に構成された第2画像取得手段を設けるようにしてもよい。画像データは、撮像装置から直接取得してもよいが、請求項7に記載のようにすると、画像データが既に記憶媒体に記憶されている場合に、この記憶媒体から画像データを読み取って、図形の特徴量を算出することができる。 Then, the image processing apparatus according to any one of claims 1 to 6, as described in claim 7, the image data is configured to acquire the image data from the stored storage medium A second image acquisition unit may be provided. The image data may be obtained directly from the imaging device. However, according to the seventh aspect , when the image data is already stored in the storage medium, the image data is read from the storage medium, The feature amount can be calculated.
ところで、カメラ等の撮像装置から画像データを取得する画像取得手段を備えている場合において、画像取得手段が1画素を取得して送信するために6サイクルかかり、二値化手段が1画素を取得して送信するために2サイクルかかる場合には、二値化手段は、1画素につき、4サイクルで二値化処理を行う必要がある。そこで、請求項8に記載のように、画像データを複数画素毎に取得、送信するようにすれば、画素の取得、送信にかかる時間を削減できるので、画像データを二値データに変換するための時間を長くとることができ、二値化手段の処理速度の制約が緩和される。 By the way, when an image acquisition unit that acquires image data from an imaging device such as a camera is provided, it takes 6 cycles for the image acquisition unit to acquire and transmit one pixel, and the binarization unit acquires one pixel. In the case where two cycles are required for transmission, the binarization means needs to perform binarization processing in four cycles per pixel. Therefore, as described in claim 8 , if the image data is acquired and transmitted for each of a plurality of pixels, the time required to acquire and transmit the pixels can be reduced, so that the image data is converted into binary data. Can be made long, and the restriction on the processing speed of the binarization means is relaxed.
また、一般的に画素の輝度値は8ビットのデータにより構成されている。そこで、請求項9に記載のように、画像データを4画素毎に送信するようにすると、例えば、バス幅が32ビットの伝送路を使用する場合には、効率よく画像データを送受することができる。 In general, the luminance value of a pixel is composed of 8-bit data. Therefore, as described in claim 9 , when image data is transmitted every four pixels, for example, when a transmission path having a bus width of 32 bits is used, image data can be transmitted and received efficiently. it can.
一方、請求項1〜請求項9の何れか1項に記載の画像処理装置において、二値化手段は、請求項10に記載のように、画像データを、輝度値にて設定されたしきい値により二値データに変換するように構成してもよい。このようにすると、画像データを構成する各画素の輝度の違いから、画像データを二値データに変換し、図形画素を抽出することができる。 On the other hand, in the image processing apparatus according to any one of claims 1 to 9, binarizing means, as claimed in claim 10, the image data, which is set by the luminance value threshold You may comprise so that it may convert into binary data with a value. In this way, the image data can be converted into binary data and graphic pixels can be extracted from the difference in luminance of each pixel constituting the image data.
そして、請求項1〜請求項9の何れか1項に記載の画像処理装置において、二値化手段は、請求項11に記載のように、画像データと、予め記憶手段に記憶された背景データとの差分からなる差分データを、新たな画像データとして生成し、この画像データを、輝度値にて設定されたしきい値により二値データに変換するように構成してもよい。 In the image processing apparatus according to any one of claims 1 to 9, binarizing means, as claimed in claim 11, the image data and the background data stored in advance in the storage means It is also possible to generate difference data consisting of the difference between the first and second data as new image data, and to convert the image data into binary data using a threshold value set by the luminance value.
つまり、画像データと背景データとの差分をとることにより、変化した部分の画素、つまり、移動した物体の画素のみの輝度値が異なる新しい画像データが形成されるので、この画像データを、輝度値にて設定されたしきい値により二値データに変換し、二値データに変換された画像データを画素判定手段により判定することで、移動物体を示す図形の特徴量を算出することができる。 In other words, by calculating the difference between the image data and the background data, new image data having different luminance values only for the changed portion of the pixel, that is, the pixel of the moved object, is formed. By converting to binary data using the threshold value set in (2), and determining the image data converted into binary data by the pixel determining means, the feature quantity of the graphic representing the moving object can be calculated.
また、請求項12に記載の画像処理装置によれば、画素判定手段が、注目画素を中心として周囲8方向に隣接する図形画素を、この注目画素に連結された画素として判断するので、複雑な形状の物体であっても、1つの図形であることを確実に識別することができる。 In addition, according to the image processing device of the twelfth aspect , since the pixel determination unit determines the graphic pixel adjacent in the eight directions around the target pixel as a pixel connected to the target pixel. Even a shape object can be reliably identified as a single figure.
一方、請求項13に記載の画像処理装置によれば、画素判定手段が、注目画素を中心として水平及び垂直方向の4方向に隣接する図形画素を、この注目画素に連結された画素として判断するので、例えば、2つの物体が斜め方向で接続されている場合に、これらを別の物体と識別できるようになる。また、周囲8方向に隣接する図形画素を、連結された画素として判断する場合に比べ、判断すべき画素の数が少なくなるので、処理時間を短縮することができる。 On the other hand, according to the image processing apparatus of the thirteenth aspect , the pixel determining means determines a graphic pixel adjacent to the target pixel in the four directions of the horizontal and vertical directions as a pixel connected to the target pixel. Therefore, for example, when two objects are connected in an oblique direction, they can be distinguished from other objects. In addition, since the number of pixels to be determined is reduced as compared to the case where graphic pixels adjacent in the surrounding eight directions are determined as connected pixels, the processing time can be shortened.
そして、請求項1〜請求項13の何れか1項に記載の画像処理装置は、請求項14に記載のように、連結情報格納手段と、初期値設定手段及び既存値更新手段とを各々独立して動作可能に構成するとよい。具体的には、例えば、CPUにより並列処理を実行させるようにするか、または、各手段を別々の電子回路にて構成すればよく、このようにすると、各手段による処理を並列に行うことができるので、処理時間を短縮することができる。 The image processing apparatus according to any one of claims 1 to 13, as described in claim 14, each independent of the connection information storage means, and an initial value setting means and the existing value updating means Thus, it may be configured to be operable. Specifically, for example, the CPU may execute parallel processing, or each unit may be configured by a separate electronic circuit. In this way, processing by each unit can be performed in parallel. As a result, the processing time can be shortened.
ところで、図形の特徴量は、2回以上の画像データの走査を必要とする値(例えば、図形の分散等)であってもよいが、請求項15に記載のように、1回の走査で算出可能な図形の特徴量とすると、一旦走査した画像データを再度走査する必要がないので、走査後の画像データを記憶するための記憶手段や、再度走査を行うための回路等を設ける必要がなく都合がよい。 Meanwhile, the feature of the figure, the value requiring the scanning of the image data more than once (for example, figures such as dispersion) may be, but as described in claim 15, in a single scan Since it is not necessary to scan the scanned image data again if the feature amount of the figure can be calculated, it is necessary to provide a storage means for storing the scanned image data, a circuit for performing the scanning again, and the like. Not convenient.
そして、1回の走査で算出可能な図形の特徴量としては、請求項16に記載のように、図形の面積、重心、周囲長、平均輝度、包含する矩形の何れかを図形の特徴量として算出するようにすればよく、このようにすると、各特徴量は1回の走査で算出されるので、請求項15と同じ効果を得ることができる。 Further, as the feature amount of the figure that can be calculated by one scanning, as shown in claim 16 , any one of the area, the center of gravity, the peripheral length, the average luminance, and the including rectangle of the figure is used as the feature amount of the figure. In this case, since each feature amount is calculated by one scan, the same effect as that of the fifteenth aspect can be obtained.
以下に、本発明の実施形態を図面と共に説明する。
図1は、本発明が適用された画像処理装置10の構成を表す概略構成図である。
本実施形態の画像処理装置10は、カメラ等の撮像装置にて撮像された画像データを走査して、画像データに含まれる連結された画素からなる図形の特徴量を算出し、この特徴量から人、車、建物等の特定の物体を認識するためのものであり、外部装置90から出力された画像データを取得するための画像入力I/F部12と、入力された画像データを、各画素毎に二値データに変換するための二値化処理部14と、二値化処理部14から出力された二値データに変換された画像データを取得し、構成する各画素の種類を順次判定する画素判定部16と、SRAM等の書き換え可能なメモリ等により構成され、各種情報が記憶される記憶部18と、画素判定部16の判定結果を受けて図形の識別情報であるラベル番号を発行する新規ラベル発行部32と、画素判定部16の判定結果を受けて各図形の連結情報を記憶部18に格納する連結情報格納部34と、ラベル番号が入力されると、入力されたラベル番号にて特定される図形の特徴量を算出し、算出した特徴量を記憶部18に格納する仮特徴量更新部36と、画素判定部16による1画面分の画像データの判定が終了し、新規ラベル発行部32、連結情報格納部34、仮特徴量更新部36の動作が完了すると、記憶部18に記憶された情報に基づいて、連結された図形を新たな1つの図形として、連結された図形の特徴量を算出し、記憶部18に記憶された図形の特徴量を更新する特徴量更新部38と、記憶部18に記憶された図形の特徴量を読み出し、図形の特徴量から特定の物体を認識するための処理を実行するCPUからなる制御部40と、から構成されている。
Embodiments of the present invention will be described below with reference to the drawings.
FIG. 1 is a schematic configuration diagram showing a configuration of an image processing apparatus 10 to which the present invention is applied.
The image processing apparatus 10 according to the present embodiment scans image data captured by an imaging device such as a camera, calculates a feature amount of a figure including connected pixels included in the image data, and uses this feature amount. It is for recognizing a specific object such as a person, a car, or a building, and an image input I / F unit 12 for acquiring image data output from the external device 90, and input image data, The binarization processing unit 14 for converting to binary data for each pixel, and the image data converted into the binary data output from the binarization processing unit 14 are acquired, and the type of each pixel to be configured is sequentially A pixel determination unit 16 for determination, a rewritable memory such as SRAM, and the like, a storage unit 18 that stores various information, and a label number that is identification information of a figure in response to the determination result of the pixel determination unit 16 New label issued When the label number is input, the unit 32, the connection information storage unit 34 that stores the connection information of each figure in the storage unit 18 in response to the determination result of the pixel determination unit 16, and is specified by the input label number. The feature amount of the figure to be calculated is calculated, and the temporary feature amount update unit 36 that stores the calculated feature amount in the storage unit 18 and the determination of the image data for one screen by the pixel determination unit 16 are finished, and the new label issuing unit 32 When the operations of the connection information storage unit 34 and the temporary feature amount update unit 36 are completed, the feature amount of the connected figure is determined based on the information stored in the storage unit 18 with the connected figure as a new figure. Is calculated, and the feature quantity update unit 38 for updating the feature quantity of the graphic stored in the storage unit 18 is read out. The feature quantity of the graphic stored in the storage unit 18 is read out, and a specific object is recognized from the feature quantity of the graphic. From the CPU that executes the process for That a control unit 40, and a.
なお、本実施形態において、上記制御部40を除く各部はクロック生成部を備える1つのLSI50により構成されており、各部には同一のクロック信号が供給され、このクロック信号にて各部の動作タイミングが設定される。 In this embodiment, each part except for the control part 40 is constituted by one LSI 50 having a clock generation part, and the same clock signal is supplied to each part, and the operation timing of each part is determined by this clock signal. Is set.
画像入力I/F部12は、外部装置90に接続されて、処理対象となる画像データを取得し、取得した画像データをラスタ式に走査してデジタル信号化する。そして、画像の左上を原点として横方向をX軸、縦方向をY軸とした場合の、各画素の座標(X,Y)及び256階調で表された輝度値を、複数画素(本実施形態では4画素)毎に書き込み信号と共に二値化処理部14に出力する。なお、本実施形態において外部装置90は、撮像素子を内蔵しており、二次元の撮像素子にて撮像された画像データを、一定の速度(例えば、通常のビデオレート33ms/1画像)で出力する装置(所謂、カメラ)とする。 The image input I / F unit 12 is connected to the external device 90, acquires image data to be processed, and scans the acquired image data in a raster manner to generate a digital signal. When the upper left corner of the image is the origin, the horizontal direction is the X axis, and the vertical direction is the Y axis, the coordinates (X, Y) of each pixel and the luminance value represented by 256 gradations are set to a plurality of pixels (this embodiment). In the embodiment, every four pixels) is output to the binarization processing unit 14 together with the write signal. In the present embodiment, the external device 90 has a built-in image sensor, and outputs image data captured by the two-dimensional image sensor at a constant speed (for example, a normal video rate of 33 ms / 1 image). Device (so-called camera).
二値化処理部14は、画像入力I/F部12から出力された画像データを取得して、各画素毎に二値データに順次変換する。詳述すると、二値化処理部14は、画像入力I/F部12から出力された書き込み信号を受けて、画像入力I/F部12から出力された4画素のデータを取得する。そして、取得した輝度値に基づいて、各画素が、背景の要素となる画素(本実施形態では白画素)であるか、または、図形の要素となる図形画素(本実施形態では黒画素)であるかを、予め設定されたしきい値により順次判定し、背景画素が0、図形画素が1として表された二値化結果及び各画素の座標(X,Y)を、4画素毎に書き込み信号と共に画素判定部16に出力する。そして、再び書き込み信号を受けると、次の4画素のデータを取得し、同じ動作を繰り返し実行する。なお、画像入力I/F部12と二値化処理部14とを接続する伝送路のうち、輝度値が送信される伝送路はバス幅が32ビットの伝送路を使用している。 The binarization processing unit 14 acquires the image data output from the image input I / F unit 12 and sequentially converts it into binary data for each pixel. More specifically, the binarization processing unit 14 receives the write signal output from the image input I / F unit 12 and acquires data of four pixels output from the image input I / F unit 12. Then, based on the acquired luminance value, each pixel is a pixel that is a background element (white pixel in the present embodiment) or a graphic pixel that is a graphic element (black pixel in the present embodiment). Judgment is made sequentially based on a preset threshold value, and the binarization result in which the background pixel is represented as 0 and the graphic pixel is represented as 1 and the coordinates (X, Y) of each pixel are written every 4 pixels. It outputs to the pixel determination part 16 with a signal. When the write signal is received again, the next four pixels of data are acquired, and the same operation is repeated. Of the transmission lines connecting the image input I / F unit 12 and the binarization processing unit 14, the transmission line to which the luminance value is transmitted uses a transmission line having a bus width of 32 bits.
画素判定部16は、二値化処理部14から取得した画像データ(二値データ)を構成する各画素の種類を各画素毎に判定する。
詳述すると、画素判定部16は、二値化処理部14から出力された書き込み信号を受けて、二値化処理部14から出力された4画素のデータを取得し、取得した4画素を座標(X,Y)の値が小さい画素から順に検索し、二値化結果に基づいて図形画素を抽出する。そして図形画素を抽出すると、抽出した図形画素を注目画素として、図2(a)に示すように、注目画素と、この注目画素の近傍4画素(左上、上、右上、左の4画素)との合計5つの画素の二値化結果から、図2(b)に示す、画素判定フラグ発行規則に基づいて注目画素の種類を判定する。また、判定結果により、画素判定フラグのうちの何れかをセットし、以下に説明する判定フラグに基づく動作を実行する。
The pixel determination unit 16 determines the type of each pixel constituting the image data (binary data) acquired from the binarization processing unit 14 for each pixel.
Specifically, the pixel determination unit 16 receives the write signal output from the binarization processing unit 14, acquires the data of the four pixels output from the binarization processing unit 14, and coordinates the acquired four pixels as coordinates. Search is performed in order from the pixel having the smallest value of (X, Y), and a graphic pixel is extracted based on the binarization result. Then, when the graphic pixel is extracted, the extracted pixel is set as the target pixel, and as shown in FIG. 2A, the target pixel and the four neighboring pixels (upper left, upper, upper right, and left four pixels) From the binarization result of the total five pixels, the type of the target pixel is determined based on the pixel determination flag issuing rule shown in FIG. In addition, one of the pixel determination flags is set according to the determination result, and an operation based on the determination flag described below is executed.
そして、画素判定部16は、判定フラグに基づく動作が終了すると、次の図形画素を抽出し、抽出した画素を新たな注目画素として、4画素のデータに含まれる全ての図形画素について判定フラグのセット及び判定フラグに基づく動作を実行し、4画素のデータに含まれる全ての図形画素に対する動作を終了すると、次の書き込み信号を受けるまで、動作を停止する。なお、図2(a)は、注目画素の種類の判定に使用する5画素を示す説明図、図2(b)は、画素判定フラグ発行規則を示す説明図である。 Then, when the operation based on the determination flag ends, the pixel determination unit 16 extracts the next graphic pixel, sets the extracted pixel as a new target pixel, and sets the determination flag for all the graphic pixels included in the four pixel data. When the operation based on the set and determination flags is executed and the operations for all the graphic pixels included in the four-pixel data are finished, the operation is stopped until the next writing signal is received. 2A is an explanatory diagram illustrating five pixels used for determining the type of the pixel of interest, and FIG. 2B is an explanatory diagram illustrating a pixel determination flag issuing rule.
以下に、画素判定部16の動作を、発行する画素判定フラグ別に詳細に説明する。なお、以下の説明において、ラベル番号は、図形の識別情報であり、1つの図形を形成する連結する画素群のラベル番号は同一となる。そして、本実施形態では、注目画素が図形画素であり、注目画素の周囲8方向(上下左右、斜め方向)に隣接する画素が図形画素である場合に、注目画素と、各図形画素が連結されているものとして、図形を認識する。また、図2(a)に示す、注目画素の近傍4画素の二値化結果は後述する記憶部18を構成するレジスタ28及びラインバッファ30に記憶されたラベル番号により判断する。 Hereinafter, the operation of the pixel determination unit 16 will be described in detail for each pixel determination flag to be issued. In the following description, the label number is identification information of a figure, and the label numbers of connected pixel groups forming one figure are the same. In this embodiment, when the pixel of interest is a graphic pixel and pixels adjacent to the pixel of interest in the eight directions (up, down, left, right, diagonal) are graphic pixels, the pixel of interest and each graphic pixel are connected. Recognize figures as if they are. Further, the binarization result of the four pixels in the vicinity of the target pixel shown in FIG. 2A is determined based on a label number stored in a register 28 and a line buffer 30 constituting the storage unit 18 described later.
画素判定部16は、近傍4画素の二値化結果を検出し、近傍4画素の二値化結果が、図2(b)の1段目に示すパターンである、つまり、注目画素の周囲に図形画素が存在せず、注目画素が、新たな図形を形成する画素であると判定すると、画素判定フラグNをセットし、注目画像の座標(X,Y)を新規ラベル発行部32に出力する。 The pixel determination unit 16 detects the binarization result of the four neighboring pixels, and the binarization result of the four neighboring pixels is the pattern shown in the first row in FIG. 2B, that is, around the target pixel. If it is determined that there is no graphic pixel and the target pixel is a pixel forming a new graphic, the pixel determination flag N is set, and the coordinates (X, Y) of the target image are output to the new label issuing unit 32. .
また、画素判定部16は、近傍4画素の二値化結果が、図2(b)の2段目に示すパターンのうちの何れかである、つまり、注目画素が既存の図形の一部を形成する画素であり、且つ、既存の図形を連結させる可能性があると判定すると、画素判定フラグCをセットし、近傍4画素の2種類のラベル番号L1及びラベル番号L2(ただし、L1≦L2とする)のうちのラベル番号L1と、注目画素の座標(X,Y)とを仮特徴量更新部36に出力する。そして、ラベル番号L1がラベル番号L2と等しいか否かを判断し、等しくない場合には、更に、ラベル番号L1及びラベル番号L2(ただし、L1<L2とする)を、連結情報格納部34に出力する。 Further, the pixel determination unit 16 determines that the binarization result of the four neighboring pixels is one of the patterns shown in the second row of FIG. 2B, that is, the target pixel is a part of the existing figure. If it is determined that it is a pixel to be formed and there is a possibility that an existing figure is connected, a pixel determination flag C is set, and two types of label numbers L1 and L2 of the four neighboring pixels (L1 ≦ L2) ) And the coordinates (X, Y) of the target pixel are output to the temporary feature amount update unit 36. Then, it is determined whether or not the label number L1 is equal to the label number L2. If not equal, the label number L1 and the label number L2 (assuming that L1 <L2) are further stored in the connection information storage unit 34. Output.
そして、画素判定部16は、近傍4画素の二値化結果が、図2(b)の3段目に示すパターンのうちの何れかである、つまり、注目画素が既存の図形の一部を形成する画素であると判定すると、画素判定フラグDをセットし、近傍4画素のラベル番号L1と、注目画素の座標(X,Y)とを仮特徴量更新部36に出力する。 Then, the pixel determination unit 16 determines that the binarization result of the four neighboring pixels is one of the patterns shown in the third row of FIG. 2B, that is, the target pixel is a part of the existing figure. If it is determined that the pixel is to be formed, the pixel determination flag D is set, and the label number L1 of the four neighboring pixels and the coordinates (X, Y) of the target pixel are output to the temporary feature amount update unit 36.
記憶部18は、ラベル表22、連結マップ24、特徴量表26を構成する書き換え可能なメモリ(例えば、SRAM)からなる算出用記憶部20と、1画素分のラベル番号を記憶可能なレジスタ28と、1走査ライン分の画素のラベル番号を記憶可能な書き換え可能なメモリ(例えば、SRAM)からなるラインバッファ30と、を備えている(なお、レジスタ28及びラインバッファ30は図5参照)。 The storage unit 18 includes a calculation storage unit 20 including a rewritable memory (e.g., SRAM) that forms the label table 22, the connection map 24, and the feature amount table 26, and a register 28 that can store a label number for one pixel. And a line buffer 30 composed of a rewritable memory (for example, SRAM) capable of storing the label numbers of pixels for one scanning line (refer to FIG. 5 for the register 28 and the line buffer 30).
ラベル表22は、算出用記憶部20において、図3(a)に示すように、新規ラベル発行部32により発行されたラベル番号が順に書き込まれるように構成されており、書き込まれたラベル番号は、ラベル番号T[λ]として、特徴量更新部38の動作により書き換え可能に記憶される。ただし、T[λ]はラベル表22のλ番目の領域に記憶されたラベル番号を示しており、特徴量更新部38による書き換え前は、ラベル番号T[λ]とλとは等しい値である。 As shown in FIG. 3A, the label table 22 is configured such that the label numbers issued by the new label issuing unit 32 are sequentially written in the calculation storage unit 20, and the written label numbers are , The label number T [λ] is stored so as to be rewritable by the operation of the feature amount updating unit 38. However, T [λ] indicates the label number stored in the λth area of the label table 22, and the label number T [λ] and λ are equal before rewriting by the feature amount updating unit 38. .
連結マップ24は、図3(b)に示すように、新規ラベル発行部32により発行されたラベル番号のうち、小さい方のラベル番号L1を縦軸、大きい方のラベル番号L2を横軸とするマトリックス状に構成されており、連結マップ24上の異なるラベル番号の交点(つまり、異なるラベル番号の組合せ)に対し、ラベル番号L1及びL2にて特定される図形(つまり、ラベル番号がL1、L2である図形画素からなる図形)同士が連結しているか否かを示す連結フラグ(L1,L2)を記憶するように構成されている。そして、例えば、ラベル番号がL1=1にて特定される図形と、ラベル番号L2=3にて特定される図形が連結されている場合には、ラベル番号1とラベル番号3との交点に記憶された連結フラグ(1,3)(図中丸印)が値1にセットされる。 As shown in FIG. 3B, in the connection map 24, among the label numbers issued by the new label issuing unit 32, the smaller label number L1 is the vertical axis and the larger label number L2 is the horizontal axis. It is configured in a matrix, and for the intersections of different label numbers (that is, combinations of different label numbers) on the connection map 24, the figures identified by the label numbers L1 and L2 (that is, the label numbers are L1 and L2) (A graphic made up of graphic pixels) is connected so as to store connection flags (L1, L2) indicating whether or not they are connected. Then, for example, when the graphic identified by the label number L1 = 1 and the graphic identified by the label number L2 = 3 are connected, it is stored at the intersection of the label number 1 and the label number 3. The connected flag (1, 3) (circled in the figure) is set to a value of 1.
特徴量表26は、図3(c)に示すように、仮特徴量更新部36により算出された図形の特徴量(本実施形態では面積、換言すると、画素数)が、ラベル番号毎に順次書き込まれるように構成されている。そして、書き込まれた図形の特徴量は、特徴量S[λ]として、特徴量更新部38の動作により書き換え可能に記憶される。ただし、S[λ]はλ番目の領域に記憶された面積を示しており、特徴量更新部38による書き換え前は、S[λ]は、ラベル番号λにより特定される図形の面積を示している。 In the feature quantity table 26, as shown in FIG. 3C, the figure feature quantity (in this embodiment, in other words, the number of pixels) calculated by the temporary feature quantity update unit 36 is sequentially displayed for each label number. It is configured to be written. The feature amount of the written figure is stored as a feature amount S [λ] so as to be rewritable by the operation of the feature amount update unit 38. However, S [λ] indicates the area stored in the λ th region, and before rewriting by the feature amount updating unit 38, S [λ] indicates the area of the figure specified by the label number λ. Yes.
なお、図3(a)は、ラベル表22を示す説明図、図3(b)は、連結マップ24を示す説明図、図3(c)は、特徴量表26を示す説明図である。そして、各説明図においては、ラベル番号が1から4まで発行された状態を示している。 3A is an explanatory diagram showing the label table 22, FIG. 3B is an explanatory diagram showing the connection map 24, and FIG. 3C is an explanatory diagram showing the feature quantity table 26. In each explanatory diagram, the label numbers 1 to 4 are issued.
新規ラベル発行部32は、注目画像の座標(X,Y)が入力されると、値1をインクリメントするように構成されたカウンタであり、インクリメントした値を新規ラベル番号として発行する。そして、発行したラベル番号を、注目画素の座標(X,Y)と共に仮特徴量更新部36に出力する。なお、新規ラベル発行部32は、1画面の最初の画素(本実施形態では、座標(X,Y)=(0,0))が、画素判定部16に入力されるとリセットされて値0となるように構成されている。つまり、1画面の画像データの走査が開始される毎に初期化され、初期値0からカウントが開始される。 The new label issuing unit 32 is a counter configured to increment the value 1 when the coordinate (X, Y) of the target image is input, and issues the incremented value as a new label number. Then, the issued label number is output to the temporary feature amount update unit 36 together with the coordinates (X, Y) of the target pixel. The new label issuing unit 32 is reset when the first pixel of one screen (in this embodiment, coordinates (X, Y) = (0, 0)) is input to the pixel determination unit 16 and the value 0 It is comprised so that. That is, it is initialized every time scanning of image data for one screen is started, and counting starts from an initial value of 0.
連結情報格納部34は、ラベル番号L1及びラベル番号L2が入力されると、連結マップ24のラベル番号L1,L2の交点に記憶された連結フラグ(L1,L2)を値1にセットする。 When the label number L1 and the label number L2 are input, the connection information storage unit 34 sets the connection flag (L1, L2) stored at the intersection of the label numbers L1, L2 of the connection map 24 to a value 1.
仮特徴量更新部36は、新規ラベル番号が入力された場合に動作する新規画素更新部36aと、既存のラベル番号が入力された場合に動作する追加画素更新部36bとを備えている。 The temporary feature amount update unit 36 includes a new pixel update unit 36a that operates when a new label number is input, and an additional pixel update unit 36b that operates when an existing label number is input.
新規画素更新部36aは、新規ラベル発行部32から新規ラベル番号λ及び注目画素の座標(X,Y)が入力されたときに、図4(a)に示すように、ラベル表22において、入力された新規ラベルのラベル番号目(以下、入力されたラベル番号がλである場合に、λ番目ともいう)の領域(図中では、矢印にて示される5番目の領域)に、入力された新規ラベル番号を書き込み、また、特徴量表26のλ番目の領域(図中では、矢印にて示される5番目の領域)に、入力された新規ラベル番号にて特定される図形の面積の初期値として値1(S[λ]=1)を特徴量表26のλ番目の領域に書き込む。 When the new label number λ and the coordinates (X, Y) of the pixel of interest are input from the new label issuing unit 32, the new pixel updating unit 36a inputs the label table 22 as shown in FIG. Entered in the area of the label number of the new label (hereinafter referred to as the λth when the input label number is λ) (the fifth area indicated by the arrow in the figure) The new label number is written, and the initial area of the figure specified by the input new label number in the λ-th region (fifth region indicated by an arrow in the figure) of the feature quantity table 26 The value 1 (S [λ] = 1) is written in the λ th area of the feature quantity table 26 as a value.
追加画素更新部36bは、画素判定部16からラベル番号λ及び注目画素の座標(X,Y)が入力されたときに、図4(b)に示すように、ラベル表22には書き込みを行わず、特徴量表26のλ番目の領域に記憶された図形の面積S[λ]に値1を加えて(S[λ]←S[λ]+1)、特徴量表26の面積S[λ]の値を更新する。なお、図4(b)においては、入力されたラベル番号が4の場合を示しており、4番目の領域(図中、矢印にて示される領域)に記憶されたS[4]が、32から33に更新されている。 When the label number λ and the coordinate (X, Y) of the pixel of interest are input from the pixel determination unit 16, the additional pixel update unit 36 b writes in the label table 22 as shown in FIG. First, a value 1 is added to the area S [λ] of the figure stored in the λ-th region of the feature quantity table 26 (S [λ] ← S [λ] +1) to obtain the area S [λ of the feature quantity table 26. ] Value is updated. FIG. 4B shows a case where the input label number is 4, and S [4] stored in the fourth area (area indicated by an arrow in the figure) is 32. To 33.
ここで、図4(a)は、新規画素更新部36aの行うラベル表22及び特徴量表26の書き換え動作を表す説明図であり、図4(b)は、追加画素更新部36bの行う特徴量表26の書き換え動作を表す説明図であり、図4(a)、図4(b)は、ラベル表22、特徴量表26が図3(a)及び図3(c)に示す状態のときに、夫々ラベル番号としてλ=5、λ=4が入力された場合を示している。 Here, FIG. 4A is an explanatory diagram showing the rewriting operation of the label table 22 and the feature quantity table 26 performed by the new pixel update unit 36a, and FIG. 4B is the feature performed by the additional pixel update unit 36b. FIGS. 4A and 4B are explanatory diagrams showing the rewriting operation of the quantity table 26. FIGS. 4A and 4B show the label table 22 and the feature quantity table 26 in the state shown in FIGS. 3A and 3C. In some cases, λ = 5 and λ = 4 are input as label numbers.
そして、仮特徴量更新部36は、上記のように特徴量表26を更新すると、次に、レジスタ28に記憶されている1つ前に処理された注目画素(つまり、座標(X−1,Y)の画素)のラベル番号を、図5(b)に示すように、ラインバッファ30における座標(X−1,Y−1)の画素のラベル番号が記憶されていた領域(つまり、ラインバッファ30のX−1番目の領域)に書き込み、座標(X−1,Y)の画素のラベル番号をラインバッファ30に書き込んだ後に、処理中の注目画素(つまり、座標(X,Y)の画素)のラベル番号をレジスタ28に書き込む。 Then, when the temporary feature amount update unit 36 updates the feature amount table 26 as described above, next, the target pixel (that is, the coordinates (X-1,. As shown in FIG. 5B, the label number of the pixel at the coordinates (X-1, Y-1) in the line buffer 30 (that is, the line buffer) 30 (X-1th region), and after writing the label number of the pixel at coordinates (X-1, Y) into the line buffer 30, the pixel of interest being processed (that is, the pixel at coordinates (X, Y)) ) Is written in the register 28.
このように、注目画素のラベル番号(詳述すると、注目画素の座標と共に入力されたラベル番号)はレジスタ28に一旦記憶され、その後、ラインバッファ30に記憶されるように構成されており、画素判定部16は、図5(a)に示すように、ラインバッファ30のX−1番目、X番目、X+1番目の領域に記憶されたラベル番号から、座標(X,Y)の注目画素の左上、上、右上の3画素の二値化結果、つまり、各画素が図形画素であるか否かを判断し、レジスタ28に記憶されたラベル番号から、注目画素の左の画素の二値化結果を判断する。 As described above, the label number of the target pixel (specifically, the label number input together with the coordinates of the target pixel) is temporarily stored in the register 28, and then stored in the line buffer 30. As illustrated in FIG. 5A, the determination unit 16 determines the upper left of the target pixel at coordinates (X, Y) from the label numbers stored in the X−1, X, and X + 1 regions of the line buffer 30. The binarization result of the upper and upper right three pixels, that is, whether each pixel is a graphic pixel is determined, and from the label number stored in the register 28, the binarization result of the left pixel of the target pixel Judging.
なお、図5(a)は、仮特徴量更新部36による注目画素の処理前のレジスタ28及びラインバッファ30を示す説明図、図5(b)は、仮特徴量更新部36による注目画素の処理後のレジスタ28及びラインバッファ30を示す説明図である。 5A is an explanatory diagram showing the register 28 and the line buffer 30 before the target pixel is processed by the temporary feature amount update unit 36, and FIG. 5B is a diagram of the target pixel by the temporary feature amount update unit 36. It is explanatory drawing which shows the register | resistor 28 and the line buffer 30 after a process.
以上、説明したように、二値化処理部14、画素判定部16、新規ラベル発行部32、連結情報格納部34、仮特徴量更新部36は、外部からの入力を受けて、画像データの二値データへの変換、画素の種類の判定、ラベル番号毎の図形の特徴量の算出等の動作を夫々開始する。そして、1画面分の画像データの処理が終了するまで、つまり、画像入力I/F12から1画面分の画像データが出力される間、上記各部は外部からの入力を受けて上記の動作を繰り返し実行する。なお、仮特徴量更新部36は1画面分の画像データの処理が終了すると、ラインバッファ30に記憶されたラベル番号を全て消去して、ラインバッファ30を初期化する。 As described above, the binarization processing unit 14, the pixel determination unit 16, the new label issue unit 32, the connection information storage unit 34, and the temporary feature amount update unit 36 receive external input, Operations such as conversion to binary data, determination of pixel type, calculation of feature values of a figure for each label number, and the like are started. Then, until the processing of the image data for one screen is completed, that is, while the image data for one screen is output from the image input I / F 12, each of the above units receives the input from the outside and repeats the above operation. Execute. When the processing of the image data for one screen is completed, the temporary feature amount update unit 36 erases all the label numbers stored in the line buffer 30 and initializes the line buffer 30.
ところで、画素判定部16で、画素判定フラグCがセットされた場合は、注目画素が既存の図形の一部を形成する画素であり、且つ、既存の図形を連結させる可能性がある場合であり、ラベル番号L1がラベル番号L2と等しくない場合には、注目画素は、ラベル番号L1とラベル番号L2に特定される2つの図形を連結させている。しかし、仮特徴量更新部36の動作において算出され、特徴量表26に記憶されたラベル番号毎の図形の特徴量は、上記図形の連結情報が反映されておらず、暫定的な図形の特徴量である。 By the way, when the pixel determination flag C is set in the pixel determination unit 16, the target pixel is a pixel that forms a part of an existing graphic, and there is a possibility that the existing graphic is connected. When the label number L1 is not equal to the label number L2, the target pixel connects two figures specified by the label number L1 and the label number L2. However, the graphic feature quantity for each label number calculated in the operation of the temporary feature quantity update unit 36 and stored in the feature quantity table 26 does not reflect the graphic connection information, and the provisional graphic feature is not reflected. Amount.
そこで、特徴量更新部38では、上記各部における1画面の画像データの走査が終了し、算出用記憶部20へのデータの格納が完了した後に、特徴量表26に記憶されたラベル番号毎の図形の特徴量に、連結マップ24に記憶された連結情報を反映させて、図形の特徴量を更新する。 Therefore, in the feature amount update unit 38, after the scanning of the image data of one screen in each unit is completed and the storage of the data in the calculation storage unit 20 is completed, the feature amount update unit 38 stores each of the label numbers stored in the feature amount table 26. The feature amount of the figure is updated by reflecting the connection information stored in the connection map 24 on the feature amount of the figure.
特徴量更新部38は、クロック生成部から供給される信号に基づいて、予め設定されたタイミングで動作を開始するように構成されている。なお、本実施形態では、上記各部における1画面の画像データの走査が終了し、各部における、算出用記憶部20へのデータの格納が完了するタイミングが、特徴量更新部38が動作を開始するタイミングとして設定されている。 The feature amount update unit 38 is configured to start an operation at a preset timing based on a signal supplied from the clock generation unit. In the present embodiment, the feature amount updating unit 38 starts the operation when the scanning of the image data for one screen in each unit is completed and the storage of the data in the calculation storage unit 20 is completed in each unit. It is set as timing.
そして、特徴量更新部38は、連結マップ24に記憶された異なるラベル番号にて特定される図形同士の連結情報、つまり、連結マップ24にて連結フラグがセットされたラベル番号の組合せに基づいて、連結フラグがセットされたラベル番号を一致させると共に、ラベル番号毎の暫定的な図形の特徴量を一致させたラベル番号毎に統合することで、図形の特徴量を更新する動作を実行する。 Then, the feature amount updating unit 38 is based on connection information between figures specified by different label numbers stored in the connection map 24, that is, based on a combination of label numbers for which the connection flag is set in the connection map 24. In addition to matching the label numbers for which the concatenation flag is set, the feature values of the graphic are updated by integrating the provisional graphic feature values for each label number for each matched label number.
以下に、特徴量更新部38の動作を図6に示すフローチャートを用いて説明する。なお、特徴量更新部38は、実際には図6に示す手順で動作するようにロジック回路にて構成されているが、ここでは、特徴量更新部38の動作の理解を容易にするためにフローチャートを用いて説明する。 Hereinafter, the operation of the feature amount updating unit 38 will be described with reference to the flowchart shown in FIG. The feature amount updating unit 38 is actually configured with a logic circuit so as to operate according to the procedure shown in FIG. 6, but here, in order to facilitate understanding of the operation of the feature amount updating unit 38. This will be described with reference to a flowchart.
図6に示すように、特徴量更新部38は動作を開始すると、連結マップ24をラスタ式に走査する。まず、S210にて、連結フラグ(L1,L2)がセットされているか否かを判断し、連結フラグ(L1,L2)がセットされていると判断すると、続くS220では、ラベル表22のL1番目とL2番目の領域に記憶されたラベル番号のうちの大きい方のラベル番号Lmaxを抽出する。 As shown in FIG. 6, when the feature amount update unit 38 starts its operation, it scans the connection map 24 in a raster fashion. First, in S210, it is determined whether or not the concatenation flag (L1, L2) is set, and if it is determined that the concatenation flag (L1, L2) is set, then in S220, the L1th label table 22 is displayed. And the larger label number Lmax among the label numbers stored in the L2th area is extracted.
S220にてラベル番号Lmaxを抽出すると、次に、ラベル表22の1番目の領域から順に、ラベル表22の全ての領域において、T[λ]=Lmaxである領域(つまり、Lmaxが記憶されている領域)を検出し、以下に説明するS240からS260のラベル番号の書換え等の動作を行う。 When the label number Lmax is extracted in S220, the area where T [λ] = Lmax is stored in all areas of the label table 22 in order from the first area of the label table 22 (that is, Lmax is stored). And the operation of rewriting the label number in S240 to S260 described below is performed.
詳述すると、S230では、ラベル表22のλ番目の領域に記憶されたラベル番号T[λ]がLmaxと等しいか否かを判断し、T[λ]=Lmaxである場合には、S240に移行して、ラベル番号T[λ]を、L1番目とL2番目の領域に記憶されたラベル番号のうちの小さい方のラベル番号Lminに書き換える。そして、続くS250にて、特徴量表26に記憶された、ラベル番号Lminにて特定される図形の面積S[Lmin](つまり、Lmin番目の領域に記憶された面積)と、ラベル番号T[λ]=Lmaxにて特定される図形の面積S[λ](つまり、λ番目の領域に記憶された面積)との和を算出し、S[Lmin]を算出した値に書き換え、S260にて、特徴量表26に記憶された面積S[λ]を0に書き換え、S270に移行する。 More specifically, in S230, it is determined whether or not the label number T [λ] stored in the λth area of the label table 22 is equal to Lmax. If T [λ] = Lmax, the process proceeds to S240. Then, the label number T [λ] is rewritten to the smaller label number Lmin of the label numbers stored in the L1 and L2 areas. In subsequent S250, the area S [Lmin] of the figure specified by the label number Lmin (that is, the area stored in the Lmin-th region) stored in the feature quantity table 26 and the label number T [ The sum of the area S [λ] of the figure specified by λ] = Lmax (that is, the area stored in the λth region) is calculated, and S [Lmin] is rewritten to the calculated value, and in S260 Then, the area S [λ] stored in the feature table 26 is rewritten to 0, and the process proceeds to S270.
一方、S230において、ラベル番号T[λ]がLmaxと等しくないと判断した場合には、そのラベル番号T[λ]に対して、S240からS260のラベル番号の書換え等の動作を行うことなく、S270に移行する。 On the other hand, if it is determined in S230 that the label number T [λ] is not equal to Lmax, the label number T [λ] is not rewritten or the like from S240 to S260. The process proceeds to S270.
そして、S270にて、ラベル表22の全領域の検索が終了したか否かを判断し、終了していない場合には、S230に移行し、ラベル表22の次の領域の判断を実行し、ラベル表22の全領域の検索を終了するまで、S230からS270の動作を繰り返し実行する。一方、S270にて、ラベル表22の全領域の検索が終了した場合には、S280に移行する。また、S210で、連結フラグ(L1,L2)がセットされていないと判断した場合には、そのラベル番号の組合せに対しては、上述したS220からS270の動作を行うことなく、S280に移行する。 Then, in S270, it is determined whether or not the search of all areas in the label table 22 has been completed. If not, the process proceeds to S230, and the determination of the next area in the label table 22 is performed. The operations from S230 to S270 are repeatedly executed until the search of all areas of the label table 22 is completed. On the other hand, if the search of all the areas in the label table 22 is completed in S270, the process proceeds to S280. If it is determined in S210 that the link flag (L1, L2) is not set, the process proceeds to S280 without performing the above-described operations from S220 to S270 for the combination of label numbers. .
そして、S280では、連結マップ24の全連結フラグに対する判断が終了したか否かを判断する。そして、連結マップ24の全連結フラグの走査が終了したと判断すると、S290に移行する。一方、全連結フラグの走査が終了していないと判断すると、S210に移行し、次の連結フラグ(L1,L2)の判断を実行し、全連結フラグの走査が終了するまで、S210からS280の動作を繰り返し実行する。 In S280, it is determined whether or not the determination for all the connection flags in the connection map 24 is completed. If it is determined that scanning of all the connection flags in the connection map 24 has been completed, the process proceeds to S290. On the other hand, if it is determined that the scanning of all the connection flags is not completed, the process proceeds to S210, the determination of the next connection flag (L1, L2) is executed, and the scanning of all the connection flags is completed until the scanning of all the connection flags is completed. Repeat the operation.
このように、S210からS280までの動作を実行し、連結マップ24の全連結フラグの走査を終了すると、特徴量表26には、連結された図形が統合された新たな図形の特徴量が記憶される。 As described above, when the operations from S210 to S280 are executed and the scanning of all the connection flags of the connection map 24 is completed, the feature value table 26 stores the feature values of a new graphic in which the connected graphics are integrated. Is done.
次に、S290にて、連結マップ24の全ての連結フラグを消去して連結マップ24を初期化し、S300では、特徴量表26に記憶された特徴量の数、つまり、図形の総数を割込み信号と共に制御部40に出力し、動作を終了する。 Next, in S290, all the connection flags of the connection map 24 are deleted and the connection map 24 is initialized. In S300, the number of feature quantities stored in the feature quantity table 26, that is, the total number of figures is set as an interrupt signal. At the same time, it is output to the control unit 40 and the operation is terminated.
以下、図7(a)に示す入力画像が入力された場合に実際に特徴量更新部38が行う動作について、図6に示すフローチャートに沿って順に説明する。ただし、図7(a)のラベル画像は、各図形画素のラベル番号を各図形画素上に記載した図であり、本実施形態の画像処理装置10において生成されるものではなく、以下の説明の理解を容易にするための参考図である。 Hereinafter, operations performed by the feature amount updating unit 38 when the input image illustrated in FIG. 7A is input will be described in order along the flowchart illustrated in FIG. 6. However, the label image in FIG. 7A is a diagram in which the label number of each graphic pixel is described on each graphic pixel, and is not generated in the image processing apparatus 10 of the present embodiment. It is a reference diagram for facilitating understanding.
なお、図7(b)は、1画面の画像データの走査が終了し、算出用記憶部20へのデータの格納が完了した時点におけるラベル表22及び特徴量表26を示す説明図、図7(c)は、同じ時点における連結マップ24を示す説明図、図7(d)は、特徴量更新部38の動作により書き換えられたラベル表22及び特徴量表26を示す説明図である。 7B is an explanatory diagram showing the label table 22 and the feature amount table 26 when the scanning of the image data of one screen is completed and the storage of the data in the calculation storage unit 20 is completed. FIG. 7C is an explanatory view showing the connection map 24 at the same time point, and FIG. 7D is an explanatory view showing the label table 22 and the feature amount table 26 rewritten by the operation of the feature amount update unit 38.
特徴量更新部38は、動作を開始すると、図7(c)に示す連結マップ24をラスタ式に走査し、まず、S210にて、連結フラグ(L1,L2)がセットされているか否かを判断し、連結フラグ(1,3)がセットされていることを検出する。そして、続くS220では、ラベル表22の1番目と3番目の領域に記憶されたラベル番号のうちの大きい方のラベル番号3を抽出し、S230からS270の動作にて、ラベル表22にて、ラベル番号が3である領域を検出する。 When the operation is started, the feature amount updating unit 38 scans the connection map 24 shown in FIG. 7C in a raster manner. First, in S210, it is determined whether or not the connection flag (L1, L2) is set. Judgment is made and it is detected that the connection flag (1, 3) is set. In the subsequent S220, the larger label number 3 of the label numbers stored in the first and third areas of the label table 22 is extracted, and in the operation of S230 to S270, in the label table 22, An area having a label number of 3 is detected.
詳述すると、S230にて、T[3]=3であると判断し、続くS240では、ラベル表22の3番目の領域を、ラベル表22の1番目と3番目の領域に記憶されたラベル番号のうちの小さい方のラベル番号1に書き換える。そして、S250にて、特徴量表26の1番目の領域に記憶されたラベル番号1により特定される図形の面積S[1]と、ラベル番号3により特定される図形の面積S[3]との和(つまり、1番目と3番目の領域に記憶された面積8と12)を算出して面積S[1]を20に書き換え、S260にて、面積S[3]を0に書き換える。そして、S280では、連結マップ24の全フラグに対する判断が終了していないと判断し、S210に移行する。 More specifically, in S230, it is determined that T [3] = 3, and in subsequent S240, the third area of the label table 22 is stored in the first and third areas of the label table 22. Rewrite the label number 1 which is the smaller of the numbers. In S250, the figure area S [1] specified by the label number 1 stored in the first area of the feature table 26 and the figure area S [3] specified by the label number 3 Is calculated (ie, the areas 8 and 12 stored in the first and third regions), the area S [1] is rewritten to 20, and the area S [3] is rewritten to 0 in S260. In S280, it is determined that the determination for all the flags of the connection map 24 is not completed, and the process proceeds to S210.
次に、S210にて、連結フラグ(2,3)がセットされていることを検出する。そして、続くS220では、ラベル表22の2番目と3番目の領域に記憶されたラベル番号のうちの大きい方のラベル番号2を抽出し、S230からS270の動作にて、ラベル表22にて、ラベル番号が2である領域を検出する。 Next, in S210, it is detected that the connection flag (2, 3) is set. In subsequent S220, the larger label number 2 of the label numbers stored in the second and third areas of the label table 22 is extracted, and in the operation from S230 to S270, in the label table 22, An area having a label number of 2 is detected.
詳述すると、S230にて、T[2]=2であると判断し、続くS240では、ラベル表22の2番目の領域を、ラベル表22の2番目と3番目の領域に記憶されたラベル番号のうちの小さい方のラベル番号1に書き換える。そして、S250にて、特徴量表26の1番目の領域に記憶されたラベル番号1により特定される図形の面積S[1]と、ラベル番号2により特定される図形の面積S[2]との和(つまり、1番目と2番目の領域に記憶された面積20と4)を算出して面積S[1]を24に書き換え、S260にて、面積S[2]を0に書き換える。そして、S280では、連結マップ24の全フラグに対する判断が終了していないと判断し、S210に移行する。 More specifically, in S230, it is determined that T [2] = 2, and in subsequent S240, the second area of the label table 22 is stored in the second and third areas of the label table 22. Rewrite the label number 1 which is the smaller of the numbers. In S250, the figure area S [1] specified by the label number 1 stored in the first area of the feature quantity table 26 and the figure area S [2] specified by the label number 2 Is calculated (ie, the areas 20 and 4 stored in the first and second regions), the area S [1] is rewritten to 24, and the area S [2] is rewritten to 0 in S260. In S280, it is determined that the determination for all the flags of the connection map 24 is not completed, and the process proceeds to S210.
次に、S210にて、連結フラグ(3,4)がセットされていることを検出する。そして、続くS220では、ラベル表22の3番目と4番目の領域に記憶されたラベル番号のうちの大きい方のラベル番号4を抽出し、S230からS270の動作にて、ラベル表22にて、ラベル番号が4である領域を検出する。 Next, in S210, it is detected that the connection flag (3, 4) is set. In subsequent S220, the larger label number 4 of the label numbers stored in the third and fourth areas of the label table 22 is extracted, and in the operation from S230 to S270, in the label table 22, An area having a label number of 4 is detected.
詳述すると、S230にて、T[4]=4であると判断し、続くS240では、ラベル表22の4番目の領域を、ラベル表22の3番目と4番目の領域に記憶されたラベル番号のうちの小さい方のラベル番号1に書き換える。そして、S250にて、特徴量表26の1番目の領域に記憶されたラベル番号1により特定される図形の面積S[1]と、ラベル番号4により特定される図形の面積S[4]との和(つまり、1番目と4番目の領域に記憶された面積24と1)を算出して面積S[1]を25に書き換え、S260にて、面積S[4]を0に書き換える。 Specifically, in S230, it is determined that T [4] = 4, and in subsequent S240, the fourth area of the label table 22 is stored in the third and fourth areas of the label table 22. Rewrite the label number 1 which is the smaller of the numbers. In S250, the area S [1] of the graphic specified by the label number 1 stored in the first area of the feature quantity table 26 and the area S [4] of the graphic specified by the label number 4 Is calculated (ie, the areas 24 and 1 stored in the first and fourth regions), the area S [1] is rewritten to 25, and the area S [4] is rewritten to 0 in S260.
そして、S280では、連結マップ24の全ての連結フラグに対する判断が終了したと判断してS290に移行する。
ここで、本入力画像は、図7(a)に示すように、全ての図形画素が連結しているため、S210からS280における全ての連結フラグの走査が終了したときには、特徴量表26に記憶された面積はS[1]=25となる。
In S280, it is determined that the determination for all the connection flags in the connection map 24 is completed, and the process proceeds to S290.
Here, as shown in FIG. 7A, this graphic image is stored in the feature table 26 when scanning of all the connection flags in S210 to S280 is completed because all the graphic pixels are connected. The area thus obtained is S [1] = 25.
次に、S290にて、連結マップ24に記憶された全ての連結フラグを消去し、続くS300では、特徴量表26に記憶された特徴量の数、つまり、図形の総数1を割込み信号と共に、制御部40に出力し、処理を終了する。 Next, in S290, all the connection flags stored in the connection map 24 are deleted, and in the subsequent S300, the number of feature values stored in the feature value table 26, that is, the total number of figures 1 together with the interrupt signal is displayed. It outputs to the control part 40 and complete | finishes a process.
制御部40は、特徴量更新部38からの割込み信号を受けて、特徴量表26に記憶された図形の特徴量から、特徴量更新部38から割込み信号と共に入力された図形の総数の数の特徴量を読み出し(例えば、図形の総数が5である場合、特徴量表26の1番目から5番目までの領域の特徴量を読み出す)、読み出した図形の特徴量から特定の物体を認識するための処理を実行する。なお、図形の特徴量から物体を認識する方法は、周知の方法であり、本発明と直接関係する部分ではないため詳細な説明については省略する。 The control unit 40 receives the interrupt signal from the feature amount update unit 38, calculates the total number of graphics input together with the interrupt signal from the feature amount update unit 38 from the feature amount of the figure stored in the feature amount table 26. To read out feature quantities (for example, when the total number of figures is 5, read out feature quantities in the first to fifth areas of the feature quantity table 26), and to recognize a specific object from the feature quantities of the readout figures Execute the process. Note that the method for recognizing an object from a feature amount of a graphic is a well-known method and is not directly related to the present invention, and thus detailed description thereof is omitted.
以上説明したように、本実施形態の画像処理装置10においては、ラベル表22、連結マップ24、特徴量表26からなる算出用記憶部20と、レジスタ28と、ラインバッファ30と、を備え、画像入力I/F部12が、外部装置90から画像データを取得し、二値化処理部14が、画像入力I/F部12から入力された画像データを、画素毎に二値データに変換し、画素判定部16が、二値データに変換された画像データ構成する各画素の種類を順次判定し、新規ラベル発行部32が、画素判定部16の判定結果を受けて図形の識別情報であるラベル番号を発行し、連結情報格納部34が、画素判定部16の判定結果を受けて各図形の連結情報を連結マップ24に格納し、仮特徴量更新部36が、入力されたラベル番号にて特定される図形の特徴量を算出して、算出したラベル番号毎の図形の特徴量を特徴量表26に格納すると共に、入力されたラベル番号が新規ラベル番号である場合には、ラベル表22に新規ラベルを格納する。そして、画素判定部16による1画面分の画像データの判定が終了し、新規ラベル発行部32、連結情報格納部34、仮特徴量更新部36の動作が完了すると、特徴量更新部38が、特徴量表26に記憶されたラベル番号毎の図形の特徴量に、連結マップ24に記憶された連結情報を反映させて、図形の特徴量を更新する。 As described above, the image processing apparatus 10 according to the present embodiment includes the calculation storage unit 20 including the label table 22, the connection map 24, and the feature amount table 26, the register 28, and the line buffer 30. The image input I / F unit 12 acquires image data from the external device 90, and the binarization processing unit 14 converts the image data input from the image input I / F unit 12 into binary data for each pixel. Then, the pixel determination unit 16 sequentially determines the type of each pixel constituting the image data converted into binary data, and the new label issuing unit 32 receives the determination result of the pixel determination unit 16 and uses the graphic identification information. A link number is issued, the link information storage unit 34 receives the determination result of the pixel determination unit 16, stores the link information of each figure in the link map 24, and the temporary feature amount update unit 36 receives the input label number. Figure identified by The feature amount of each figure is calculated and stored in the feature amount table 26. If the input label number is a new label number, a new label is added to the label table 22. Store. Then, when the determination of the image data for one screen by the pixel determination unit 16 is completed and the operations of the new label issuing unit 32, the connection information storage unit 34, and the temporary feature amount update unit 36 are completed, the feature amount update unit 38 The feature quantity of the figure is updated by reflecting the connection information stored in the connection map 24 to the feature quantity of the figure for each label number stored in the feature quantity table 26.
よって、本実施形態の画像処理装置10によれば、画像データを走査しつつ、図形の特徴量を算出する場合に比べ、画像データの走査時間を短縮することができる。このため、外部装置90から、画像データが1画面毎に順次入力されるタイミングに間に合うように画像データを走査し、連続して処理を行うことが可能となる。 Therefore, according to the image processing apparatus 10 of the present embodiment, it is possible to shorten the scanning time of the image data as compared with the case where the feature amount of the figure is calculated while scanning the image data. For this reason, the image data can be scanned from the external device 90 so as to be in time for the sequential input of the image data for each screen, and the processing can be continuously performed.
また、本実施形態の画像処理装置10においては、連結マップ24を、新規ラベル発行部32により発行されたラベル番号のうち、小さい方のラベル番号L1を縦軸、大きい方のラベル番号L2を横軸とするマトリックス状に構成し、連結マップ24上の異なるラベル番号の組合せに対して、ラベル番号L1及びL2にて特定される図形同士が連結しているか否かを示す連結フラグ(L1,L2)を記憶するように構成されている。そして、画素判定部16にて、ラベル番号の異なる図形同士が連結していると判定されると、連結情報格納部34の動作により、連結フラグがセットされる。 Further, in the image processing apparatus 10 of the present embodiment, the connection map 24 is obtained by displaying the smaller label number L1 of the label numbers issued by the new label issuing unit 32 on the vertical axis and the larger label number L2 on the horizontal side. Concatenated flags (L1, L2) indicating whether or not the figures identified by the label numbers L1 and L2 are connected to different combinations of label numbers on the connection map 24. ) Is stored. When the pixel determination unit 16 determines that the figures having different label numbers are connected, the connection flag is set by the operation of the connection information storage unit 34.
よって、本実施形態の画像処理装置10によれば、画素判定部16において、同じラベル番号にて特定される図形同士の連結が繰り返し判定されても、連結情報格納部34は、セットした連結フラグをそのままにしておけばよいだけであり、例えば、連結されていると判定された図形のラベル番号の組合せを全て格納しておく場合と比べ、使用する記憶領域を削減できる。 Therefore, according to the image processing apparatus 10 of the present embodiment, even if the pixel determination unit 16 repeatedly determines the connection between the graphics specified by the same label number, the connection information storage unit 34 sets the connection flag that has been set. The storage area to be used can be reduced as compared with a case where all combinations of graphic label numbers determined to be connected are stored, for example.
一方、特徴量更新部38は、連結マップ24を走査してセットされた連結フラグを検出し、検出したフラグに示されるラベル番号の組合せに対して、ラベル表22及び特徴量表26を書き換えるので、同じラベル番号の組合せに対して、重複して書き換えを行うことがなく、例えば、連結されていると判定された図形のラベル番号の組合せが全て記憶されており、これを読み込んで書き換えを行う場合と比べ、図形の特徴量を算出する際の処理時間を短縮することができる。 On the other hand, the feature amount updating unit 38 scans the connection map 24 to detect the set connection flag, and rewrites the label table 22 and the feature amount table 26 for the combination of the label numbers indicated in the detected flag. The same label number combination is not rewritten twice. For example, all combinations of figure label numbers determined to be connected are stored, and this is read and rewritten. Compared to the case, the processing time for calculating the feature amount of the figure can be shortened.
また、本実施形態の画像処理装置10においては、1画素分のラベル番号を記憶可能なレジスタ28と、1ライン走査分の画素のラベル番号を記憶可能なラインバッファ30と、を備え、仮特徴量更新部36は、特徴量表26を更新すると、レジスタ28に記憶されている1つ前に処理された注目画素のラベル番号を、ラインバッファ30において、この注目画素に対応する領域に書き込み、書き込んだ後に、処理中の注目画素のラベル番号をレジスタ28に書き込むようにしており、画素判定部16は、レジスタ28と、ラインバッファ30に記憶されたラベル番号に基づいて、注目画素の近傍4画素の二値化結果を判定している。 In addition, the image processing apparatus 10 according to the present embodiment includes a register 28 that can store a label number for one pixel, and a line buffer 30 that can store a label number of a pixel for one line scan. When the quantity update unit 36 updates the feature quantity table 26, the label number of the target pixel processed immediately before stored in the register 28 is written in the area corresponding to the target pixel in the line buffer 30. After the writing, the label number of the target pixel being processed is written to the register 28, and the pixel determination unit 16 determines the neighborhood 4 of the target pixel based on the label number stored in the register 28 and the line buffer 30. The binarization result of the pixel is determined.
このため、本実施形態の画像処理装置10によれば、1画面分の画像データを形成する全画素分の注目画素のラベル番号を記憶させる必要が無く、記憶領域が少なくて済む。
また、本実施形態の画像処理装置10において、二値化処理部14は、取得した輝度値に基づいて、各画素が、背景の要素となる画素であるか、または、図形の要素となる図形画素であるかを、予め設定されたしきい値により順次判定しているので、画像データを構成する各画素の輝度の違いから、画像データを二値データに変換し、図形画素を抽出することができる。
Therefore, according to the image processing apparatus 10 of the present embodiment, it is not necessary to store the label numbers of the target pixels for all the pixels forming the image data for one screen, and the storage area can be reduced.
Further, in the image processing apparatus 10 according to the present embodiment, the binarization processing unit 14 determines whether each pixel is a pixel serving as a background element or a graphic element based on the acquired luminance value. Since it is sequentially judged whether it is a pixel or not by a preset threshold value, image data is converted into binary data and graphic pixels are extracted from the difference in luminance of each pixel constituting the image data Can do.
さらに、二値化処理部14は、画像データを4画素毎に取得して二値データに変換し、その二値データに変換した画像データを4画素毎に画素判定部16に出力するように構成されており、画素の取得、送信にかかる時間を削減できるので、画像データを二値データに変換するための時間を長くとることができ、処理速度の制約が緩和される。また、本実施形態においては、画素の輝度値は8ビットのデータにより構成されており、輝度値が伝送される伝送路のバス幅が32ビットのもので構成されているので、4画素毎に送信することにより効率よく画像データを送受することができる。 Further, the binarization processing unit 14 acquires the image data every four pixels, converts the image data into binary data, and outputs the image data converted into the binary data to the pixel determination unit 16 every four pixels. Since it is configured and the time required for pixel acquisition and transmission can be reduced, the time for converting image data into binary data can be increased, and the restriction on the processing speed is eased. In this embodiment, the luminance value of the pixel is composed of 8-bit data, and the bus width of the transmission path through which the luminance value is transmitted is composed of 32 bits. By transmitting, image data can be transmitted and received efficiently.
また、画素判定部16は、注目画素を中心として周囲8方向に隣接する図形画素を、この注目画素に連結された画素として判定するように構成されているので、図形の形状が複雑であっても、1つの図形であることを確実に識別することができる。 Further, since the pixel determination unit 16 is configured to determine a graphic pixel adjacent in the eight directions around the pixel of interest as a pixel connected to the pixel of interest, the shape of the graphic is complicated. Can also be reliably identified as a single figure.
そして、連結情報格納部34と、新規画素更新部36a及び追加画素更新部36bと、は各々独立して動作可能に別々の電子回路にて構成されているので、連結フラグをセットする動作と、特徴量表26の書き換え動作等とを並列に行うことができ、処理時間を短縮することができる。 Since the link information storage unit 34, the new pixel update unit 36a, and the additional pixel update unit 36b are each configured by separate electronic circuits that can operate independently, an operation of setting a link flag; The rewriting operation of the feature quantity table 26 and the like can be performed in parallel, and the processing time can be shortened.
また、本実施形態の画像処理装置10においては、図形の特徴量として面積を算出しているので、一旦走査した画像データを再度走査する必要がなく、走査後の画像データを記憶するための記憶手段や、再度走査を行うための回路等を設ける必要がなく都合がよい。 Further, in the image processing apparatus 10 of the present embodiment, the area is calculated as the feature amount of the graphic, so that it is not necessary to scan the scanned image data again, and a memory for storing the scanned image data. There is no need to provide a means or a circuit for performing scanning again, which is convenient.
なお、本実施形態において、画像入力I/F部12は、本発明の第1画像取得手段に相当し、二値化処理部14は本発明の二値化手段に相当し、画素判定部16は、本発明の画素判定手段に相当し、算出用記憶部20は、本発明の記憶手段群に相当し、ラベル表22は、本発明のラベル記憶手段に相当し、連結マップ24は、本発明の連結情報記憶手段に相当し、特徴量表26は、本発明の特徴量記憶手段に相当し、新規ラベル発行部32は、本発明の新規ラベル発行手段に相当し、連結情報格納部34は、本発明の連結情報格納手段に相当し、仮特徴量更新部36の新規画素更新部36aは、本発明の初期値設定手段に相当し、仮特徴量更新部36の追加画素更新部36bは、本発明の既存値更新手段に相当し、特徴量更新部38は、本発明の特徴量更新手段に相当する。 In the present embodiment, the image input I / F unit 12 corresponds to the first image acquisition unit of the present invention, the binarization processing unit 14 corresponds to the binarization unit of the present invention, and the pixel determination unit 16 Corresponds to the pixel determination means of the present invention, the calculation storage unit 20 corresponds to the storage means group of the present invention, the label table 22 corresponds to the label storage means of the present invention, and the connection map 24 The feature quantity table 26 corresponds to the feature quantity storage means of the present invention, the new label issuing unit 32 corresponds to the new label issue means of the present invention, and the linked information storage section 34 corresponds to the linked information storage means of the invention. Corresponds to the linked information storage unit of the present invention, and the new pixel update unit 36a of the temporary feature amount update unit 36 corresponds to the initial value setting unit of the present invention, and the additional pixel update unit 36b of the temporary feature amount update unit 36. Corresponds to the existing value updating means of the present invention, and the feature amount updating unit 38 Corresponding to the characteristic value update section.
以上、本発明の一実施形態について説明したが、本発明は、種々の形態を採り得ることは言うまでもない。
例えば、本実施形態の画像処理装置10の変形例1として、図形の特徴量の検出時間を短縮するために、特徴量更新部38の動作を図8に示すように行うようにしてもよい。図8は、変形例1の特徴量更新部38の動作を示すフローチャートである。
As mentioned above, although one Embodiment of this invention was described, it cannot be overemphasized that this invention can take a various form.
For example, as a first modification of the image processing apparatus 10 of the present embodiment, the operation of the feature amount update unit 38 may be performed as shown in FIG. 8 in order to shorten the detection time of the feature amount of the graphic. FIG. 8 is a flowchart showing the operation of the feature amount updating unit 38 of the first modification.
図8に示すように、特徴量更新部38が処理を開始すると、連結マップ24をラスタ式に走査する。まず、S310にて、連結フラグ(L1,L2)がセットされているか否かを判断し、連結フラグ(L1,L2)がセットされていると判断すると、続くS320では、ラベル表22のL2番目の領域に記憶されたラベル番号がL2と等しいか否か、つまり、L2番目の領域が既に書き換えられているか否かを判断する。そして、L2番目に記憶されたラベル番号がL2と等しい、つまり、L2番目の領域がまだ書き換えられていないと判断した場合には、L2>L1であることから、L2番目に記憶されたラベル番号T[L2]はL1番目に記憶されたラベル番号T[L1]より大きい番号(つまりT[L2]>T[L1])であるので、S330にて、ラベル表22にL2番目に記憶されたラベル番号T[L2]をL1番目に記憶されたラベル番号T[L1]に書き換える。 As shown in FIG. 8, when the feature amount update unit 38 starts processing, the connection map 24 is scanned in a raster manner. First, in S310, it is determined whether or not the concatenation flag (L1, L2) is set, and if it is determined that the concatenation flag (L1, L2) is set, then in S320, the L2th label table 22 is displayed. It is determined whether or not the label number stored in the area is equal to L2, that is, whether or not the L2th area has been rewritten. When it is determined that the L2th stored label number is equal to L2, that is, the L2th area has not been rewritten yet, L2> L1, so the L2th stored label number Since T [L2] is a number larger than the L1 stored label number T [L1] (that is, T [L2]> T [L1]), it is stored in the label table 22 at L2 in S330. The label number T [L2] is rewritten to the L1-th stored label number T [L1].
補足すると、特徴量更新部38は、連結マップ24をラスタ式に走査するので、例えば、L1=3の行の走査を実行中に連結フラグ(3,4)がセットされていることを検出し、ラベル表22の4番目の領域にラベル番号4が記憶されている場合、つまり、4番目の領域のラベル番号が1または2に書き換えられていない場合には、まだラベル番号L1=4の行の走査の実行前なので、ラベル番号が4の領域は、4番目の領域以外には存在しないことは明らかであることから、ラベル表22からラベル番号が4の領域を検索することなく、4番目の領域に記憶されたラベル番号4(T[4])を3番目の領域に記憶されたラベル番号3(T[3])と書き換えることができる。 Supplementally, since the feature amount update unit 38 scans the connection map 24 in a raster manner, for example, it detects that the connection flag (3, 4) is set while scanning L1 = 3. When the label number 4 is stored in the fourth area of the label table 22, that is, when the label number of the fourth area has not been rewritten to 1 or 2, the row with the label number L1 = 4 is still present. Since it is clear that the area with the label number 4 does not exist in any area other than the fourth area, the fourth area is searched without searching the area with the label number 4 from the label table 22. The label number 4 (T [4]) stored in the first area can be rewritten with the label number 3 (T [3]) stored in the third area.
一方、4番目の領域のラベル番号が1または2に書き換えられている場合には、3番目の領域に記憶されたラベル番号T[3]と4番目の領域に記憶されたラベル番号T[4]の何れが大きいかを判断し、T[3]とT[4]の何れか大きい方のラベル番号の値に書き換えられている領域を検索する必要がある。これは、例えば、T[3]=2、T[4]=1である場合には、ラベル番号L1=2の行の走査は終了しているために、ラベル番号が2に書き換えられている領域が他にある可能性があるためであり、ラベル番号2が記憶された領域も、ラベル番号1に書き換える必要がある。 On the other hand, when the label number of the fourth area is rewritten to 1 or 2, the label number T [3] stored in the third area and the label number T [4 stored in the fourth area ] Is larger, and it is necessary to search an area rewritten with the value of the larger label number of T [3] and T [4]. This is because, for example, when T [3] = 2 and T [4] = 1, the scanning of the row with label number L1 = 2 has been completed, so the label number has been rewritten to 2. This is because there is a possibility that there is another area, and the area in which the label number 2 is stored also needs to be rewritten to the label number 1.
そして、続くS340にて、特徴量表26に記憶された、ラベル番号L1にて特定される図形の面積S[L1](つまり、L1番目の領域に記憶された面積)と、ラベル番号L2にて特定される図形の面積S[L2](つまり、L2番目の領域に記憶された面積)との和を算出して面積S[L1]を算出した値に書き換え、S350にて、面積S[L2]を0に書き換え、S420に移行する。 In S340, the area S [L1] of the figure specified by the label number L1 (that is, the area stored in the L1th area) stored in the feature table 26 and the label number L2 are stored. The area S [L2] (that is, the area stored in the L2th region) of the figure specified in this way is calculated and rewritten with the calculated value, and the area S [ L2] is rewritten to 0, and the process proceeds to S420.
一方、S320にて、L2番目に記憶されたラベル番号がL2でない、つまり、ラベル番号が書き換えられていると判断した場合には、S360に移行し、S360からS410の動作を行うが、本動作については、上記実施形態におけるS220からS270の動作と同じであるため、説明は省略する。また、S420からS440の動作についても、上記実施形態におけるS280からS300の動作と同じであるため、この説明についても省略する。 On the other hand, if it is determined in S320 that the L2 stored label number is not L2, that is, the label number has been rewritten, the process proceeds to S360 and the operations from S360 to S410 are performed. Since this is the same as the operation from S220 to S270 in the above embodiment, description thereof is omitted. Also, the operations from S420 to S440 are the same as the operations from S280 to S300 in the above-described embodiment, so this description is also omitted.
以上説明したように、変形例1の画像処理装置10において、特徴量更新部38は、連結マップ24をラスタ式に走査し、連結フラグ(L1,L2)がセットされていることを検出すると、ラベル表22のL2番目の領域に記憶されたラベル番号T[L2]が書き換えられているか否かを判断し、この領域に記憶されたラベル番号が書き換えられている場合には、ラベル表22を検索し、ラベル表22のL1番目とL2番目の領域に記憶されたラベル番号のうちの大きい方のラベル番号Lmaxを抽出し、抽出したラベル番号Lmaxを、ラベル表22のL1番目とL2番目の領域に記憶されたラベル番号のうちの小さい方のラベル番号Lminに書き換える。一方、L2番目の領域に記憶されたラベル番号T[L2]が書き換えられていない場合には、L2をL1番目の領域に記憶されたラベル番号T[L1]に書き換える。 As described above, in the image processing apparatus 10 according to the first modification, the feature amount update unit 38 scans the connection map 24 in a raster manner and detects that the connection flag (L1, L2) is set. It is determined whether or not the label number T [L2] stored in the L2 area of the label table 22 has been rewritten. If the label number stored in this area has been rewritten, the label table 22 is stored. A search is performed to extract the larger label number Lmax of the label numbers stored in the L1 and L2 areas of the label table 22, and the extracted label number Lmax is extracted from the L1 and L2th labels of the label table 22. The label number Lmin that is smaller of the label numbers stored in the area is rewritten. On the other hand, when the label number T [L2] stored in the L2th area has not been rewritten, L2 is rewritten to the label number T [L1] stored in the L1th area.
よって、変形例1の画像処理装置10によれば、特徴量更新部38は、ラベル番号T[L2]が書き換えられているか否かにより以降の動作を選択し、T[L2]が書き換えられていない場合にはラベル表22の検索を行わないので、図形の特徴量の算出時間を短縮することが可能となる。 Therefore, according to the image processing apparatus 10 of the first modification, the feature amount updating unit 38 selects the subsequent operation depending on whether or not the label number T [L2] is rewritten, and T [L2] is rewritten. If not, the label table 22 is not searched, so that it is possible to shorten the calculation time of the graphic feature amount.
また、本実施形態の画像処理装置10の変形例2として、図9に示すように、記憶部18に、算出用記憶部20を2つ設けるようにしてもよい。
つまり、本実施形態では、記憶部18は、ラベル表22、連結マップ24、特徴量表26からなる算出用記憶部20を1つ備えており、この算出用記憶部20を図形の特徴量の算出に使用するように構成したが、ラベル表22と、連結マップ24と、特徴量表26とから構成される算出用記憶部20を2つ設け、連結情報格納部34及び仮特徴量更新部36が、2つの算出用記憶部20のうちの1つを共通に使用し、しかも、1画面分の画像データ毎に、使用する算出用記憶部20を交互に変更し、特徴量更新部38が、2つの算出用記憶部20を順に選択し、この選択した算出用記憶部20に記憶されたデータに基づいて処理を行うように構成してもよい。
Further, as a second modification of the image processing apparatus 10 according to the present embodiment, as shown in FIG. 9, two calculation storage units 20 may be provided in the storage unit 18.
In other words, in the present embodiment, the storage unit 18 includes one calculation storage unit 20 including a label table 22, a connection map 24, and a feature amount table 26. Although it was comprised so that it might be used for calculation, two calculation memory | storage parts 20 comprised from the label table | surface 22, the connection map 24, and the feature-value table 26 are provided, the connection information storage part 34 and the temporary feature-value update part 36 uses one of the two calculation storage units 20 in common, and alternately changes the calculation storage unit 20 to be used for each image data of one screen, and the feature amount update unit 38. However, the two calculation storage units 20 may be selected in order, and processing may be performed based on the data stored in the selected calculation storage unit 20.
このように構成された変形例2の画像処理装置によれば、算出用記憶部20が交互に使用されるので、例えば、特徴量更新部38による図形の特徴量の算出に時間がかかり、図形の特徴量の算出を終了する前に、次の画像データが入力されたとしても、次の画像データの情報が、特徴量更新部38が使用している算出用記憶部20に書き込まれることはなく、確実に図形の特徴量を算出することが可能となる。 According to the image processing apparatus of Modification 2 configured as described above, the calculation storage unit 20 is alternately used. Therefore, for example, it takes time to calculate the feature amount of the figure by the feature amount update unit 38, and the figure Even if the next image data is input before the calculation of the feature amount is completed, the information on the next image data is not written to the calculation storage unit 20 used by the feature amount update unit 38. Therefore, it is possible to reliably calculate the feature amount of the figure.
そして、算出用記憶部20を複数設け、各算出用記憶部20を順次使用するようにしても同様の効果を得ることができるが、本変形例2においては、カメラ等からなる外部装置90から出力される画像データを処理しており、カメラ等の撮像装置により撮像された画像データが1画面毎に出力されるタイミングの間隔と、画像処理装置10が、1画面分の画像データを走査し、画像データに含まれる図形の特徴量を算出する時間とは、ほぼ等しいことが推測されるために、算出用記憶部20を2つ設け、交互に使用することにより、最小限の記憶領域で、確実に図形の特徴量の算出をすることが可能である。 The same effect can be obtained by providing a plurality of calculation storage units 20 and using each calculation storage unit 20 in sequence. However, in the second modification, the external device 90 such as a camera is used. The output image data is processed, the timing interval at which the image data captured by the imaging device such as a camera is output for each screen, and the image processing device 10 scans the image data for one screen. Since it is presumed that the time for calculating the feature amount of the graphic included in the image data is almost equal, two calculation storage units 20 are provided and used alternately, thereby minimizing the storage area. It is possible to reliably calculate the feature amount of the figure.
一方、本実施形態の画像処理装置10の変形例3として、画像入力I/F部12は、カメラ等の外部装置90に接続されて、処理対象となる画像データを取得可能に構成されていることに加え、更に、CDR等の記憶媒体に記憶された画像データを取得できるように構成してもよい。 On the other hand, as a third modification of the image processing apparatus 10 of the present embodiment, the image input I / F unit 12 is connected to an external device 90 such as a camera and configured to be able to acquire image data to be processed. In addition, the image data stored in a storage medium such as a CDR may be acquired.
このようにすれば、CDR等の記憶媒体に画像データが記憶されている場合にも、この画像データを取得し、図形の特徴量を抽出することが可能となる。なお、本変形例3において、画像入力I/F部12は、本発明の第1画像取得手段及び第2画像取得手段に相当する。 In this way, even when image data is stored in a storage medium such as a CDR, it is possible to acquire this image data and extract a feature amount of a figure. In the third modification, the image input I / F unit 12 corresponds to a first image acquisition unit and a second image acquisition unit of the present invention.
また、本実施形態の画像処理装置10は、下記の変形例4に示すように、取得した画像データから、移動物体を表す図形を抽出し、この図形の特徴量を算出するように構成してもよい。 The image processing apparatus 10 according to the present embodiment is configured to extract a graphic representing a moving object from the acquired image data and calculate a feature amount of the graphic, as shown in Modification 4 below. Also good.
以下、このように構成された変形例4の画像処理装置について説明する。
変形例4の画像処理装置10は、図10に示すように、画像入力I/F12が取得した画像データに基づいて生成される基準データを記憶するための書き換え可能なメモリ(例えばSRAM、SDRAM等)からなる画像記憶部60を備えている。
Hereinafter, an image processing apparatus of Modification 4 configured as described above will be described.
As shown in FIG. 10, the image processing apparatus 10 according to Modification 4 includes a rewritable memory (for example, SRAM, SDRAM, etc.) for storing reference data generated based on image data acquired by the image input I / F 12. ) Is provided.
画像入力I/F部12は、外部から取得した画像データを走査してデジタル信号化し、各画素の座標(X,Y)及び輝度値を二値化処理部14に送信すると共に、例えば、取得した画像データ及び画像記憶部60に記憶された過去の基準データから背景を表す基準データを生成し、画像記憶部60に格納する。 The image input I / F unit 12 scans image data acquired from the outside into a digital signal, transmits the coordinates (X, Y) and luminance values of each pixel to the binarization processing unit 14, and acquires, for example, The reference data representing the background is generated from the obtained image data and the past reference data stored in the image storage unit 60, and stored in the image storage unit 60.
二値化処理部14は、画像入力I/F部12から書き込み信号を受けると、画像入力I/F部12から送信された画像データを4画素毎に取得し、順次画像記憶部60に記憶された1画面前の画像データに基づく基準データとの輝度値の差分を計算し、差分データを算出する。 When the binarization processing unit 14 receives a write signal from the image input I / F unit 12, the binarization processing unit 14 acquires the image data transmitted from the image input I / F unit 12 every four pixels and sequentially stores them in the image storage unit 60. A difference in luminance value from the reference data based on the image data one screen before is calculated, and difference data is calculated.
そして、算出した輝度値の差分に基づいて、差分データを構成する各画素を、予め設定されたしきい値により、背景の要素となる画素(本実施形態では白画素)、または、移動物体を表す図形の要素となる図形画素(本実施形態では黒画素)の何れかを表す二値データに変換し、背景画素が0、図形画素が1として表された二値化結果及び、各画素の座標(X,Y)を、4画素毎に書き込み信号と共に画素判定部16に送信する。そして、再び書き込み信号を受けると、次の4画素のデータを取得し、同じ動作を繰り返し実行する。 Then, based on the difference between the calculated luminance values, each pixel constituting the difference data is converted to a pixel (a white pixel in the present embodiment) as a background element or a moving object by a preset threshold value. The result is converted into binary data representing any of the graphic pixels (black pixels in the present embodiment) that are the elements of the graphic to be represented, and the binarization result in which the background pixel is represented as 0 and the graphic pixel is represented as 1 The coordinates (X, Y) are transmitted to the pixel determination unit 16 together with the write signal every four pixels. When the write signal is received again, the next four pixels of data are acquired, and the same operation is repeated.
このように、本変形例4の画像処理装置10においては、二値化処理部16が、取得した画像データと、画像記憶部60に順次記憶される基準データとの差分から差分データを算出し、この差分データの各画素を輝度値にて設定されたしきい値により二値データに変換している。 As described above, in the image processing apparatus 10 according to the fourth modification, the binarization processing unit 16 calculates difference data from the difference between the acquired image data and the reference data sequentially stored in the image storage unit 60. Each pixel of the difference data is converted into binary data by a threshold value set with a luminance value.
このため、本変形例4の画像処理装置10によれば、2つの画像データ間で輝度値が変化した画素、つまり、移動物体の画素を検出し、この画素を図形画素とした二値化結果が画素判定部16に出力されるので、移動物体を表す図形の特徴量を算出することができる。 For this reason, according to the image processing apparatus 10 of the fourth modification, a pixel whose luminance value has changed between two pieces of image data, that is, a pixel of a moving object is detected, and a binarization result using the pixel as a graphic pixel Is output to the pixel determination unit 16, and the feature amount of the figure representing the moving object can be calculated.
また、本実施形態の画像処理装置10の変形例5として、画素判定部16は、図形画素からなる注目画素の周囲4方向(上下左右)の画素が図形画素である場合に、注目画素と、各図形画素とが連結されていると判断するように構成してもよい。 Further, as a fifth modification of the image processing apparatus 10 according to the present embodiment, the pixel determination unit 16 determines that when the pixels in the four directions (up, down, left, and right) around the target pixel made up of graphic pixels are graphic pixels, You may comprise so that it may judge that each figure pixel is connected.
以下、上記のように画素の判断を実行する画素判定部16について説明する。変形例5の画素判定部16は、上記実施形態の画素判定部16と同様に、二値化処理部14から送信される書き込み信号を受けて、二値化処理部14から送信された4画素のデータを取得し、取得した4画素を座標(X,Y)の値が小さい画素から順に検索し、各画素の二値化結果から図形画素を抽出する。そして、図形画素を抽出すると、この図形画素を注目画素として、図11(a)に示すように、この注目画素と、この注目画素の近傍2画素(上、左の2画素)との合計3つの画素の二値化結果から、図11(b)に示す、画素判定フラグ発行規則に基づいて注目画素を分類して画素判定フラグのうちの何れかをセットし、以下に説明する画素判定フラグに基づく動作を実行する。そして、画素判定フラグに基づく動作が終了すると、次の図形画素を抽出し、抽出した画素を新たな注目画素として、4画素のデータに含まれる全ての図形画素について画素判定フラグのセット及び画素判定フラグに基づく動作を実行する。そして、4画素のデータに含まれる全ての図形画素に対する動作を終了すると、次の書き込み信号を受けるまで、動作を停止する。なお、図11(a)は、注目画素の分類に使用する3画素を示す説明図、図11(b)は、画素判定フラグ発行規則を示す説明図である。 Hereinafter, the pixel determination unit 16 that performs pixel determination as described above will be described. Similarly to the pixel determination unit 16 of the above embodiment, the pixel determination unit 16 of Modification 5 receives the write signal transmitted from the binarization processing unit 14 and receives the four pixels transmitted from the binarization processing unit 14. The obtained four pixels are searched in order from the pixel having the smallest coordinate (X, Y) value, and a graphic pixel is extracted from the binarization result of each pixel. Then, when the graphic pixel is extracted, the graphic pixel is set as the target pixel, and as shown in FIG. 11A, a total of 3 of the target pixel and the two neighboring pixels (upper and left two pixels) of the target pixel. From the binarization result of one pixel, the pixel of interest is classified based on the pixel determination flag issuing rule shown in FIG. 11B, and one of the pixel determination flags is set, and the pixel determination flag described below Perform actions based on. When the operation based on the pixel determination flag ends, the next graphic pixel is extracted, and the pixel determination flag set and the pixel determination are performed for all graphic pixels included in the four pixel data, with the extracted pixel as a new target pixel. Perform an action based on the flag. When the operation for all the graphic pixels included in the data of the four pixels is completed, the operation is stopped until the next write signal is received. FIG. 11A is an explanatory diagram showing three pixels used for classifying a target pixel, and FIG. 11B is an explanatory diagram showing a pixel determination flag issuing rule.
以下に、画素判定部16の動作を、発行する画素判定フラグ別に詳細に説明する。
画素判定部16は、近傍2画素の二値化結果を検出し、近傍2画素の二値化結果が、図11(b)の1段目に示すパターンである、つまり、注目画素の周囲に図形画素が存在せず、注目画素が、新たな図形を形成する画素であると判定すると、画素判定フラグNをセットし、注目画像の座標(X,Y)を新規ラベル発行部32に出力する。
Hereinafter, the operation of the pixel determination unit 16 will be described in detail for each pixel determination flag to be issued.
The pixel determination unit 16 detects the binarization result of the neighboring two pixels, and the binarization result of the neighboring two pixels is the pattern shown in the first row of FIG. 11B, that is, around the target pixel. If it is determined that there is no graphic pixel and the target pixel is a pixel forming a new graphic, the pixel determination flag N is set, and the coordinates (X, Y) of the target image are output to the new label issuing unit 32. .
また、画素判定部16は、近傍2画素の二値化結果が、図11(b)の2段目に示すパターンである、つまり、注目画素が既存の図形の一部を形成する画素であり、且つ、既存の図形を連結させる可能性があると判定すると、画素判定フラグCをセットし、近傍2画素の2種類のラベル番号L1及びラベル番号L2(ただし、L1≦L2とする)のうちのラベル番号L1と、注目画素の座標(X,Y)とを仮特徴量更新部36に出力する。そして、ラベル番号L1がラベル番号L2と等しいか否かを判断し、等しくない場合には、更に、ラベル番号L1及びラベル番号L2(ただし、L1<L2とする)を、連結情報格納部34に出力する。 Further, the pixel determination unit 16 has a binarization result of two neighboring pixels as a pattern shown in the second row in FIG. 11B, that is, the pixel of interest forms a part of an existing figure. If it is determined that there is a possibility of linking existing figures, the pixel determination flag C is set, and two types of label numbers L1 and L2 (where L1 ≦ L2) of two neighboring pixels are set. Label number L1 and the coordinates (X, Y) of the target pixel are output to the temporary feature amount updating unit 36. Then, it is determined whether or not the label number L1 is equal to the label number L2. If not equal, the label number L1 and the label number L2 (assuming that L1 <L2) are further stored in the connection information storage unit 34. Output.
そして、画素判定部16は、近傍2画素の二値化結果が、図11(b)の3段目に示すパターンのうちの何れかである、つまり、注目画素が既存の図形の一部を形成する画素であると判定すると、画素判定フラグDをセットし、近傍2画素のラベル番号L1と、注目画素の座標(X,Y)とを仮特徴量更新部36に出力する。 Then, the pixel determination unit 16 determines that the binarization result of the neighboring two pixels is one of the patterns shown in the third row of FIG. 11B, that is, the target pixel is a part of the existing figure. If it is determined that the pixel is to be formed, the pixel determination flag D is set, and the label number L1 of the two neighboring pixels and the coordinates (X, Y) of the target pixel are output to the temporary feature amount update unit 36.
このように構成された、変形例5の画像処理装置10においては、画素判定部16が、注目画素が図形画素であるか否かを判断し、注目画素が図形画素である場合にこの注目画素と、この注目画素の近傍2画素(上、左の2画素)との合計3つの画素の二値化結果から、画素判定フラグ発行規則に基づいて注目画素を分類して画素判定フラグのうちの何れかをセットし、画素判定フラグに基づく動作を実行する。 In the image processing device 10 of the modification 5 configured as described above, the pixel determination unit 16 determines whether or not the target pixel is a graphic pixel, and when the target pixel is a graphic pixel, the target pixel is determined. From the binarization result of a total of three pixels including the two neighboring pixels (upper and left two pixels) of the target pixel, the target pixel is classified based on the pixel determination flag issuing rule, Either one is set, and the operation based on the pixel determination flag is executed.
このため、変形例5の画像処理装置10によれば、例えば、2つの物体が斜め方向で接続されている場合に、これらの物体を表す図形は連結されていないと判断されるので、これらを別の物体と識別することができる。また、近傍2画素の二値化結果を識別することで、注目画素の分類ができるので、近傍4画素の二値化結果を識別する場合に比べ動作時間を短縮することができる。 For this reason, according to the image processing apparatus 10 of the modification 5, for example, when two objects are connected in an oblique direction, it is determined that the figures representing these objects are not connected. It can be distinguished from another object. Further, since the pixel of interest can be classified by identifying the binarization result of the two neighboring pixels, the operation time can be shortened compared to the case of identifying the binarization result of the four neighboring pixels.
また、本実施形態及び変形例の画像処理装置10においては、図形の特徴量として、図形の面積を算出したが、必ずしも面積である必要は無く、図形の重心、図形の周囲長、図形の平均輝度、図形を包含する矩形を算出するようにしてもよい。 Further, in the image processing apparatus 10 of the present embodiment and the modification, the area of the figure is calculated as the feature amount of the figure. However, the area is not necessarily the area, and the center of the figure, the perimeter of the figure, the average of the figure A rectangle including luminance and a figure may be calculated.
このようにすると、図形の面積を算出する場合と同様に、1回の走査で図形の特徴量を算出することができるので、画像データを保存する領域を設け、画像データを保存しておく必要が無く、都合がよい。また、画像データを記憶するための領域が確保できる場合には、画像データをこの領域に一旦保存し、再度走査できるように構成すれば、例えば、図形の分散等の2回以上の走査を必要とする図形の特徴量も算出することが可能である。 In this way, as in the case of calculating the area of the graphic, the feature amount of the graphic can be calculated by one scan. Therefore, it is necessary to provide an area for storing image data and store the image data. There is no convenience. In addition, when an area for storing image data can be secured, if the image data is temporarily stored in this area and can be scanned again, for example, two or more scans such as dispersion of graphics are required. It is also possible to calculate the feature quantity of the figure.
一方、本実施形態及び変形例の画像処理装置10において、二値化処理部14は、画像データを4画素毎に取得して、4画素毎に送信するようにしたが、二値化処理の速度に余裕がある場合には、1画素毎に取得して、1画素毎に送信するようにしてもよい。 On the other hand, in the image processing apparatus 10 according to the present embodiment and the modification, the binarization processing unit 14 acquires image data every four pixels and transmits the image data every four pixels. When there is a margin in speed, it may be acquired for each pixel and transmitted for each pixel.
また、本実施形態では、制御部40を除く各部を、クロック生成部を備える1つのLSI50にて構成したが、CPU、RAM等を備え、所定のプログラムを実行するマイクロコンピュータ等によりソフトウェア的に構成し、各部の処理を実行させるようにすることも可能である。 In the present embodiment, each unit except for the control unit 40 is configured by one LSI 50 including a clock generation unit. However, it is configured by software such as a microcomputer that includes a CPU, a RAM, and the like and executes a predetermined program. However, it is also possible to execute the processing of each unit.
10…画像処理装置、12…画像入力I/F部、14…二値化処理部、16…画素判定部、18…記憶部、20…算出用記憶部、22…ラベル表、24…連結マップ、26…特徴量表、28…レジスタ、30…ラインバッファ、32…新規ラベル発行部、34…連結情報格納部、36…仮特徴量更新部、36a…新規画素更新部、36b…追加画素更新部、38…特徴量更新部、40…制御部、50…LSI、60…画像記憶部、90…外部装置 DESCRIPTION OF SYMBOLS 10 ... Image processing apparatus, 12 ... Image input I / F part, 14 ... Binarization process part, 16 ... Pixel determination part, 18 ... Memory | storage part, 20 ... Memory | storage part for calculation, 22 ... Label table, 24 ... Connection map , 26 ... feature quantity table, 28 ... register, 30 ... line buffer, 32 ... new label issuing section, 34 ... linked information storage section, 36 ... temporary feature quantity update section, 36a ... new pixel update section, 36b ... additional pixel update Unit 38, feature amount updating unit 40, control unit 50, LSI, 60 image storage unit 90, external device
Claims (16)
前記図形の識別情報であるラベルが、前記画像データを構成する画素毎に記憶される画素情報記憶手段と、
前記画像データを、各画素毎に、前記図形の要素となる図形画素であるか、該図形画素以外の背景画素であるかを表す二値データに変換する二値化手段と、
該二値化手段により二値データに変換された画像データを走査して、該画像データから前記図形画素を順次注目画素として抽出し、該抽出した注目画素の周囲の画素のラベルを前記画素情報記憶手段から取得し、該取得した周囲の画素のラベルに基づいて、該注目画素が、新たな図形を形成する新規画素であるか、または、既に形成された図形の一部となる追加画素であるかを判定し、前記注目画素が追加画素である場合には、更に、該追加画素が複数の異なる図形を連結させる連結画素であるか否かを判定する画素判定手段と、
該画素判定手段により前記注目画素が前記新規画素であると判定されると、新規にラベルを発行する新規ラベル発行手段と、
前記画素判定手段により前記注目画素が前記連結画素であると判定されると、該連結画素にて複数の図形が連結されていることを表す連結情報を連結情報記憶手段に格納する連結情報格納手段と、
前記画素判定手段により前記注目画素が前記新規画素であると判定されると、前記新規ラベル発行手段により発行された新規ラベルをラベル記憶手段に格納すると共に、該新規ラベルにて特定される図形の特徴量として、初期値を特徴量記憶手段に格納し、更に、該新規ラベルを前記注目画素のラベルとして前記画素情報記憶手段に格納する初期値設定手段と、
前記画素判定手段により前記注目画素が前記追加画素であると判定されると、前記特徴量記憶手段に記憶された図形の特徴量のうち、該追加画素がその一部となる図形の特徴量を更新し、更に、該追加画素がその一部となる図形のラベルを前記注目画素のラベルとして前記画素情報記憶手段に格納する既存値更新手段と、
前記画素判定手段による1画面分の画像データの走査が終了し、該画素判定手段の判定に基づく、前記新規ラベル発行手段、前記連結情報格納手段、前記初期値設定手段、前記既存値更新手段の動作が完了すると、前記連結情報記憶手段に記憶された連結情報に基づいて、前記ラベル記憶手段に記憶されたラベルのうち、同一図形と認識された各図形のラベルを書き換えて一致させ、前記特徴量記憶手段に記憶された図形の特徴量のうち、前記ラベルが一致される前の各ラベルにて特定される各図形の特徴量を合成し、該合成した特徴量を前記一致されたラベルにて特定される図形の特徴量として前記特徴量記憶手段に格納する特徴量更新手段と、
を備えるとともに、
前記ラベル記憶手段と、前記連結情報記憶手段と、前記特徴量記憶手段とから構成される記憶手段群を複数備え、
前記初期値設定手段と、前記既存値更新手段と、前記連結情報格納手段とは、前記複数の記憶手段群のうちの1つを共通に使用し、しかも、1画面分の画像データ毎に、使用する記憶手段群を順に変更し、
前記特徴量更新手段は、前記複数の記憶手段群を順に選択し、該選択した記憶手段群に記憶されたデータに基づいて処理を行うことを特徴とする画像処理装置。 An image processing apparatus that scans image data composed of a plurality of pixels arranged in a vertical direction and a horizontal direction, and calculates a feature amount of a graphic composed of connected pixel groups included in the image data,
A pixel information storage unit in which a label which is identification information of the graphic is stored for each pixel constituting the image data;
Binarization means for converting the image data into binary data representing whether each pixel is a graphic pixel as an element of the graphic or a background pixel other than the graphic pixel;
The image data converted into binary data by the binarization means is scanned, and the graphic pixel is sequentially extracted as a target pixel from the image data, and the labels of the pixels around the extracted target pixel are the pixel information. Based on the labels of the surrounding pixels acquired from the storage means, the target pixel is a new pixel that forms a new graphic, or an additional pixel that becomes a part of a graphic already formed Pixel determining means for determining whether or not the target pixel is an additional pixel, and further determining whether or not the additional pixel is a connected pixel that connects a plurality of different figures;
A new label issuing means for newly issuing a label when the pixel determining means determines that the target pixel is the new pixel;
When the pixel determination unit determines that the target pixel is the connected pixel, the connection information storage unit stores connection information indicating that a plurality of figures are connected to the connection pixel in the connection information storage unit. When,
When the pixel determining unit determines that the target pixel is the new pixel, the new label issued by the new label issuing unit is stored in the label storage unit, and the graphic specified by the new label is stored. An initial value setting means for storing an initial value as a feature quantity in the feature quantity storage means, and further storing the new label as a label of the target pixel in the pixel information storage means;
When the pixel determination unit determines that the target pixel is the additional pixel, among the feature amounts of the figure stored in the feature amount storage unit, the feature amount of the figure that the additional pixel is a part of is calculated. Updating an existing value updating means for storing in the pixel information storage means a label of a graphic of which the additional pixel is a part thereof, as a label of the target pixel;
Scanning of image data for one screen by the pixel determination unit is completed, and the new label issuing unit, the connection information storage unit, the initial value setting unit, and the existing value update unit are based on the determination of the pixel determination unit. When the operation is completed, based on the connection information stored in the connection information storage means, the label of each figure recognized as the same figure among the labels stored in the label storage means is rewritten and matched, Among the feature quantities of the figure stored in the quantity storage means, the feature quantities of each figure specified by each label before the labels are matched are synthesized, and the synthesized feature quantities are used as the matched labels. Feature quantity updating means for storing in the feature quantity storage means as the feature quantity of the figure specified by
The equipped Rutotomoni,
A plurality of storage means groups comprising the label storage means, the connection information storage means, and the feature quantity storage means;
The initial value setting means, the existing value updating means, and the connection information storage means commonly use one of the plurality of storage means groups, and for each image data for one screen, Change the storage means group to be used in order,
The image processing apparatus, wherein the feature amount updating unit sequentially selects the plurality of storage unit groups and performs processing based on data stored in the selected storage unit group .
前記図形の識別情報であるラベルが、前記画像データを構成する画素毎に記憶される画素情報記憶手段と、 A pixel information storage unit in which a label which is identification information of the graphic is stored for each pixel constituting the image data;
前記画像データを、各画素毎に、前記図形の要素となる図形画素であるか、該図形画素以外の背景画素であるかを表す二値データに変換する二値化手段と、 Binarization means for converting the image data into binary data representing whether each pixel is a graphic pixel as an element of the graphic or a background pixel other than the graphic pixel;
該二値化手段により二値データに変換された画像データを走査して、該画像データから前記図形画素を順次注目画素として抽出し、該抽出した注目画素の周囲の画素のラベルを前記画素情報記憶手段から取得し、該取得した周囲の画素のラベルに基づいて、該注目画素が、新たな図形を形成する新規画素であるか、または、既に形成された図形の一部となる追加画素であるかを判定し、前記注目画素が追加画素である場合には、更に、該追加画素が複数の異なる図形を連結させる連結画素であるか否かを判定する画素判定手段と、 The image data converted into binary data by the binarization means is scanned, and the graphic pixel is sequentially extracted as a target pixel from the image data, and the labels of the pixels around the extracted target pixel are the pixel information. Based on the labels of the surrounding pixels acquired from the storage means, the target pixel is a new pixel that forms a new graphic, or an additional pixel that becomes a part of a graphic already formed Pixel determining means for determining whether or not the target pixel is an additional pixel, and further determining whether or not the additional pixel is a connected pixel that connects a plurality of different figures;
該画素判定手段により前記注目画素が前記新規画素であると判定されると、新規にラベルを発行する新規ラベル発行手段と、 A new label issuing means for newly issuing a label when the pixel determining means determines that the target pixel is the new pixel;
前記画素判定手段により前記注目画素が前記連結画素であると判定されると、該連結画素にて複数の図形が連結されていることを表す連結情報を連結情報記憶手段に格納する連結情報格納手段と、 When the pixel determination unit determines that the target pixel is the connected pixel, the connection information storage unit stores connection information indicating that a plurality of figures are connected to the connection pixel in the connection information storage unit. When,
前記画素判定手段により前記注目画素が前記新規画素であると判定されると、前記新規ラベル発行手段により発行された新規ラベルをラベル記憶手段に格納すると共に、該新規ラベルにて特定される図形の特徴量として、初期値を特徴量記憶手段に格納し、更に、該新規ラベルを前記注目画素のラベルとして前記画素情報記憶手段に格納する初期値設定手段と、 When the pixel determining unit determines that the target pixel is the new pixel, the new label issued by the new label issuing unit is stored in the label storage unit, and the graphic specified by the new label is stored. An initial value setting means for storing an initial value as a feature quantity in the feature quantity storage means, and further storing the new label as a label of the target pixel in the pixel information storage means;
前記画素判定手段により前記注目画素が前記追加画素であると判定されると、前記特徴量記憶手段に記憶された図形の特徴量のうち、該追加画素がその一部となる図形の特徴量を更新し、更に、該追加画素がその一部となる図形のラベルを前記注目画素のラベルとして前記画素情報記憶手段に格納する既存値更新手段と、 When the pixel determination unit determines that the target pixel is the additional pixel, among the feature amounts of the figure stored in the feature amount storage unit, the feature amount of the figure that the additional pixel is a part of is calculated. Updating an existing value updating means for storing in the pixel information storage means a label of a graphic of which the additional pixel is a part thereof, as a label of the target pixel;
前記画素判定手段による1画面分の画像データの走査が終了し、該画素判定手段の判定に基づく、前記新規ラベル発行手段、前記連結情報格納手段、前記初期値設定手段、前記既存値更新手段の動作が完了すると、前記連結情報記憶手段に記憶された連結情報に基づいて、前記ラベル記憶手段に記憶されたラベルのうち、同一図形と認識された各図形のラベルを書き換えて一致させ、前記特徴量記憶手段に記憶された図形の特徴量のうち、前記ラベルが一致される前の各ラベルにて特定される各図形の特徴量を合成し、該合成した特徴量を前記一致されたラベルにて特定される図形の特徴量として前記特徴量記憶手段に格納する特徴量更新手段と、 Scanning of image data for one screen by the pixel determination unit is completed, and the new label issuing unit, the connection information storage unit, the initial value setting unit, and the existing value update unit are based on the determination of the pixel determination unit. When the operation is completed, based on the connection information stored in the connection information storage means, the label of each figure recognized as the same figure among the labels stored in the label storage means is rewritten and matched, Among the feature quantities of the figure stored in the quantity storage means, the feature quantities of each figure specified by each label before the labels are matched are synthesized, and the synthesized feature quantities are used as the matched labels. Feature quantity updating means for storing in the feature quantity storage means as the feature quantity of the figure specified by
を備えるとともに、 With
前記ラベル記憶手段と、前記連結情報記憶手段と、前記特徴量記憶手段とから構成される記憶手段群を2つ備え、 Two storage means groups comprising the label storage means, the connection information storage means, and the feature quantity storage means are provided,
前記初期値設定手段と、前記既存値更新手段と、前記連結情報格納手段とは、前記2つの記憶手段群のうちの1つを共通に使用し、しかも、1画面分の画像データ毎に、使用する記憶手段群を交互に変更し、 The initial value setting means, the existing value update means, and the connection information storage means commonly use one of the two storage means groups, and for each image data for one screen, Change the storage means group to be used alternately,
前記特徴量更新手段は、前記2つの記憶手段群を交互に選択し、該選択した記憶手段群に記憶されたデータに基づいて処理を行うことを特徴とする画像処理装置。 The image processing apparatus according to claim 1, wherein the feature amount updating unit alternately selects the two storage unit groups and performs processing based on data stored in the selected storage unit group.
前記連結情報格納手段は、前記画素判定手段により前記注目画素が前記連結画素であると判定されると、該連結画素が連結する各図形のラベルの組合せに対して連結状態を設定することを特徴とする請求項1又は2に記載の画像処理装置。 The connection information is obtained by setting a connected state or a non-connected state for all combinations of two labels among all labels issued by the new label issuing means. It is information that represents whether or not the figures specified in (2) are connected, and as an initial state, a non-connected state is set for all label combinations,
When the pixel determination unit determines that the target pixel is the connection pixel, the connection information storage unit sets a connection state for a combination of labels of the figures connected by the connection pixel. The image processing apparatus according to claim 1 or 2 .
前記初期値設定手段は、前記ラベルを発行順に前記ラベル記憶手段に格納し、
前記特徴量更新手段は、
前記連結情報記憶手段から、前記ラベルの組合せに対して設定された状態を、発行順位の早いラベルを含む組合せから順に読み出し、
前記連結状態が設定されたラベルの組合せを抽出した場合には、前記ラベル記憶手段において、前記連結状態が設定されたラベルの組合せのうちの発行順位の遅い方のラベルの発行順の領域が書き換えられているか否かを判断し、
前記ラベル記憶手段において、該発行順位の遅い方のラベルの発行順の領域が書き換えられている場合には、前記ラベルの組合せの各発行順の領域に記憶されたラベルのうち、発行順位の早い方のラベルで、前記各発行順の領域のうち、発行順位の遅い方のラベルが記憶された領域を書き換えると共に、
前記ラベル記憶手段から、前記発行順位の遅い方のラベルが記憶された領域を検出し、前記ラベルの組合せの各発行順の領域に記憶されたラベルのうち、発行順位の早い方のラベルで、前記検出した領域を書き換え、
一方、前記ラベル記憶手段において、前記発行順位の遅い方のラベルの発行順の領域が書き換えられていない場合には、該領域を前記発行順位の早い方のラベルの発行順の領域に記憶されたラベルに書き換える、
ことを特徴とする請求項3に記載の画像処理装置。 The new label issuing means issues a code representing an issue order as the label,
The initial value setting means stores the labels in the label storage means in the order of issue,
The feature amount update means includes:
From the connection information storage means, the state set for the combination of labels is read in order from the combination including the label with the highest issuance order,
When the combination of the labels set with the connection state is extracted, the label storage means rewrites the region in the issue order of the label with the later issue order among the combination of labels set with the connection state. To determine whether or not
In the label storage means, when the issue order area of the label with the later issue order is rewritten, among the labels stored in the issue order areas of the label combination, the issue order is earlier Rewrite the area in which the label with the later issuance order is stored among the respective issuance order areas,
From the label storage means, an area where the label with the later issue order is stored is detected, and among the labels stored in the respective issue order areas of the combination of labels, the label with the earlier issue order, Rewriting the detected area;
On the other hand, in the label storage means, when the issue order area of the label with the lower issue order is not rewritten, the area is stored in the issue order area of the label with the earlier issue order. Rewrite to label,
The image processing apparatus according to claim 3 .
1画素分の画素のラベルを記憶可能なレジスタと、
1走査ライン分の画素のラベルを記憶可能なラインバッファと、
からなり、
前記初期値設定手段及び既存値更新手段は、前記注目画素のラベルを前記レジスタに一旦格納し、次の注目画素のラベルを格納する際には、前記レジスタに記憶された前の注目画素のラベルを、前記ラインバッファにおける前の注目画素に対応する領域に格納した後に、前記次の注目画素のラベルを前記レジスタに格納することを特徴とする請求項1〜請求項4の何れか1項に記載の画像処理装置。 The pixel information storage means includes
A register capable of storing a pixel label for one pixel;
A line buffer capable of storing labels of pixels for one scan line;
Consists of
The initial value setting unit and the existing value updating unit temporarily store the label of the target pixel in the register, and when storing the label of the next target pixel, the label of the previous target pixel stored in the register and after storing in a region corresponding to the previous target pixel in said line buffer, to any one of claims 1 to 4, characterized in that storing a label of the next pixel of interest in the register The image processing apparatus described.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2005316722A JP4661529B2 (en) | 2005-10-31 | 2005-10-31 | Image processing device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2005316722A JP4661529B2 (en) | 2005-10-31 | 2005-10-31 | Image processing device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2007122594A JP2007122594A (en) | 2007-05-17 |
| JP4661529B2 true JP4661529B2 (en) | 2011-03-30 |
Family
ID=38146347
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2005316722A Expired - Fee Related JP4661529B2 (en) | 2005-10-31 | 2005-10-31 | Image processing device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4661529B2 (en) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP7037875B2 (en) * | 2016-06-20 | 2022-03-17 | 日本電信電話株式会社 | Image normalization equipment, methods, and computer-readable recording media |
| JP6681077B2 (en) * | 2017-06-16 | 2020-04-15 | 株式会社アクセル | Labeling processor |
| JP7408490B2 (en) * | 2020-06-04 | 2024-01-05 | 株式会社東芝 | Video speed detection device, video speed detection method |
Family Cites Families (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH05189563A (en) * | 1992-01-10 | 1993-07-30 | Matsushita Electric Ind Co Ltd | Image processing device |
| JP3307467B2 (en) * | 1993-04-09 | 2002-07-24 | 三菱電機株式会社 | Labeling method and labeling circuit |
| JPH07105368A (en) * | 1993-10-06 | 1995-04-21 | Tokimec Inc | Method and device for labeling picture |
| JP3001079B2 (en) * | 1993-10-20 | 2000-01-17 | 新日本製鐵株式会社 | Printed character inspection method and printed character inspection device |
| JPH0887597A (en) * | 1994-09-20 | 1996-04-02 | Toshiba Corp | Image processing device |
| JP3432736B2 (en) * | 1997-10-29 | 2003-08-04 | シャープ株式会社 | Image processing device |
| JP3824934B2 (en) * | 2001-12-27 | 2006-09-20 | 三菱電機株式会社 | Image processing device for monitoring |
-
2005
- 2005-10-31 JP JP2005316722A patent/JP4661529B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2007122594A (en) | 2007-05-17 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPH10198754A (en) | Code reader | |
| JP4661529B2 (en) | Image processing device | |
| US10846862B2 (en) | Image processing method and image processing device | |
| JP2001022342A (en) | Pixel number conversion circuit and image display device using the same | |
| JP4149464B2 (en) | Image processing device | |
| US4656468A (en) | Pattern data processing apparatus | |
| US5835629A (en) | Code pattern-image processing apparatus | |
| US6995802B2 (en) | Image binarization method and binary image creation method | |
| JP5300666B2 (en) | Labeling processing method, and system, apparatus and program thereof | |
| JP2757446B2 (en) | Thinning device | |
| JP2634905B2 (en) | How to paint shapes | |
| KR100295245B1 (en) | A parallel thinning method using weighted value | |
| JPH0129643Y2 (en) | ||
| JPS61131084A (en) | Picture processor | |
| JPH04290176A (en) | Image accumulating device and image processing device provided therewith | |
| JP2853343B2 (en) | Image processing method and apparatus | |
| JP3147469B2 (en) | Image processing device | |
| JP2004157812A (en) | Information reading device and program | |
| JP2861845B2 (en) | Image scanner with outline function | |
| SU1479947A2 (en) | Characteristic selector in recognition of object images | |
| JPH0385681A (en) | Picture processor | |
| JPS6093572A (en) | Graphic selective image processor | |
| JPH03222574A (en) | Picture magnification system | |
| JPH07296162A (en) | Method and device for generating filet coordinate | |
| JPS59178586A (en) | Loop extraction processing system of graphic pattern |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20071206 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20100910 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20100921 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20101115 |
|
| 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: 20101207 |
|
| 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: 20101220 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140114 Year of fee payment: 3 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| LAPS | Cancellation because of no payment of annual fees |