JP2008140208A - Image processing device, pattern extraction method, and pattern extraction program - Google Patents
Image processing device, pattern extraction method, and pattern extraction program Download PDFInfo
- Publication number
- JP2008140208A JP2008140208A JP2006326593A JP2006326593A JP2008140208A JP 2008140208 A JP2008140208 A JP 2008140208A JP 2006326593 A JP2006326593 A JP 2006326593A JP 2006326593 A JP2006326593 A JP 2006326593A JP 2008140208 A JP2008140208 A JP 2008140208A
- Authority
- JP
- Japan
- Prior art keywords
- image data
- pixels
- image
- pattern
- pixel
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012545 processing Methods 0.000 title claims abstract description 92
- 238000000605 extraction Methods 0.000 title description 7
- 230000002093 peripheral effect Effects 0.000 claims description 10
- 238000001514 detection method Methods 0.000 claims description 4
- 238000006243 chemical reaction Methods 0.000 abstract description 15
- 238000000034 method Methods 0.000 description 60
- 238000004891 communication Methods 0.000 description 26
- 230000006870 function Effects 0.000 description 17
- 238000010586 diagram Methods 0.000 description 9
- 239000000284 extract Substances 0.000 description 6
- 238000012986 modification Methods 0.000 description 4
- 230000004048 modification Effects 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 230000012447 hatching Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000003909 pattern recognition Methods 0.000 description 2
- 239000003086 colorant Substances 0.000 description 1
- 230000010485 coping Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000005401 electroluminescence Methods 0.000 description 1
- 238000009499 grossing Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
Description
この発明は、画像処理装置、パターン抽出方法およびパターン抽出プログラムに関し、特に画像データから所定のパターンを抽出する画像処理装置、パターン抽出方法およびパターン抽出プログラムに関する。 The present invention relates to an image processing apparatus, a pattern extraction method, and a pattern extraction program, and more particularly to an image processing apparatus, a pattern extraction method, and a pattern extraction program that extract a predetermined pattern from image data.
近年、スキャナ等で原稿を読み取って、得られる画像データが所定のパターンを含むか否かを判断するパターンマッチング技術の開発が進められている。通常、パターンマッチングを高速に処理するために、画像データの解像度を少なくした縮小画像データが用いられる。しかしながら、解像度を少なくすることにより、元の画像データに存在していた情報が失われるため、元の画像データにパターンが含まれるが、縮小画像データにはそのパターンの一部が存在しなくなり、パターンを抽出することができなくなってしまう場合があるといった問題がある。この問題に対応するための技術が、特開2001−312725号公報(特許文献1)および特開2001−312726号公報(特許文献2)に記載されている。 In recent years, development of a pattern matching technique for reading a document with a scanner or the like and determining whether or not the obtained image data includes a predetermined pattern has been developed. Usually, in order to process pattern matching at high speed, reduced image data with reduced resolution of image data is used. However, by reducing the resolution, information that was present in the original image data is lost, so the pattern is included in the original image data, but part of the pattern is not present in the reduced image data, There is a problem that the pattern may not be extracted. Techniques for coping with this problem are described in Japanese Patent Application Laid-Open No. 2001-31725 (Patent Document 1) and Japanese Patent Application Laid-Open No. 2001-31726 (Patent Document 2).
さらに、パターンマッチングを高速に処理するために、画像データまたは縮小画像データを2値化した2値化データが用いられるが、2値化することにより、元の画像データまたは縮小画像データに存在していた情報が失われるため、元の画像データにパターンが含まれるが、2値化データにはそのパターンの一部が存在しなくなり、パターンを抽出することができなくなってしまう場合があるといった問題がある。
この発明は上述した問題点を解決するためになされたもので、この発明の目的の一つは、パターンマッチングの処理速度を向上させるとともに精度を向上した画像処理装置を提供することである。 The present invention has been made to solve the above-described problems, and one of the objects of the present invention is to provide an image processing apparatus that improves the processing speed of pattern matching and improves accuracy.
この発明の他の目的は、パターンマッチングの処理速度を向上させるとともに精度を向上したパターン抽出方法を提供することである。 Another object of the present invention is to provide a pattern extraction method that improves pattern matching processing speed and accuracy.
この発明のさらに他の目的は、パターンマッチングの処理速度を向上させるとともに精度を向上したパターン抽出プログラムを提供することである。 Still another object of the present invention is to provide a pattern extraction program that improves the processing speed of pattern matching and improves accuracy.
上述した目的を達成するためにこの発明のある局面によれば、画像処理装置は、第1の方向および第2の方向に配列された複数の画素の位置と画素値とを定義する画像データを取得する画像データ取得手段と、取得された画像データから第1の方向に第1の数の画素を間引き、第2の方向に第2の数の画素を間引くことにより、複数の画素からなる縮小画像を生成する縮小画像生成手段と、縮小画像生成手段は、第1の縮小画像と、該第1の縮小画像に含まれる複数の画素とは画像データにおける位置が異なる複数の画素からなる第2の縮小画像とを生成し、生成された第1および第2の縮小画像を2値化し、第1および第2の2値化画像をそれぞれ生成する2値化手段と、第1の2値化画像および第2の2値化画像のいずれかが所定のパターンを含むか否かを判断するパターンマッチング手段と、を備える。 In order to achieve the above-described object, according to one aspect of the present invention, an image processing device outputs image data defining positions and pixel values of a plurality of pixels arranged in a first direction and a second direction. Image data acquisition means for acquiring and reduction of a plurality of pixels by thinning out the first number of pixels in the first direction and thinning out the second number of pixels in the second direction from the acquired image data The reduced image generating means for generating an image and the reduced image generating means include a first reduced image and a second pixel composed of a plurality of pixels whose positions in the image data are different from the plurality of pixels included in the first reduced image. A binarization unit that generates the first and second binarized images by binarizing the generated first and second reduced images, and the first binarization Either the image or the second binarized image has a predetermined pattern Comprising a pattern matching unit that determines whether including down, the.
この局面に従えば、画像データから第1の方向に第1の数の画素を間引き、第2の方向に第2の数の画素を間引くことにより、生成した縮小画像を2値化した2値化画像がパターンを含むか否かを判断するので、パターンマッチングの処理対象とする画素数およびデータ量を減らして処理速度を向上させることができる。また、所定のパターンを含む画像データを縮小し、2値化した場合、2値化した画像がパターンを含む場合と含まない場合とがあるが、第1の縮小画像と第2の縮小画像それぞれが含む画素は、画像データにおける位置が異なるため、いずれか一方は、パターンを含む。このため、第1の2値化画像および第2の2値化画像のいずれかが所定のパターンを含むか否かを判断するので、パターンマッチングの精度が向上する。その結果、パターンマッチングの処理速度を向上させるとともに精度を向上した画像処理装置を提供することができる。 According to this aspect, a binary image obtained by binarizing the generated reduced image by thinning out the first number of pixels in the first direction and thinning out the second number of pixels in the second direction from the image data. Since it is determined whether or not the digitized image includes a pattern, it is possible to improve the processing speed by reducing the number of pixels and the data amount to be subjected to pattern matching. Further, when image data including a predetermined pattern is reduced and binarized, the binarized image may or may not include a pattern, but the first reduced image and the second reduced image respectively. Since the pixels included in are different in position in the image data, one of them includes a pattern. For this reason, since it is determined whether one of the first binarized image and the second binarized image includes a predetermined pattern, the accuracy of pattern matching is improved. As a result, it is possible to provide an image processing apparatus that improves the processing speed of pattern matching and improves accuracy.
好ましくは、縮小画像生成手段は、縮小画像生成手段は、画像データにおいて、第1の縮小画像が含む複数の画素の画像データにおける位置から第1の方向に1以上かつ第1の数以下および第2の方向に1以上かつ第2の数以下だけそれぞれ離れた複数の画素からなる第2の縮小画像を生成する。 Preferably, the reduced image generating unit is configured to reduce the first image in the first direction from the position in the image data of the plurality of pixels included in the first reduced image to the first number and the first number. A second reduced image composed of a plurality of pixels that are one or more and two or less in the direction of 2 is generated.
好ましくは、2値化手段は、処理対象画素の周辺の画素の濃度を検出する周辺画素の濃度検出手段と、検出された周辺画素の濃度が所定の濃度以下の白画素が存在する場合に第1しきい値を用いて2値化する第1の2値化手段と、白画素が存在しない場合に第2しきい値を用いて2値化する第2の2値化手段と、を含む。 Preferably, the binarization unit includes a peripheral pixel density detection unit that detects the density of pixels around the processing target pixel, and a white pixel in which the detected peripheral pixel density is equal to or lower than a predetermined density. A first binarization unit that binarizes using one threshold value; and a second binarization unit that binarizes using a second threshold value when no white pixel exists. .
好ましくは、濃度検出手段は、処理対象画素に対して第1の方向に並ぶ画素の濃度を検出する。 Preferably, the density detection unit detects the density of the pixels arranged in the first direction with respect to the processing target pixel.
この発明の他の局面によれば、パターン抽出方法は、第1の方向および第2の方向に配列された複数の画素の位置と画素値とを定義する画像データを受け付けるステップと、受け付けられた画像データから第1の方向に第1の数の画素を間引き、第2の方向に第2の数の画素を間引くことにより、複数の画素からなる第1の縮小画像を生成するステップと、受け付けられた画像データから第1の方向に第1の数の画素を間引き、第2の方向に第2の数の画素を間引くことにより、第1の縮小画像に含まれる複数の画素とは画像データにおける位置が異なる複数の画素からなる第2の縮小画像を生成するステップと、生成された第1および第2の縮小画像をそれぞれ2値化した第1および第2の2値化画像を生成するステップと、第1の2値化画像および第2の2値化画像の少なくとも一方が所定のパターンを含むか否かを判断するステップと、を含む。 According to another aspect of the present invention, a pattern extraction method receives a step of receiving image data defining positions and pixel values of a plurality of pixels arranged in a first direction and a second direction. Generating a first reduced image composed of a plurality of pixels by thinning out a first number of pixels in a first direction and thinning out a second number of pixels in a second direction from the image data; The plurality of pixels included in the first reduced image is image data by thinning out the first number of pixels in the first direction and thinning out the second number of pixels in the second direction from the obtained image data. Generating a second reduced image composed of a plurality of pixels having different positions in the image, and generating first and second binarized images obtained by binarizing the generated first and second reduced images, respectively. Step and first binarization At least one image and the second binarized image includes the steps of: determining whether including a predetermined pattern.
この局面に従えば、処理速度を向上させるとともにパターンマッチングの精度を向上したパターン抽出方法を提供することができる。 According to this aspect, it is possible to provide a pattern extraction method that improves the processing speed and improves the accuracy of pattern matching.
この発明のさらに他の局面によれば、パターン抽出プログラムは、第1の方向および第2の方向に配列された複数の画素の位置と画素値とを定義する画像データを受け付けるステップと、受け付けられた画像データから第1の方向に第1の数の画素を間引き、第2の方向に第2の数の画素を間引くことにより、複数の画素からなる第1の縮小画像を生成するステップと、受け付けられた画像データから第1の方向に第1の数の画素を間引き、第2の方向に第2の数の画素を間引くことにより、第1の縮小画像に含まれる複数の画素とは画像データにおける位置が異なる複数の画素からなる第2の縮小画像を生成するステップと、生成された第1および第2の縮小画像をそれぞれ2値化した第1および第2の2値化画像を生成するステップと、第1の2値化画像および第2の2値化画像の少なくとも一方が所定のパターンを含むか否かを判断するステップと、をコンピュータに実行させる。 According to still another aspect of the present invention, a pattern extraction program receives and accepts image data defining positions and pixel values of a plurality of pixels arranged in a first direction and a second direction. Generating a first reduced image consisting of a plurality of pixels by thinning out a first number of pixels in a first direction and thinning out a second number of pixels in a second direction from the obtained image data; The plurality of pixels included in the first reduced image is an image obtained by thinning out the first number of pixels in the first direction and thinning out the second number of pixels in the second direction from the received image data. Generating a second reduced image including a plurality of pixels having different positions in the data, and generating first and second binarized images obtained by binarizing the generated first and second reduced images, respectively. And steps to At least one of the first binarized image and the second binarized image is executed a step of determining whether containing a predetermined pattern, to the computer.
この局面に従えば、処理速度を向上させるとともにパターンマッチングの精度を向上したパターン抽出プログラムを提供することができる。 According to this aspect, it is possible to provide a pattern extraction program that improves the processing speed and improves the accuracy of pattern matching.
以下、本発明の実施の形態について図面を参照して説明する。以下の説明では同一の部品には同一の符号を付してある。それらの名称および機能も同じである。したがってそれらについての詳細な説明は繰返さない。 Embodiments of the present invention will be described below with reference to the drawings. In the following description, the same parts are denoted by the same reference numerals. Their names and functions are also the same. Therefore, detailed description thereof will not be repeated.
図1は、本発明の実施の形態の一つにおける画像形成システムの全体概要を示す図である。図1を参照して、画像形成システム1は、ネットワーク2にそれぞれ接続された画像形成装置としてのMFP(Multi Function Peripheral)100と、コンピュータ3,3A,3B,3Cと、それぞれがMFP100に接続されるデジタルカメラ4と、デジタルビデオカメラ5と、携帯情報端末6とを含む。
FIG. 1 is a diagram showing an overall outline of an image forming system according to one embodiment of the present invention. Referring to FIG. 1, an
MFP100は、原稿を読取るためのスキャナ、画像データに基づいて紙などの記録媒体に画像を形成するための画像形成部、ファクシミリを含み、画像読取機能、複写機能、ファクシミリ送受信機能を備えている。 MFP 100 includes a scanner for reading a document, an image forming unit for forming an image on a recording medium such as paper based on image data, and a facsimile, and includes an image reading function, a copying function, and a facsimile transmission / reception function.
コンピュータ3,3A,3B,3Cは、一般的なパーソナルコンピュータであり、MFP100を制御するためのプリンタドライバプログラムがインストールされている。コンピュータ3,3A,3B,3Cは、それらがアプリケーションプログラムを実行することにより、生成されるプリントデータまたは画像データを、MFP100に出力する。MFP100は、携帯情報端末6から入力されるプリントデータまたは画像データを画像処理する、または、そのプリントデータまたは画像データに基づいて、記録媒体に画像を形成する。さらに、コンピュータ3,3A,3B,3Cは、画像処理装置としても機能する。
デジタルカメラ4およびデジタルビデオカメラ5は、撮像した静止画像または動画像を記憶し、それらが接続されたMFP100に静止画像または動画像の画像データを出力する。MFP100は、入力される静止画像の画像データを画像処理する、また、静止画像の画像データに基づき用紙等の記録媒体に静止画像を形成する。また、動画像の画像データが入力される場合、1フレームの画像の画像データを画像処理する、また、1フレームの画像の画像データに基づき記録媒体に画像を形成する。携帯情報端末6は、コンピュータ3,3A,3B,3Cと同様に、それがアプリケーションプログラムを実行することにより生成されるデータまたは画像データを、MFP100に出力する。MFP100は、携帯情報端末6から入力されるデータまたは画像データを画像処理する、また、その画像データに基づいて、記録媒体に画像を形成する。
The
ネットワーク2は、ローカルエリアネットワーク(LAN)であり、接続形態は有線または無線を問わない。またネットワーク2は、LANに限らず、ワイドエリアネットワーク(WAN)、インターネット等であってもよい。
The
図2は、MFPの外観を示す斜視図である。図2を参照して、MFP100は、自動原稿搬送装置(ADF)10と、画像読取部20と、画像形成部40と、給紙部50と、を含む。ADF10は、原稿台に搭載された複数枚の原稿をさばいて1枚ずつ順に、画像読取部20に搬送する。画像読取部20は、写真、文字、絵等の画像情報を原稿から光学的に読み取って画像データを取得する。画像形成部40は、画像データが入力されると、画像データに基づいて用紙上に画像を形成する。画像形成部40は、シアン、マゼンタ、イエロー、ブラックの4色のトナーを用いて画像を形成する。給紙部50は、用紙を格納しており、格納した用紙を1枚ずつ画像形成部40に供給する。MFP100は、その上面に操作パネル9を備える。
FIG. 2 is a perspective view showing the appearance of the MFP. Referring to FIG. 2, MFP 100 includes an automatic document feeder (ADF) 10, an
図3は、MFPのハード構成の一例を示すブロック図である。図3を参照して、MFP100は、メイン回路101と、ファクシミリ部60と、通信制御部61と、ADF10と、画像読取部20と、画像処理部30と、画像形成部40と、給紙部50とを含む。メイン回路101は、中央演算装置(CPU)111と、CPU111の作業領域として使用されるRAM(Random Access Memory)112と、CPU111が実行するプログラム等を記憶するためのROM(Read Only Memory)113と、表示部114と、操作部115と、大容量記憶装置としてのハードディスクドライブ(HDD)116と、データ通信制御部117と、を含む。CPU111は、表示部114、操作部115、HDD116およびデータ通信制御部117とそれぞれ接続され、メイン回路101の全体を制御する。また、CPU111は、ファクシミリ部60、通信制御部61、ADF10、画像読取部20、画像処理部30、画像形成部40、給紙部50、と接続され、MFP100の全体を制御する。
FIG. 3 is a block diagram illustrating an example of a hardware configuration of the MFP. Referring to FIG. 3,
表示部114は、液晶表示装置(LCD)、有機ELD(Electro Luminescence Display)等の表示装置であり、ユーザに対する指示メニューや取得した画像データに関する情報等を表示する。操作部115は、複数のキーを備え、キーに対応するユーザの操作による各種の指示、文字、数字などのデータの入力を受付ける。操作部115は、表示部114上に設けられたタッチパネルを含む。表示部114と操作部115とで、操作パネル9が構成される。
The
データ通信制御部117は、TCP(Transmission Control Protocol)またはFTP(File Transfer Protocol)等の通信プロトコルで通信するためのインターフェースであるLAN端子118と、シリアル通信インターフェース端子119とを有する。データ通信制御部117は、CPU111からの指示に従って、LAN端子118またはシリアル通信インターフェース端子119に接続された外部の機器との間でデータを送受信する。
The data
LAN端子118に、ネットワーク2に接続するためのLANケーブルが接続される場合、データ通信制御部117は、LAN端子118を介して接続された他のMFP、スキャナ、プリンタ、またはコンピュータ3,3A,3B,3Cと通信する。シリアル通信インターフェース端子119に機器が接続された場合、データ通信制御部117は、シリアル通信インターフェース端子119に接続された機器、例えば、デジタルカメラ4、デジタルビデオカメラ5または携帯情報端末6との間で通信して画像データを入出力する。また、シリアル通信インターフェース端子119には、フラッシュメモリを内蔵したメモリカード119Aが接続可能である。CPU111は、データ通信制御部117を制御して、メモリカード119AからCPU111または画像処理部30が実行するためのプログラムを読出し、読み出したプログラムをRAM112に記憶し、実行する。
When a LAN cable for connecting to the
なお、CPU111または画像処理部30が実行するためのプログラムを記憶する記録媒体としては、メモリカード119Aに限られず、フレキシブルディスク、カセットテープ、光ディスク(CD−ROM(Compact Disc−Read Only Memory)/MO(Magnetic Optical Disc/MD(Mini Disc)/DVD(Digital Versatile Disc))、ICカード(メモリカードを含む)、光カード、マスクROM、EPROM(Erasable Programmable ROM)、EEPROM(Electronically EPROM)などの半導体メモリ等の媒体でもよい。さらに、CPU111がインターネットに接続されたコンピュータからプログラムをダウンロードしてHDD116に記憶する、または、インターネットに接続されたコンピュータが画像データ記憶プログラムをHDD116に書込みするようにして、HDD116に記憶されたプログラムをRAM112にロードしてCPU111または画像処理部30で実行するようにしてもよい。ここでいうプログラムは、CPU111または画像処理部30により直接実行可能なプログラムだけでなく、ソースプログラム、圧縮処理されたプログラム、暗号化されたプログラム等を含む。
A recording medium for storing a program to be executed by the
通信制御部61は、CPU111をPSTN7に接続するためのモデムである。MFP100には、PSTN7における電話番号が予め割り当てられており、PSTN7に接続されたファクシミリ装置からMFP100に割り当てられた電話番号に発呼があると、通信制御部61がその発呼を検出する。通信制御部61は、発呼を検出すると通話を確立し、ファクシミリ部60に通信させる。
The
ファクシミリ部60は、PSTN7に接続され、PSTN7にファクシミリデータを送信する、またはPSTN7からファクシミリデータを受信する。ファクシミリ部60は、受信したファクシミリデータを、CPU111に出力する。また、ファクシミリ部60は、受信したファクシミリデータを画像形成部40でプリント可能なプリントデータに変換して、画像形成部40に出力する。これにより、画像形成部40は、ファクシミリ部60により受信されたファクシミリデータを記録シートにプリントする。また、ファクシミリ部60は、HDD116に記憶された画像データをファクシミリデータに変換して、PSTN7に接続されたファクシミリ装置または他のMFPに出力する。これにより、HDD116に記憶されたデータをファクシミリ装置または他のMFPに出力することができる。なお、ファクシミリデータは画像データに含まれる。このように、MFP100は、ファクシミリ送受信機能を有する。
The
MFP100は、スキャナ機能を有し、画像読取部20が原稿を読み取って出力する画像データが、RAM112に一時的に記憶される。また、画像形成部40は、画像読取部20が原稿を読み取って出力する画像データに基づいて、用紙等の記録シート上に画像を形成する。このため、MFP100は、コピー機能を有する。さらに、データ通信制御部117は、ネットワーク2に接続された他のPC3、3A,3B,3Cのいずれかから受信した画像データ、または、シリアル通信インターフェース端子119に接続されたデジタルカメラ4、デジタルビデオカメラ5および携帯情報端末6のいずれかから受信された画像データをRAM112に一時的に記憶する。そして、RAM112に一時的に記憶された画像データに基づいて、用紙等の記録シート上に画像を形成する。このため、MFP100は、プリント機能を有する。
The
画像処理部30は、RAM112に記憶された画像データを画像処理する。画像処理部30は、MFP100がスキャナ機能またはコピー機能を能動化する場合には、画像読取部20が原稿を読み取って出力する画像データを画像処理する。また、画像処理部30は、MFP100がファクシミリ機能を能動化する場合には、ファクシミリ部60が受信するファクシミリデータ(画像データ)を画像処理する。さらに、画像処理部30は、データ通信制御部117が、ネットワーク2に接続された他のPC3、3A,3B,3C、スキャナ、MFPのいずれかから受信した画像データ、またはシリアル通信インターフェース端子119に接続されたデジタルカメラ4、デジタルビデオカメラ5および携帯情報端末6のいずれかから受信された画像データを画像処理する。
The
図4は、画像処理部の回路構成の一例を示す図である。図4を参照して、画像処理部30は、画像データの解像度を変換し縮小画像データを生成する解像度変換部301と、縮小画像データを2値化し、2値化データを生成するための第1の2値化部303Aおよび第2の2値化部303Bと、2値化データから所定のパターンを抽出する第1認識部305Aおよび第2認識部305Bと、判定部307と、を含む。
FIG. 4 is a diagram illustrating an example of a circuit configuration of the image processing unit. Referring to FIG. 4, an
解像度変換部301は、画像データが入力され、入力された画像データを解像度変換し、縮小画像データを生成する。画像データは、第1の方向(X軸方向)および第2の方向(Y軸方向)に配列された複数の画素の位置と画素値とを定義する。X軸方向とY軸方向とは直交する。解像度変換部301は、画像データが含む複数の画素を単純間引きすることにより解像度変換し、縮小画像を生成する。単純間引きすることにより縮小画像データを生成するのは、他の縮小方法、例えばスムージングにより生成された縮小画像データは、抽出しようとするパターンの色に周辺の画素の色が混ざってしまい、縮小画像データに含まれる画素の色が、パターンの色と異なってしまうからである。
The
ここで、解像度変換処理の具体例について説明する。例えば、解像度が600dpi(dots per inch)の画像データを、解像度が200dpiの縮小画像データに解像度を変換する場合を例に説明すると、解像度変換部301は、画像データからX軸方向に2つの画素を間引き、Y軸方向に2つの画素を間引くことにより、複数の画素からなる縮小画像を生成する。換言すれば、画像データを、X軸方向およびY軸方向に3つの画素からなるブロック(3行3列のブロック)に分割し、分割した各ブロックのうちから1つの画素を抽出し、画像データに含まれるブロックの数の画素からなる縮小画像データを生成する。縮小画像データに含まれる複数の画素は、各画素が含まれていたブロック中の位置が同じである。したがって、解像度を600dpiから200dpiに変換する場合、9つの縮小画像データを生成することが可能である。解像度変換部301は、画像データから抽出する画素が異なる2つの縮小画像データを生成する。ここでは、解像度変換部301が生成する2つの縮小画像データを第1縮小画像データおよび第2縮小画像データという。解像度変換部301は、第1の縮小画像データを第1の2値化部303Aに出力し、第2の縮小画像データを第2の2値化部303Bに出力する。
Here, a specific example of resolution conversion processing will be described. For example, a case where image data with a resolution of 600 dpi (dots per inch) is converted into reduced image data with a resolution of 200 dpi will be described as an example. The
第1縮小画像データに含まれる複数の画素と、第2縮小画像データに含まれる複数の画素とは、画像データ中における位置が互いに異なる。第1縮小画像データに含まれる複数の画素と、第2縮小画像データに含まれる複数の画素との関係は、画像データの同じブロックから抽出された2つの画素が、画素画像データ中における位置がX軸方向に1画素以上2画素以下、Y軸方向に1画素以上2画素以下離れた関係にあるのが好ましい。例えば、画像データの複数のブロックそれぞれの1行1列の画素を抽出して第1縮小画像データを生成した場合、第2縮小画像データを、画像データの複数のブロックそれぞれの2行2列、2行3列、3行2列または3行3列のいずれかの画素を抽出して生成するのが好ましい。すなわち、画像データの複数のブロックそれぞれの2行2列の画素を抽出した第2縮小データ、2行3列の画素を抽出した第2縮小データ、3行2列の画素を抽出した第2縮小データ、および3行3列の画素を抽出した第2縮小データのいずれかを生成するのが好ましい。 The plurality of pixels included in the first reduced image data and the plurality of pixels included in the second reduced image data have different positions in the image data. The relationship between the plurality of pixels included in the first reduced image data and the plurality of pixels included in the second reduced image data is that two pixels extracted from the same block of the image data are located in the pixel image data. It is preferable to have a relationship of 1 pixel to 2 pixels in the X-axis direction and 1 pixel to 2 pixels or less in the Y-axis direction. For example, when the first reduced image data is generated by extracting the pixels of 1 row and 1 column of each of a plurality of blocks of image data, the second reduced image data is converted into 2 rows and 2 columns of each of the plurality of blocks of image data, It is preferable to extract and generate any pixel in 2 rows, 3 columns, 3 rows and 2 columns, or 3 rows and 3 columns. That is, second reduced data obtained by extracting pixels in 2 rows and 2 columns of each of a plurality of blocks of image data, second reduced data obtained by extracting pixels in 2 rows and 3 columns, and second reduced data obtained by extracting pixels in 3 rows and 2 columns It is preferable to generate either data or second reduced data obtained by extracting pixels in 3 rows and 3 columns.
第1の2値化部303Aと第2の2値化部303Bとは、処理する縮小画像データが異なるのみで、機能は同じなので、ここでは第1の2値化部303Aについて説明する。第1の2値化部303Aは、解像度変換部301から第1の縮小画像データが入力される。第1の2値化部303Aは、2つのしきい値を用いて第1の縮小画像データを2値化する。縞模様の背景にパターンが描かれ原稿を読み取って得られた画像データの場合、パターンが背景の縞模様と重なっている部分と、パターンが背景の縞模様と重なっていない部分とで、色が異なる。このため、パターンが縞模様と重なっていない部分の画素を第1のしきい値を用いて2値化し、パターンが縞模様と重なっている部分の画素を第2のしきい値を用いて2値化する。第1のしきい値は、画像データから検出しようとするパターンの色によって定まり、予め定められた値である。第2のしきい値は、パターンの色と背景の模様の色によって定まる。第2のしきい値は、予め定められた値であってもよいし、第1のしきい値と、背景の模様の色とから算出するようにしてもよい。例えば、第1のしきい値に背景の模様の色の値の少なくとも一部を加算した値を第2のしきい値とすればよい。ここでは、横縞模様の背景にパターンが描かれた原稿を読み取って得られた画像データを処理する場合について説明する。
The
第1の2値化部303Aは、処理対象画素の周辺に白色の白画素が1つでも存在する場合に第1のしきい値を用いて2値化し、処理対象画素の周辺に白画素が1つも存在しなければ第2のしきい値を用いて2値化する。背景が白色でありことが多いからである。周辺の画素は、処理対象画素の左右(第1の方向の両側)それぞれに隣接する2つの画素、合計4画素とすることができる。横縞模様の背景の原稿を読み取って得られる画像データは、左右方向(X軸方向)に白画素でない画素が配列するからである。
The
図5は、縞模様の背景にパターンが描かれ原稿を読み取って得られた画像データの一部を示す図である。図は、1つのマスが、1つの画素を示し、数字「2」または「3」で示される画素が、パターンを構成する画素を示している。なお、図に示す数字は説明のために付したものである。ハッチングの付された画素が、背景の縞模様を構成する画素を示す。数字「2」で示される画素は、パターンを構成する画素であって、背景の縞模様を構成しない画素を示す。数字「3」で示される画素は、パターンを構成する画素であって、背景の縞模様を構成する画素を示す。したがって、数字「3」で示される画素と、数字「2」で示される画素とは、濃度が同じでなく、数字「3」で示される画素の濃度は、数字「2」で示される画素の濃度よりも低くなる。このため、1つのしきい値を用いて、数字「3」で示される画素と、数字「2」で示される画素とを抽出することができない。ここでは、パターンを構成する数字「2」で示される画素を第1のしきい値を用いて抽出し、数字「3」で示される画素を第2のしきい値を用いて抽出する。数字「1」で示される画素と数字「2」で示される画素とは、横方向(X軸方向)に隣接する複数の画素のうちに白色の画素が存在するか否かを判断することにより、区別することができる。なお、背景が縦縞模様の場合には、縦方向(Y軸方向)に隣接する複数の画素のうちに白色の画素が存在するか否かを判断するようにすれば、区別することができる。 FIG. 5 shows a part of image data obtained by reading a document with a pattern drawn on a striped background. In the figure, one square indicates one pixel, and pixels indicated by numbers “2” or “3” indicate pixels constituting the pattern. Note that the numbers shown in the figure are given for the sake of explanation. The hatched pixels indicate the pixels forming the background stripe pattern. The pixel indicated by the numeral “2” is a pixel that constitutes a pattern and does not constitute a background stripe pattern. The pixel indicated by the numeral “3” is a pixel that forms a pattern and that forms a background stripe pattern. Therefore, the pixel indicated by the number “3” and the pixel indicated by the number “2” are not the same in density, and the density of the pixel indicated by the number “3” is the same as that of the pixel indicated by the number “2”. It becomes lower than the concentration. For this reason, it is impossible to extract the pixel indicated by the number “3” and the pixel indicated by the number “2” using one threshold value. Here, the pixel indicated by the number “2” constituting the pattern is extracted using the first threshold value, and the pixel indicated by the number “3” is extracted using the second threshold value. The pixel indicated by the number “1” and the pixel indicated by the number “2” are determined by determining whether a white pixel is present among a plurality of pixels adjacent in the horizontal direction (X-axis direction). Can be distinguished. In addition, when the background is a vertical stripe pattern, it can be distinguished by determining whether or not a white pixel exists among a plurality of pixels adjacent in the vertical direction (Y-axis direction).
画像データは、赤(R)、緑(G)および青(B)の3つの画像データを含む。このため、第1のしきい値および第2のしきい値は、R,GおよびBの3つそれぞれに対して、画素値の範囲を定義する。処理対象とする画素が背景の縞模様を構成しない画素の場合、処理対象とする画素のR,G,Bの画素値のすべてが、第1のしきい値で定義された範囲に含まれるならば、処理対象画素がパターンを構成する画素と判断し、2値化データの対応する画素の値に「1」を設定する。逆に、処理対象とする画素のR,G,Bの画素値のいずれか1つでも第1のしきい値で定義された範囲に含まれないならば、処理対象画素がパターンを構成する画素でない判断し、2値化データの対応する画素の値に「0」を設定する。また、処理対象とする画素が背景の縞模様を構成する画素の場合、処理対象とする画素のR,G,Bの画素値のすべてが、第2のしきい値で定義された範囲に含まれるならば、処理対象画素がパターンを構成する画素と判断し、2値化データの対応する画素の値に「1」を設定する。逆に、処理対象とする画素のR,G,Bの画素値のいずれか1つでも第2のしきい値で定義された範囲に含まれないならば、処理対象画素がパターンを構成する画素でない判断し、2値化データの対応する画素の値に「0」を設定する。 The image data includes three image data of red (R), green (G), and blue (B). For this reason, the first threshold value and the second threshold value define a range of pixel values for three of R, G, and B, respectively. If the pixel to be processed is a pixel that does not form a background stripe pattern, all the R, G, and B pixel values of the pixel to be processed are included in the range defined by the first threshold value. For example, it is determined that the pixel to be processed is a pixel constituting the pattern, and “1” is set to the value of the corresponding pixel in the binarized data. Conversely, if any one of the R, G, and B pixel values of the pixel to be processed is not included in the range defined by the first threshold value, the pixel to be processed forms a pattern. Therefore, “0” is set to the value of the corresponding pixel of the binarized data. Further, when the pixel to be processed is a pixel forming a background stripe pattern, all of the R, G, and B pixel values of the pixel to be processed are included in the range defined by the second threshold value. If it is determined that the pixel to be processed is a pixel constituting the pattern, “1” is set to the value of the corresponding pixel in the binarized data. Conversely, if any one of the R, G, and B pixel values of the pixel to be processed is not included in the range defined by the second threshold value, the pixel to be processed forms a pattern. Therefore, “0” is set to the value of the corresponding pixel of the binarized data.
より具体的には、処理対象とする画素のRの画素値が第1のしきい値または第2のしきい値で定義されたRの範囲に含まれ、処理対象とする画素のGの画素値が第1のしきい値または第2のしきい値で定義されたGの範囲に含まれ、かつ、処理対象とする画素のBの画素値が第1のしきい値または第2のしきい値で定義されたBの範囲に含まれるならば、処理対象画素がパターンを構成する画素と判断するが、そうでなければ、処理対象画素がパターンを構成する画素でないと判断する。なお、画像データは、明度のみからなるモノクロのデータであってもよい。この場合には、第1のしきい値および第2のしきい値それぞれは、明度の範囲を定める。 More specifically, the R pixel value of the pixel to be processed is included in the R range defined by the first threshold value or the second threshold value, and the G pixel of the pixel to be processed The pixel value of B of the pixel to be processed is included in the range of G defined by the first threshold value or the second threshold value, and the first threshold value or the second threshold value. If it is included in the range of B defined by the threshold value, it is determined that the processing target pixel is a pixel constituting the pattern. Otherwise, it is determined that the processing target pixel is not a pixel constituting the pattern. The image data may be monochrome data consisting only of brightness. In this case, each of the first threshold value and the second threshold value defines a range of brightness.
図4に戻って、第1の2値化部303Aは、第1の縮小画像データを2値化し、第1の2値化データを生成する。そして、第1の2値化データを第1認識部305Aに出力する。また、第2の2値化部303Bは、第2の縮小画像データを2値化し、第2の2値化データを生成する。そして、第2の2値化データを第2認識部305Bに出力する。
Returning to FIG. 4, the
第1認識部305Aと第2認識部305Bとは、処理する2値化データが異なるのみで機能は同じなので、ここでは第1認識部305Aについて説明する。第1認識部305Aは、第1の2値化部303Aから第1の2値化データが入力される。第1認識部305Aは、画像データから抽出しようとするパターンが入力され、そのパターンと、第1の2値化データに含まれる画素値が「1」の複数の画素で構成される形状とを比較する。第1認識部305Aは、パターンの形状と、第1の2値化データに含まれる画素値が「1」の複数の画素で構成される形状とが類似すれば、第1の2値化データがパターンを含むことを示す信号を判定部307に出力するが、両者が類似しなければ第1の2値化データがパターンを含まないことを示す信号を判定部307に出力する。形状の類似は、相似を含む。
The first recognizing
判定部307は、第1認識部305Aから第1の2値化データがパターンを含むことを示す信号が入力される場合、または、第2認識部305Bから第2の2値化データがパターンを含むことを示す信号が入力される場合、画像データがパターンを含むと判断し、第1認識部305Aおよび第2認識部305B双方からパターンを含まないことを示す信号が入力される場合、画像データがパターンを含まないと判断し、判断結果をCPU111に出力する。
The
次に、画像処理部30が実行する画像処理の具体例を説明する。図6は、画像データの一例として画像データの一部を示す図である。図6を参照して、図5と同様に、1つのマスが、1つの画素を示し、縦横それぞれ36の画素を含む画像データである。数字「2」または「3」で示される画素が、パターンを構成する画素を示している。なお、数字は説明のために付したものである。ハッチングの付された画素が、背景の模様を構成する画素を示す。背景の模様が、X軸方向に配列していない。数字「2」で示される画素は、パターンを構成する画素であって、背景の模様を構成しない画素を示す。数字「3」で示される画素は、パターンを構成する画素であって、背景の模様を構成する画素を示す。
Next, a specific example of image processing executed by the
図7〜図9は、縮小画像データの一例を示す図である。図7〜図9は、図6に示す画像データを縦横それぞれ3画素からなる144のブロックに分割し、144のブロックそれぞれから1画素を抽出することにより、生成した縮小画像データを示す。図7(A)は、縦横それぞれ3画素からなるブロックの1行1列の画素を抽出することにより生成される縮小画像データを示す。図7(B)は、縦横それぞれ3画素からなるブロックの2行1列の画素を抽出することにより生成される縮小画像データを示す。図7(C)は、縦横それぞれ3画素からなるブロックの3行1列の画素を抽出することにより生成される縮小画像データを示す。図8(A)は、縦横それぞれ3画素からなるブロックの1行2列の画素を抽出することにより生成される縮小画像データを示す。図8(B)は、縦横それぞれ3画素からなるブロックの2行2列の画素を抽出することにより生成される縮小画像データを示す。図8(C)は、縦横それぞれ3画素からなるブロックの3行2列の画素を抽出することにより生成される縮小画像データを示す。図9(A)は、縦横それぞれ3画素からなるブロックの1行3列の画素を抽出することにより生成される縮小画像データを示す。図9(B)は、縦横それぞれ3画素からなるブロックの2行3列の画素を抽出することにより生成される縮小画像データを示す。図9(C)は、縦横それぞれ3画素からなるブロックの3行3列の画素を抽出することにより生成される縮小画像データを示す。各縮小画像データの画素に示す値およびハッチングは画像データに付されていた値およびハッチングと同じである。 7 to 9 are diagrams illustrating examples of reduced image data. FIGS. 7 to 9 show reduced image data generated by dividing the image data shown in FIG. 6 into 144 blocks each consisting of 3 pixels vertically and horizontally and extracting 1 pixel from each of 144 blocks. FIG. 7A shows reduced image data generated by extracting pixels in one row and one column of a block made up of three pixels in the vertical and horizontal directions. FIG. 7B shows reduced image data generated by extracting pixels in 2 rows and 1 column of a block composed of 3 pixels vertically and horizontally. FIG. 7C shows reduced image data generated by extracting pixels in 3 rows and 1 column of a block composed of 3 pixels vertically and horizontally. FIG. 8A shows reduced image data generated by extracting pixels in one row and two columns of a block made up of three pixels vertically and horizontally. FIG. 8B shows reduced image data generated by extracting pixels in 2 rows and 2 columns of a block composed of 3 pixels in the vertical and horizontal directions. FIG. 8C shows reduced image data generated by extracting pixels in 3 rows and 2 columns of a block composed of 3 pixels vertically and horizontally. FIG. 9A shows reduced image data generated by extracting pixels in one row and three columns of a block composed of three pixels in the vertical and horizontal directions. FIG. 9B shows reduced image data generated by extracting pixels in 2 rows and 3 columns of a block composed of 3 pixels vertically and horizontally. FIG. 9C shows reduced image data generated by extracting pixels in 3 rows and 3 columns of a block composed of 3 pixels vertically and horizontally. The values and hatching shown in the pixels of each reduced image data are the same as the values and hatching attached to the image data.
図10〜図12は、2値化画像データの一例を示す図である。図10(A)は、図7(A)に示した縮小画像データを2値化した2値化画像データを示し、図10(B)は、図7(B)に示した縮小画像データを2値化した2値化画像データを示し、図10(C)は、図7(C)に示した縮小画像データを2値化した2値化画像データを示す。図11(A)は、図8(A)に示した縮小画像データを2値化した2値化画像データを示し、図11(B)は、図8(B)に示した縮小画像データを2値化した2値化画像データを示し、図11(C)は、図8(C)に示した縮小画像データを2値化した2値化画像データを示す。図12(A)は、図9(A)に示した縮小画像データを2値化した2値化画像データを示し、図12(B)は、図9(B)に示した縮小画像データを2値化した2値化画像データを示し、図12(C)は、図9(C)に示した縮小画像データを2値化した2値化画像データを示す。図10〜図12では、2値化により値「1」とされた画素をハッチングを付して示している。 10 to 12 are diagrams illustrating examples of binarized image data. FIG. 10A shows binary image data obtained by binarizing the reduced image data shown in FIG. 7A, and FIG. 10B shows the reduced image data shown in FIG. 7B. FIG. 10C shows binarized image data obtained by binarizing the reduced image data shown in FIG. 7C. FIG. 11A shows binary image data obtained by binarizing the reduced image data shown in FIG. 8A, and FIG. 11B shows the reduced image data shown in FIG. 8B. FIG. 11C shows binary image data obtained by binarizing the reduced image data shown in FIG. 8C. 12A shows binarized image data obtained by binarizing the reduced image data shown in FIG. 9A, and FIG. 12B shows the reduced image data shown in FIG. 9B. FIG. 12C shows binary image data obtained by binarizing the reduced image data shown in FIG. 9C. 10 to 12, pixels that are set to a value “1” by binarization are indicated by hatching.
図10(A)および図10(B)に示す2値化画像データにおいて、2値化により値「1」とされた画素が、他の2値化画像データに比較して少なくなっている。図6に示した画像データに含まれる値「2」または「3」で表されるパターンを構成する画素が、解像度変換処理および2値化処理により、除かれてしまっているからである。一方、図10(A)〜図12(C)の9つの2値化画像データのうち少なくとも1つ、ここでは、図10(A)および図10(B)を除く7つの縮小画像データからパターンを抽出することができる。このため、解像度変換して生成することが可能な複数の縮小画像データのうち、ここでは、図7(A)〜図9(C)の9つの縮小画像データのうち任意の1つと、その縮小画像データと所定の関係にある別の縮小画像データとの2つの縮小画像データのいずれかからパターンを抽出することができる。任意の縮小画像データと別の縮小画像データとの関係は、別の縮小画像データが、任意の縮小画像データが含む複数の画素の画像データにおける位置からX軸方向およびY軸方向それぞれに1以上かつ所定数以下(ここでは2以下)だけそれぞれ離れた複数の画素からなることである。 In the binarized image data shown in FIGS. 10A and 10B, the number of pixels set to “1” by binarization is smaller than the other binarized image data. This is because the pixels constituting the pattern represented by the value “2” or “3” included in the image data shown in FIG. 6 have been removed by the resolution conversion process and the binarization process. On the other hand, at least one of the nine binarized image data in FIGS. 10A to 12C, here, the pattern from seven reduced image data excluding FIGS. 10A and 10B. Can be extracted. For this reason, among a plurality of reduced image data that can be generated by resolution conversion, here, any one of the nine reduced image data in FIGS. 7A to 9C and the reduced image data. A pattern can be extracted from one of two pieces of reduced image data, which is another reduced image data having a predetermined relationship with the image data. The relationship between an arbitrary reduced image data and another reduced image data is such that another reduced image data is one or more in the X-axis direction and the Y-axis direction from the position in the image data of a plurality of pixels included in the arbitrary reduced image data. In addition, it is composed of a plurality of pixels separated by a predetermined number or less (here, 2 or less).
<変形例>
図13は、変形例における画像処理部の回路構成の一例を示す図である。図4に示した回路構成と異なる点は、第1の2値化部303Aおよび第2の2値化部303Bを1つの2値化部303に変更した点、第1認識部305Aおよび第2認識部305Bを1つの認識部305に変更した点である。2値化部303の機能は、第1の2値化部303Aおよび第2の2値化部303Bと同じであり、認識部305の機能は、第1認識部305Aおよび第2認識部305Bと同じである。2値化部303は、1つの縮小画像データのみを処理可能であるため、解像度変換部301は、1つ目の縮小画像データを生成すると、1つ目の縮小画像データを2値化部303に出力する。また、判定部307Aは、認識部305で2値化データからパターンが抽出され、2値化データがパターンを含むことを示す信号を出力する場合、画像データがパターンを含むと判断し、判断結果をCPU111に出力する。一方、認識部305で1つ目の2値化データからパターンを抽出できず、2値化データがパターンを含まないことを示す信号を出力する場合、2つ目の縮小画像データを生成する指示を解像度変換部301に出力する。
<Modification>
FIG. 13 is a diagram illustrating an example of a circuit configuration of the image processing unit in the modification. 4 differs from the circuit configuration shown in FIG. 4 in that the
解像度変換部301は、先に生成し、2値化部303に出力した1つ目の縮小画像データとは異なる縮小画像データを生成し、2値化部303にそれを出力する。2つ目に生成する縮小画像データに含まれる複数の画素と、1つ目に生成した縮小画像データに含まれる複数の画素との関係は、画像データの同じブロックから抽出された2つの画素が、画素画像データ中における位置がX軸方向に1画素以上2画素以下、Y軸方向に1画素以上2画素以下離れた関係にあるのが好ましい。
The
判定部307Aは、2つ目の縮小画像データを2値化した2値化データから認識部305でパターンが抽出され、2値化データがパターンを含むことを示す信号を出力する場合、画像データがパターンを含むと判断し、判断結果をCPU111に出力する。一方、2つ目の縮小画像データを2値化した2値化データから認識部305でパターンを抽出できず、2値化データがパターンを含まないことを示す信号を出力する場合、画像データがパターンを含ないと判断し、判断結果をCPU111に出力する。画像データにパターンが含まれていれば、2つの縮小画像データのいずれか一方にパターンが含まれるからである。
When the
図14は、画像処理部が実行する画像処理の流れの一例を示すフローチャートである。この画像処理は、画像処理部30がROM113に記憶されたパターン抽出プログラムを実行することにより、画像処理部30により実行される処理である。図13を参照して、画像処理部30は、画像データを受け付けたか否かを判断する(ステップS01)。画像データを受け付けるまで待機状態となり(ステップS01でNO)、画像データを受け付けたならば処理をステップS02に進める。すなわち、画像処理は、画像データを受け付けることにより実行される処理である。画像データは、CPU111からの指示により、画像処理部30が、RAM112から画像データを読み出すことにより受け付ける。ここでは、図5に示した部分を含む画像データが受け付けられた場合を例に説明する。
FIG. 14 is a flowchart illustrating an example of the flow of image processing executed by the image processing unit. This image processing is processing executed by the
ステップS02においては、画像データの解像度を変換して、縮小画像データを生成する。ここでは、図7(A)に示した縮小画像データを生成したものとする。そして、次のステップS03においては、パターンマッチング処理を実行する。パターンマッチング処理については後述するが、縮小画像データが、予め定めた色および形状のパターンを含むか否かを判断する処理である。画像データそのものではなく、縮小画像データを処理対象としてパターンマッチング処理を実行するのは、処理するためのデータ量を少なくして処理速度を高めるためである。 In step S02, the resolution of the image data is converted to generate reduced image data. Here, it is assumed that the reduced image data shown in FIG. In the next step S03, pattern matching processing is executed. As will be described later, the pattern matching process is a process for determining whether the reduced image data includes a pattern of a predetermined color and shape. The reason why the pattern matching process is executed on the reduced image data as a processing target instead of the image data itself is to reduce the amount of data to be processed and increase the processing speed.
ステップS04においては、パターンマッチングの結果、パターンを抽出できたか否かを判断する。ステップS02において、生成した縮小画像データからパターンを抽出できたならば処理をステップS07に進めるが、そうでなければ処理をステップS05に進める。ステップS07においては、パターンありを示す信号をCPU111に出力し、処理を終了する。ステップS05においては、パターンマッチング処理を2回実行したか否かを判断する、2回実行したならば処理をステップS08に進めるが、パターンマッチング処理を1回しか実行しておらず2回していなければ処理をステップS06に進める。
In step S04, it is determined whether the pattern has been extracted as a result of pattern matching. If the pattern can be extracted from the generated reduced image data in step S02, the process proceeds to step S07. If not, the process proceeds to step S05. In step S07, a signal indicating that there is a pattern is output to
ステップS06においては、次に実行する解像度変換処理で画像データから抽出する画素を、先に抽出した画素と異なる画素に変更し、処理をステップS02に進める。具体的には、先に実行した解像度変換処理において画像データから抽出した画素の画素画像データ中における位置からX軸方向に1画素以上2画素以下、Y軸方向に1画素以上2画素以下離れた位置の画素を抽出する画素に決定する。ステップS02においては、ステップS06で抽出すことが決定された画素を画像データから抽出することにより、解像度を変換した縮小画像データを生成する。そして、生成した縮小画像データに対してパターンマッチング処理し(ステップS03)、処理をステップS04に進める。ステップS04においては、パターンマッチングの結果、パターンを抽出できたか否かを判断する。ステップS02において、2回目に生成した縮小画像データからパターンを抽出できたならば処理をステップS07に進めるが、そうでなければ処理をステップS05に進める。処理がステップS05に進む場合、パターンマッチング処理を2回実行したので、処理をステップS08に進める。画像データにパターンが含まれていれば、2つの縮小画像データのいずれか一方にパターンが含まれるからである。ステップS08においては、パターンなしを示す信号をCPU111に出力し、処理を終了する。
In step S06, the pixel extracted from the image data in the resolution conversion process to be executed next is changed to a pixel different from the previously extracted pixel, and the process proceeds to step S02. Specifically, from the position in the pixel image data of the pixel extracted from the image data in the resolution conversion process executed earlier, the pixel is separated by 1 to 2 pixels in the X-axis direction and 1 to 2 pixels in the Y-axis direction. The pixel at the position is determined as the pixel to be extracted. In step S02, the pixel determined to be extracted in step S06 is extracted from the image data to generate reduced image data having a converted resolution. Then, pattern matching processing is performed on the generated reduced image data (step S03), and the process proceeds to step S04. In step S04, it is determined whether the pattern has been extracted as a result of pattern matching. In step S02, if the pattern can be extracted from the reduced image data generated for the second time, the process proceeds to step S07. If not, the process proceeds to step S05. When the process proceeds to step S05, since the pattern matching process has been executed twice, the process proceeds to step S08. This is because if the pattern is included in the image data, the pattern is included in one of the two reduced image data. In step S08, a signal indicating no pattern is output to
なお、ステップS01で受け付けた画像データから2つの縮小画像データを生成し、それぞれに対して、ステップS03およびステップS04を実行するようにしてもよい。すなわち、2つの縮小画像データに実行する2つのパターンマッチング処理を並行して実行する。これにより、処理速度を速めることができる。そして、いずれかの縮小画像データにパターンが含まれていれば処理をステップS07に進め、2つの縮小画像データのいずれにもパターンが含まれていなければ処理をステップS08に進める。2つの縮小画像データは、一方の縮小画像データの画像データ中から抽出される画素の位置と他方の縮小画像データの画像データ中から抽出される画素の位置とが、X軸方向に1画素以上2画素以下、Y軸方向に1画素以上2画素以下離れるように生成される。 Note that two reduced image data may be generated from the image data received in step S01, and step S03 and step S04 may be executed for each. That is, two pattern matching processes executed on two reduced image data are executed in parallel. Thereby, the processing speed can be increased. If any one of the reduced image data includes a pattern, the process proceeds to step S07. If neither of the two reduced image data includes a pattern, the process proceeds to step S08. In the two reduced image data, the position of the pixel extracted from the image data of one reduced image data and the position of the pixel extracted from the image data of the other reduced image data are one pixel or more in the X-axis direction. It is generated so as to be 2 pixels or less and 1 pixel or more and 2 pixels or less apart in the Y-axis direction.
図15は、パターンマッチング処理の流れの一例を示すフローチャートである。パターンマッチング処理は、図14のステップS03において実行される処理である。図15を参照して、ステップS11においては、縮小画像データを2値化し、2値化データを生成する2値化処理を実行する。2値化処理の詳細については後述する。そして、2値化データがパターンを含むか否かを判断するためにパターン認識を実行する。パターン認識の結果を判断し(ステップS13)、2値化データがパターンを含むならば処理をステップS14に進め、そうでなく2値化データがパターンを含まなければ処理をステップS15に進める。ステップS14においては、返り値に「パターンあり」を設定し、処理を画像処理に戻す。ステップS15においては、返り値に「パターンなし」を設定し、処理を画像処理に戻す。 FIG. 15 is a flowchart illustrating an example of the flow of pattern matching processing. The pattern matching process is a process executed in step S03 of FIG. Referring to FIG. 15, in step S11, binarization processing for binarizing the reduced image data and generating binarized data is executed. Details of the binarization processing will be described later. Then, pattern recognition is performed to determine whether the binarized data includes a pattern. The pattern recognition result is determined (step S13), and if the binarized data includes a pattern, the process proceeds to step S14. If the binarized data does not include the pattern, the process proceeds to step S15. In step S14, “with pattern” is set as the return value, and the process returns to the image processing. In step S15, “no pattern” is set as the return value, and the process returns to the image processing.
図16は、2値化処理の一例を示すフローチャートである。2値化処理は、図15のステップS11において実行される処理である。図16を参照して、ステップS21においては、縮小画像データが含む複数の画素のいずれかを処理対象画素に決定する。そして、処理対象画素の周辺に白色の白画素が存在するか否かを判断する(ステップS22)。ここでは、処理対象画素とX軸方向の一方の側に並ぶ2つの画素と、他方の側に並ぶ2つの画素の合計4つの画素を周辺画素とし、周辺画素のいずれかが白画素か否かを判断する。周辺画素のいずれか1つでも白画素であれば処理をステップS23に進め、そうでなければ処理をステップS26に進める。周辺画素のいずれも白画素でなければ、処理対象画素が背景の模様の画素である可能性が高く、周辺画素のいずれか1つでも白画素であれば、処理対象画素が背景の模様の画素でない可能性が高い。処理対象画素が、背景の模様の画素である場合と、そうでない場合とで2値化に用いるしきい値を異ならせるためである。 FIG. 16 is a flowchart illustrating an example of the binarization process. The binarization process is a process executed in step S11 of FIG. Referring to FIG. 16, in step S21, any one of a plurality of pixels included in the reduced image data is determined as a processing target pixel. Then, it is determined whether or not there are white white pixels around the pixel to be processed (step S22). Here, a total of four pixels, that is, a pixel to be processed and two pixels arranged on one side in the X-axis direction and two pixels arranged on the other side are used as peripheral pixels, and whether or not any of the peripheral pixels is a white pixel. Judging. If any one of the peripheral pixels is a white pixel, the process proceeds to step S23; otherwise, the process proceeds to step S26. If none of the peripheral pixels is a white pixel, it is highly likely that the processing target pixel is a background pattern pixel. If any one of the peripheral pixels is a white pixel, the processing target pixel is a background pattern pixel. It is likely not. This is because the threshold value used for binarization differs depending on whether the processing target pixel is a background pattern pixel or not.
ステップS23においては、処理対象画素の濃度が、第1の範囲内か否かを判断する。ここでは、第1のしきい値を第1の範囲としている。第1の範囲は、パターンの色によって定まり、画像データがカラーの場合にはR,GおよびBそれぞれに対する範囲を定義する。処理対象画素のR,GおよびBの値が第1の範囲で定義されるR,GおよびBに対する範囲にそれぞれ含まれるならば、処理対象画素の濃度が第1の範囲内と判断し、処理をステップS24に進めるが、そうでなければ処理をステップS25に進める。ステップS24においては、処理対象画素に対応する2値化データの画素の値を「1」に設定し、処理をステップS29に進める。ステップS25においては、処理対象画素に対応する2値化データの画素の値を「0」に設定し、処理をステップS29に進める。 In step S23, it is determined whether or not the density of the processing target pixel is within the first range. Here, the first threshold is the first range. The first range is determined by the color of the pattern. When the image data is color, the first range is defined for each of R, G, and B. If the R, G, and B values of the processing target pixel are included in the ranges for R, G, and B defined in the first range, the density of the processing target pixel is determined to be within the first range, and the processing is performed. The process proceeds to step S24; otherwise, the process proceeds to step S25. In step S24, the pixel value of the binarized data corresponding to the processing target pixel is set to “1”, and the process proceeds to step S29. In step S25, the pixel value of the binarized data corresponding to the processing target pixel is set to “0”, and the process proceeds to step S29.
ステップS26においては、処理対象画素の濃度が、第2の範囲内か否かを判断する。ここでは、第2のしきい値を第2の範囲としている。第2の範囲は、パターンの色と背景の模様の色とによって定まり、画像データがカラーの場合にはR,GおよびBそれぞれに対する範囲を定義する。処理対象画素のR,GおよびBの値が第2の範囲で定義されるR,GおよびBに対する範囲にそれぞれ含まれるならば、処理対象画素の濃度が第2の範囲内と判断し、処理をステップS27に進めるが、そうでなければ処理をステップS28に進める。ステップS27においては、処理対象画素に対応する2値化データの画素の値を「1」に設定し、処理をステップS29に進める。ステップS28においては、処理対象画素に対応する2値化データの画素の値を「0」に設定し、処理をステップS29に進める。 In step S26, it is determined whether or not the density of the processing target pixel is within the second range. Here, the second threshold value is the second range. The second range is determined by the color of the pattern and the color of the background pattern, and defines the ranges for R, G, and B when the image data is color. If the R, G, and B values of the processing target pixel are included in the ranges for R, G, and B defined in the second range, respectively, it is determined that the density of the processing target pixel is within the second range, and the processing The process proceeds to step S27; otherwise, the process proceeds to step S28. In step S27, the pixel value of the binarized data corresponding to the processing target pixel is set to “1”, and the process proceeds to step S29. In step S28, the pixel value of the binarized data corresponding to the processing target pixel is set to “0”, and the process proceeds to step S29.
以上説明したように、本実施の形態におけるMFP100は、画像データからX軸方向に第1の数の画素を間引き、Y軸方向に第2の数の画素を間引くことにより、生成した縮小画像データを2値化した2値化データがパターンを含むか否かを判断するので、パターンマッチングの処理対象とする画素数およびデータ量を減らして処理速度を向上させることができる。
As described above,
また、画像データにおける位置が異なる第1の縮小画像データと第2の縮小画像データとを生成し、それらを2値化した第1の2値化データと第2の2値化データのいずれかがパターンを含むか否かを判断するので、パターンマッチングの精度を向上させることができる。 Further, the first reduced image data and the second reduced image data having different positions in the image data are generated, and any one of the first binarized data and the second binarized data obtained by binarizing them. Therefore, it is possible to improve the accuracy of pattern matching.
また、ある1つの縮小画像データと、それが含む複数の画素の画像データにおける位置からX軸方向およびY軸方向それぞれに1以上かつ所定数以下(ここでは2以下)だけそれぞれ離れた複数の画素からなる縮小画像データを別の縮小画像データとすれば、画像データにパターンが含まれていれば、いずれか一方の縮小画像データがパターンを含む。このため、2つの縮小画像データがパターンを含むか否かを判断すればよく、処理対象とする縮小画像データの数を減らして、パターンマッチングの精度を向上させることができる。 Also, a plurality of pixels that are one or more and less than or equal to a predetermined number (here, two or less) in each of the X-axis direction and the Y-axis direction from a certain reduced image data and the position in the image data of a plurality of pixels included in the one reduced image data If the reduced image data consisting of is another reduced image data, if the image data includes a pattern, one of the reduced image data includes the pattern. For this reason, it is only necessary to determine whether or not the two reduced image data include a pattern, and the number of reduced image data to be processed can be reduced to improve the accuracy of pattern matching.
なお、上述した実施の形態においては画像処理装置の一例としてMFP100について説明したが、図14〜図16に示した処理をMFP100に実行させるためのパターン抽出方法、および図14〜図16に示した処理をMFP100またはPC3,3A,3B、3Cに実行させるためのパターン抽出プログラムとして発明を捉えることができるのは言うまでもない。
In the above-described embodiment, the
今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。 The embodiment disclosed this time should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.
<付記>
(1) 前記第1のしきい値および前記第2のしきい値それぞれは、濃度の範囲を定義する、請求項3に記載の画像処理装置。
(2) 前記第1のしきい値の最大値である濃度は、前記第2のしきい値の最大値である濃度よりも高い、(1)に記載の画像処理装置。
<Appendix>
(1) The image processing apparatus according to
(2) The image processing apparatus according to (1), wherein a density that is the maximum value of the first threshold is higher than a density that is the maximum value of the second threshold.
1 画像形成システム、2 ネットワーク、3,3A,3B,3C コンピュータ、4 デジタルカメラ、5 デジタルビデオカメラ、6 携帯情報端末、9 操作パネル、20 画像読取部、20 画像読取部、30 画像処理部、40 画像形成部、50 給紙部、60 ファクシミリ部、61 通信制御部、100 MFP、101 メイン回路、111 CPU、112 RAM、113 ROM、114 表示部、115 操作部、116 HDD、117 データ通信制御部、118 LAN端子、119 シリアル通信インターフェース端子、119A メモリカード、301 解像度変換部、303 2値化部、303A 第1の2値化部、303B 第2の2値化部、305 認識部、305A 第1認識部、305B 第2認識部、307,307A 判定部。
DESCRIPTION OF
Claims (6)
前記取得された画像データから前記第1の方向に第1の数の画素を間引き、前記第2の方向に第2の数の画素を間引くことにより、複数の画素からなる縮小画像を生成する縮小画像生成手段と、
前記縮小画像生成手段は、第1の縮小画像と、該第1の縮小画像に含まれる複数の画素とは前記画像データにおける位置が異なる複数の画素からなる第2の縮小画像とを生成し、
前記生成された第1および第2の縮小画像をそれぞれ2値化し、第1および第2の2値化画像を生成する2値化手段と、
前記第1の2値化画像および前記第2の2値化画像のいずれかが所定のパターンを含むか否かを判断するパターンマッチング手段と、を備えた画像処理装置。 Image data acquisition means for acquiring image data defining positions and pixel values of a plurality of pixels arranged in a first direction and a second direction;
Reduction that generates a reduced image composed of a plurality of pixels by thinning out the first number of pixels in the first direction and thinning out the second number of pixels in the second direction from the acquired image data. Image generating means;
The reduced image generating means generates a first reduced image and a second reduced image composed of a plurality of pixels whose positions in the image data are different from the plurality of pixels included in the first reduced image,
Binarization means for binarizing the generated first and second reduced images, respectively, and generating first and second binarized images;
An image processing apparatus comprising: a pattern matching unit that determines whether any of the first binarized image and the second binarized image includes a predetermined pattern.
前記検出された周辺画素の濃度が所定の濃度以下の白画素が存在する場合に第1しきい値を用いて2値化する第1の2値化手段と、
前記白画素が存在しない場合に第2しきい値を用いて2値化する第2の2値化手段と、を含む、請求項1に記載の画像処理装置。 The binarization means includes density detection means for detecting the density of pixels around the pixel to be processed;
First binarization means for binarization using a first threshold value when there is a white pixel having a density of the detected peripheral pixel equal to or lower than a predetermined density;
The image processing apparatus according to claim 1, further comprising: a second binarization unit that binarizes using a second threshold when the white pixel does not exist.
前記受け付けられた画像データから前記第1の方向に第1の数の画素を間引き、前記第2の方向に第2の数の画素を間引くことにより、複数の画素からなる第1の縮小画像を生成するステップと、
前記受け付けられた画像データから前記第1の方向に前記第1の数の画素を間引き、前記第2の方向に前記第2の数の画素を間引くことにより、前記第1の縮小画像に含まれる複数の画素とは前記画像データにおける位置が異なる複数の画素からなる第2の縮小画像を生成するステップと、
前記生成された第1および第2の縮小画像をそれぞれ2値化した第1および第2の2値化画像を生成するステップと、
前記第1の2値化画像および前記第2の2値化画像の少なくとも一方が所定のパターンを含むか否かを判断するステップと、を含むパターン抽出方法。 Receiving image data defining positions and pixel values of a plurality of pixels arranged in a first direction and a second direction;
By thinning out the first number of pixels in the first direction and thinning out the second number of pixels in the second direction from the received image data, a first reduced image composed of a plurality of pixels is obtained. Generating step;
Included in the first reduced image by thinning out the first number of pixels in the first direction and thinning out the second number of pixels in the second direction from the received image data. Generating a second reduced image composed of a plurality of pixels whose positions in the image data are different from the plurality of pixels;
Generating first and second binarized images obtained by binarizing the generated first and second reduced images, respectively;
Determining whether at least one of the first binarized image and the second binarized image includes a predetermined pattern.
前記受け付けられた画像データから前記第1の方向に第1の数の画素を間引き、前記第2の方向に第2の数の画素を間引くことにより、複数の画素からなる第1の縮小画像を生成するステップと、
前記受け付けられた画像データから前記第1の方向に前記第1の数の画素を間引き、前記第2の方向に前記第2の数の画素を間引くことにより、前記第1の縮小画像に含まれる複数の画素とは前記画像データにおける位置が異なる複数の画素からなる第2の縮小画像を生成するステップと、
前記生成された第1および第2の縮小画像をそれぞれ2値化した第1および第2の2値化画像を生成するステップと、
前記第1の2値化画像および前記第2の2値化画像の少なくとも一方が所定のパターンを含むか否かを判断するステップと、をコンピュータに実行させるパターン抽出プログラム。 Receiving image data defining positions and pixel values of a plurality of pixels arranged in a first direction and a second direction;
By thinning out the first number of pixels in the first direction and thinning out the second number of pixels in the second direction from the received image data, a first reduced image composed of a plurality of pixels is obtained. Generating step;
Included in the first reduced image by thinning out the first number of pixels in the first direction and thinning out the second number of pixels in the second direction from the received image data. Generating a second reduced image composed of a plurality of pixels whose positions in the image data are different from the plurality of pixels;
Generating first and second binarized images obtained by binarizing the generated first and second reduced images, respectively;
A pattern extraction program for causing a computer to execute whether or not at least one of the first binarized image and the second binarized image includes a predetermined pattern.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2006326593A JP2008140208A (en) | 2006-12-04 | 2006-12-04 | Image processing device, pattern extraction method, and pattern extraction program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2006326593A JP2008140208A (en) | 2006-12-04 | 2006-12-04 | Image processing device, pattern extraction method, and pattern extraction program |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2008140208A true JP2008140208A (en) | 2008-06-19 |
Family
ID=39601579
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2006326593A Pending JP2008140208A (en) | 2006-12-04 | 2006-12-04 | Image processing device, pattern extraction method, and pattern extraction program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2008140208A (en) |
-
2006
- 2006-12-04 JP JP2006326593A patent/JP2008140208A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP5887770B2 (en) | Image processing apparatus and image processing program | |
| US9485368B2 (en) | Electronic document generation apparatus, recording medium, and electronic document generation system | |
| JP2010288229A (en) | Image processing method, image processing apparatus, image forming apparatus, program, and recording medium | |
| JP4725645B2 (en) | Image processing apparatus, data amount reduction method, and data amount reduction program | |
| JP5042917B2 (en) | Image processing apparatus and program | |
| JP4329764B2 (en) | Image processing apparatus and ruled line extraction program | |
| CN102271212B (en) | Background pattern image combining apparatus, background pattern image combining method, and computer program | |
| JP4424309B2 (en) | Image processing apparatus, character determination program, and character determination method | |
| JP2008099149A (en) | Image processor, image processing method and image processing program | |
| JP4905275B2 (en) | Image processing apparatus, image processing method, and image processing program | |
| JP5819378B2 (en) | Image determination apparatus, image processing system, program, and recording medium | |
| JP2010124069A (en) | Image processing method, image processor, image forming apparatus, program, and recording medium | |
| JP2010287178A (en) | Image processing apparatus, image reading apparatus, multifunction machine, image processing method, program, and recording medium | |
| JP4752697B2 (en) | Thumbnail generation apparatus, thumbnail generation method, and thumbnail generation program | |
| US8260057B2 (en) | Image processing apparatus that obtains a ruled line from a multi-value image | |
| JP2008140208A (en) | Image processing device, pattern extraction method, and pattern extraction program | |
| CN105592244B (en) | Image processing apparatus | |
| JP2011010232A (en) | Image processing apparatus, image reading apparatus, multi function peripheral, image processing method, program and recording medium | |
| JP2020141364A (en) | Programs, terminals, and controls | |
| JP2005196659A (en) | Program, recording medium and apparatus for processing image | |
| JP2010068198A (en) | Image forming apparatus | |
| JP2007257360A (en) | Two-dimensional code, two-dimensional code reading device, and two-dimensional code reading program | |
| JP6460025B2 (en) | Image reading apparatus and image forming apparatus | |
| JP4653215B2 (en) | Code recognition method and apparatus, electronic apparatus, program, and storage medium | |
| JP7009750B2 (en) | Image forming device, tint block area determination method and tint block area determination program by the device |