[go: up one dir, main page]

JP2008140208A - Image processing device, pattern extraction method, and pattern extraction program - Google Patents

Image processing device, pattern extraction method, and pattern extraction program Download PDF

Info

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
Application number
JP2006326593A
Other languages
Japanese (ja)
Inventor
Naoko Hiramatsu
尚子 平松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Konica Minolta Business Technologies Inc
Original Assignee
Konica Minolta Business Technologies Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Konica Minolta Business Technologies Inc filed Critical Konica Minolta Business Technologies Inc
Priority to JP2006326593A priority Critical patent/JP2008140208A/en
Publication of JP2008140208A publication Critical patent/JP2008140208A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To improve processing speed and accuracy of pattern matching. <P>SOLUTION: An MFP 100 comprises an image reading section for acquiring image data, a resolution conversion section 301 for creating a first reduced image data and a second reduced image data made of a plurality of pixels in which positions of the image data are different from the plurality of pixels included in the first reduced image data so that the first number of pixels is thinned out from the image data in the X-axis direction and the second number of pixels is thinned out from the image data in the Y-axis direction; a first binarizing section 303A and second binarizing section 303B which binarize the first and second reduced image data and respectively create first and second binary data; and a first certification section 305A, a second certification section 305B, and a determination section 307 for determining whether or not either of first binary image and second binary image includes a designated pattern. <P>COPYRIGHT: (C)2008,JPO&INPIT

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値化データにはそのパターンの一部が存在しなくなり、パターンを抽出することができなくなってしまう場合があるといった問題がある。
特開2001−312725号公報 特開2001−312726号公報
Further, binary data obtained by binarizing image data or reduced image data is used to process pattern matching at high speed. However, by binarizing, the original image data or reduced image data exists. Since the original information is lost, the original image data includes a pattern, but the binarized data does not have a part of the pattern, and the pattern may not be extracted. There is.
JP 2001-31725 A JP 2001-31726 A

この発明は上述した問題点を解決するためになされたもので、この発明の目的の一つは、パターンマッチングの処理速度を向上させるとともに精度を向上した画像処理装置を提供することである。   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 image forming system 1 includes an MFP (Multi Function Peripheral) 100 as an image forming apparatus connected to a network 2 and computers 3, 3A, 3B, and 3C, respectively. Digital camera 4, digital video camera 5, and portable information terminal 6.

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は、画像処理装置としても機能する。   Computers 3, 3 </ b> A, 3 </ b> B, and 3 </ b> C are general personal computers, and a printer driver program for controlling MFP 100 is installed. Computers 3, 3 </ b> A, 3 </ b> B, and 3 </ b> C output print data or image data generated when they execute an application program to MFP 100. MFP 100 performs image processing on print data or image data input from portable information terminal 6, or forms an image on a recording medium based on the print data or image data. Furthermore, the computers 3, 3A, 3B, 3C also function as image processing apparatuses.

デジタルカメラ4およびデジタルビデオカメラ5は、撮像した静止画像または動画像を記憶し、それらが接続されたMFP100に静止画像または動画像の画像データを出力する。MFP100は、入力される静止画像の画像データを画像処理する、また、静止画像の画像データに基づき用紙等の記録媒体に静止画像を形成する。また、動画像の画像データが入力される場合、1フレームの画像の画像データを画像処理する、また、1フレームの画像の画像データに基づき記録媒体に画像を形成する。携帯情報端末6は、コンピュータ3,3A,3B,3Cと同様に、それがアプリケーションプログラムを実行することにより生成されるデータまたは画像データを、MFP100に出力する。MFP100は、携帯情報端末6から入力されるデータまたは画像データを画像処理する、また、その画像データに基づいて、記録媒体に画像を形成する。   The digital camera 4 and the digital video camera 5 store captured still images or moving images, and output image data of the still images or moving images to the MFP 100 to which they are connected. The MFP 100 performs image processing on the input still image data, and forms a still image on a recording medium such as paper based on the still image data. When image data of a moving image is input, image data of one frame image is processed, and an image is formed on a recording medium based on the image data of one frame image. As with the computers 3, 3 A, 3 B, 3 C, the portable information terminal 6 outputs data or image data generated by executing an application program to the MFP 100. MFP 100 performs image processing on data or image data input from portable information terminal 6 and forms an image on a recording medium based on the image data.

ネットワーク2は、ローカルエリアネットワーク(LAN)であり、接続形態は有線または無線を問わない。またネットワーク2は、LANに限らず、ワイドエリアネットワーク(WAN)、インターネット等であってもよい。   The network 2 is a local area network (LAN), and the connection form may be wired or wireless. The network 2 is not limited to a LAN, and may be a wide area network (WAN), the Internet, or the like.

図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 image reading unit 20, an image forming unit 40, and a paper feeding unit 50. The ADF 10 handles a plurality of documents mounted on the document table, and sequentially conveys them to the image reading unit 20 one by one. The image reading unit 20 optically reads image information such as photographs, characters, pictures, and the like from a document and acquires image data. When the image data is input, the image forming unit 40 forms an image on a sheet based on the image data. The image forming unit 40 forms an image using toners of four colors, cyan, magenta, yellow, and black. The paper feed unit 50 stores paper and supplies the stored paper to the image forming unit 40 one by one. MFP 100 includes an operation panel 9 on the upper surface thereof.

図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, MFP 100 includes main circuit 101, facsimile unit 60, communication control unit 61, ADF 10, image reading unit 20, image processing unit 30, image forming unit 40, and paper feeding unit. 50. The main circuit 101 includes a central processing unit (CPU) 111, a RAM (Random Access Memory) 112 used as a work area of the CPU 111, a ROM (Read Only Memory) 113 for storing programs executed by the CPU 111, and the like. A display unit 114, an operation unit 115, a hard disk drive (HDD) 116 as a mass storage device, and a data communication control unit 117. The CPU 111 is connected to the display unit 114, the operation unit 115, the HDD 116, and the data communication control unit 117, and controls the entire main circuit 101. The CPU 111 is connected to the facsimile unit 60, the communication control unit 61, the ADF 10, the image reading unit 20, the image processing unit 30, the image forming unit 40, and the paper feeding unit 50, and controls the entire MFP 100.

表示部114は、液晶表示装置(LCD)、有機ELD(Electro Luminescence Display)等の表示装置であり、ユーザに対する指示メニューや取得した画像データに関する情報等を表示する。操作部115は、複数のキーを備え、キーに対応するユーザの操作による各種の指示、文字、数字などのデータの入力を受付ける。操作部115は、表示部114上に設けられたタッチパネルを含む。表示部114と操作部115とで、操作パネル9が構成される。   The display unit 114 is a display device such as a liquid crystal display (LCD) or an organic ELD (Electro Luminescence Display), and displays an instruction menu for the user, information about acquired image data, and the like. The operation unit 115 includes a plurality of keys, and accepts input of various instructions, data such as characters and numbers by user operations corresponding to the keys. The operation unit 115 includes a touch panel provided on the display unit 114. The display unit 114 and the operation unit 115 constitute the operation panel 9.

データ通信制御部117は、TCP(Transmission Control Protocol)またはFTP(File Transfer Protocol)等の通信プロトコルで通信するためのインターフェースであるLAN端子118と、シリアル通信インターフェース端子119とを有する。データ通信制御部117は、CPU111からの指示に従って、LAN端子118またはシリアル通信インターフェース端子119に接続された外部の機器との間でデータを送受信する。   The data communication control unit 117 includes a LAN terminal 118 that is an interface for communicating with a communication protocol such as TCP (Transmission Control Protocol) or FTP (File Transfer Protocol), and a serial communication interface terminal 119. The data communication control unit 117 transmits / receives data to / from an external device connected to the LAN terminal 118 or the serial communication interface terminal 119 in accordance with an instruction from the CPU 111.

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 network 2 is connected to the LAN terminal 118, the data communication control unit 117 is connected to another MFP, scanner, printer, or computer 3, 3A, which is connected via the LAN terminal 118. Communicate with 3B, 3C. When a device is connected to the serial communication interface terminal 119, the data communication control unit 117 communicates with a device connected to the serial communication interface terminal 119, for example, the digital camera 4, the digital video camera 5, or the portable information terminal 6. Communicate and input / output image data. The serial communication interface terminal 119 can be connected to a memory card 119A incorporating a flash memory. The CPU 111 controls the data communication control unit 117 to read a program to be executed by the CPU 111 or the image processing unit 30 from the memory card 119A, and stores the read program in the RAM 112 and executes it.

なお、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 CPU 111 or the image processing unit 30 is not limited to the memory card 119A, but a flexible disk, a cassette tape, an optical disk (CD-ROM (Compact Disc-Read Only Memory) / MO). (Magnetic Optical Disc / MD (Mini Disc) / DVD (Digital Versatile Disc)), IC card (including memory card), optical card, mask ROM, EPROM (Erasable Programmable ROM), EEPROM (Electrical ROM, etc.) Further, the CPU 111 may be programmed from a computer connected to the Internet. The program is downloaded and stored in the HDD 116, or the computer connected to the Internet writes the image data storage program in the HDD 116, and the program stored in the HDD 116 is loaded into the RAM 112 and the CPU 111 or the image processing unit 30. The program here includes not only a program that can be directly executed by the CPU 111 or the image processing unit 30, but also a source program, a compressed program, an encrypted program, and the like.

通信制御部61は、CPU111をPSTN7に接続するためのモデムである。MFP100には、PSTN7における電話番号が予め割り当てられており、PSTN7に接続されたファクシミリ装置からMFP100に割り当てられた電話番号に発呼があると、通信制御部61がその発呼を検出する。通信制御部61は、発呼を検出すると通話を確立し、ファクシミリ部60に通信させる。   The communication control unit 61 is a modem for connecting the CPU 111 to the PSTN 7. The MFP 100 is assigned a telephone number in the PSTN 7 in advance. When a call is made from the facsimile apparatus connected to the PSTN 7 to the telephone number assigned to the MFP 100, the communication control unit 61 detects the call. When the communication control unit 61 detects a call, the communication control unit 61 establishes a call and causes the facsimile unit 60 to communicate.

ファクシミリ部60は、PSTN7に接続され、PSTN7にファクシミリデータを送信する、またはPSTN7からファクシミリデータを受信する。ファクシミリ部60は、受信したファクシミリデータを、CPU111に出力する。また、ファクシミリ部60は、受信したファクシミリデータを画像形成部40でプリント可能なプリントデータに変換して、画像形成部40に出力する。これにより、画像形成部40は、ファクシミリ部60により受信されたファクシミリデータを記録シートにプリントする。また、ファクシミリ部60は、HDD116に記憶された画像データをファクシミリデータに変換して、PSTN7に接続されたファクシミリ装置または他のMFPに出力する。これにより、HDD116に記憶されたデータをファクシミリ装置または他のMFPに出力することができる。なお、ファクシミリデータは画像データに含まれる。このように、MFP100は、ファクシミリ送受信機能を有する。   The facsimile unit 60 is connected to the PSTN 7 and transmits facsimile data to the PSTN 7 or receives facsimile data from the PSTN 7. The facsimile unit 60 outputs the received facsimile data to the CPU 111. The facsimile unit 60 converts the received facsimile data into print data that can be printed by the image forming unit 40 and outputs the print data to the image forming unit 40. As a result, the image forming unit 40 prints the facsimile data received by the facsimile unit 60 on a recording sheet. The facsimile unit 60 converts the image data stored in the HDD 116 into facsimile data, and outputs the facsimile data to a facsimile machine connected to the PSTN 7 or another MFP. As a result, the data stored in HDD 116 can be output to a facsimile machine or another MFP. The facsimile data is included in the image data. As described above, the MFP 100 has a facsimile transmission / reception function.

MFP100は、スキャナ機能を有し、画像読取部20が原稿を読み取って出力する画像データが、RAM112に一時的に記憶される。また、画像形成部40は、画像読取部20が原稿を読み取って出力する画像データに基づいて、用紙等の記録シート上に画像を形成する。このため、MFP100は、コピー機能を有する。さらに、データ通信制御部117は、ネットワーク2に接続された他のPC3、3A,3B,3Cのいずれかから受信した画像データ、または、シリアル通信インターフェース端子119に接続されたデジタルカメラ4、デジタルビデオカメラ5および携帯情報端末6のいずれかから受信された画像データをRAM112に一時的に記憶する。そして、RAM112に一時的に記憶された画像データに基づいて、用紙等の記録シート上に画像を形成する。このため、MFP100は、プリント機能を有する。   The MFP 100 has a scanner function, and image data that the image reading unit 20 reads and outputs a document is temporarily stored in the RAM 112. The image forming unit 40 forms an image on a recording sheet such as paper based on image data output by the image reading unit 20 reading a document. Therefore, the MFP 100 has a copy function. Further, the data communication control unit 117 receives image data received from any of the other PCs 3, 3A, 3B, 3C connected to the network 2, or the digital camera 4 connected to the serial communication interface terminal 119, the digital video. Image data received from either the camera 5 or the portable information terminal 6 is temporarily stored in the RAM 112. Then, an image is formed on a recording sheet such as paper based on the image data temporarily stored in the RAM 112. Therefore, MFP 100 has a print function.

画像処理部30は、RAM112に記憶された画像データを画像処理する。画像処理部30は、MFP100がスキャナ機能またはコピー機能を能動化する場合には、画像読取部20が原稿を読み取って出力する画像データを画像処理する。また、画像処理部30は、MFP100がファクシミリ機能を能動化する場合には、ファクシミリ部60が受信するファクシミリデータ(画像データ)を画像処理する。さらに、画像処理部30は、データ通信制御部117が、ネットワーク2に接続された他のPC3、3A,3B,3C、スキャナ、MFPのいずれかから受信した画像データ、またはシリアル通信インターフェース端子119に接続されたデジタルカメラ4、デジタルビデオカメラ5および携帯情報端末6のいずれかから受信された画像データを画像処理する。   The image processing unit 30 performs image processing on the image data stored in the RAM 112. When the MFP 100 activates the scanner function or the copy function, the image processing unit 30 performs image processing on image data output by the image reading unit 20 reading a document. Further, when MFP 100 activates the facsimile function, image processing unit 30 performs image processing on facsimile data (image data) received by facsimile unit 60. Further, the image processing unit 30 is connected to the image data received by the data communication control unit 117 from any of the other PCs 3, 3 A, 3 B, 3 C, scanner, and MFP connected to the network 2, or to the serial communication interface terminal 119. Image data received from any of the connected digital camera 4, digital video camera 5, and portable information terminal 6 is subjected to image processing.

図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 image processing unit 30 converts a resolution of image data to generate reduced image data, and a second conversion unit for binarizing the reduced image data to generate binarized data. 1 binarization unit 303A and second binarization unit 303B, a first recognition unit 305A and a second recognition unit 305B that extract a predetermined pattern from the binarized data, and a determination unit 307.

解像度変換部301は、画像データが入力され、入力された画像データを解像度変換し、縮小画像データを生成する。画像データは、第1の方向(X軸方向)および第2の方向(Y軸方向)に配列された複数の画素の位置と画素値とを定義する。X軸方向とY軸方向とは直交する。解像度変換部301は、画像データが含む複数の画素を単純間引きすることにより解像度変換し、縮小画像を生成する。単純間引きすることにより縮小画像データを生成するのは、他の縮小方法、例えばスムージングにより生成された縮小画像データは、抽出しようとするパターンの色に周辺の画素の色が混ざってしまい、縮小画像データに含まれる画素の色が、パターンの色と異なってしまうからである。   The resolution converter 301 receives image data, converts the resolution of the input image data, and generates reduced image data. The image data defines positions and pixel values of a plurality of pixels arranged in a first direction (X-axis direction) and a second direction (Y-axis direction). The X-axis direction and the Y-axis direction are orthogonal to each other. The resolution conversion unit 301 converts the resolution by simply thinning out a plurality of pixels included in the image data, and generates a reduced image. Reduced image data is generated by simple decimation because reduced image data generated by other reduction methods, for example, smoothing, mixes the color of the surrounding pixels with the color of the pattern to be extracted. This is because the pixel color included in the data is different from the pattern color.

ここで、解像度変換処理の具体例について説明する。例えば、解像度が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 resolution converter 301 includes two pixels in the X-axis direction from the image data. , And two pixels in the Y-axis direction are thinned out to generate a reduced image composed of a plurality of pixels. In other words, the image data is divided into blocks (three rows by three columns) consisting of three pixels in the X-axis direction and the Y-axis direction, and one pixel is extracted from each of the divided blocks. Reduced image data composed of the number of pixels included in the block is generated. The plurality of pixels included in the reduced image data have the same position in the block in which each pixel is included. Accordingly, when the resolution is converted from 600 dpi to 200 dpi, nine reduced image data can be generated. The resolution conversion unit 301 generates two reduced image data with different pixels extracted from the image data. Here, the two reduced image data generated by the resolution conversion unit 301 are referred to as first reduced image data and second reduced image data. The resolution conversion unit 301 outputs the first reduced image data to the first binarization unit 303A, and outputs the second reduced image data to the second binarization unit 303B.

第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 first binarization unit 303A and the second binarization unit 303B differ only in the reduced image data to be processed and have the same functions, and therefore, the first binarization unit 303A will be described here. The first binarization unit 303A receives the first reduced image data from the resolution conversion unit 301. The first binarization unit 303A binarizes the first reduced image data using two threshold values. In the case of image data obtained by reading a document with a pattern drawn on a striped background, the color of the pattern overlaps with the background stripe and the part where the pattern does not overlap with the background stripe Different. For this reason, the pixel where the pattern does not overlap the stripe pattern is binarized using the first threshold value, and the pixel where the pattern overlaps the stripe pattern is binarized using the second threshold value. Convert to value. The first threshold value is determined by the color of the pattern to be detected from the image data, and is a predetermined value. The second threshold value is determined by the color of the pattern and the color of the background pattern. The second threshold value may be a predetermined value, or may be calculated from the first threshold value and the background pattern color. For example, a value obtained by adding at least a part of the background pattern color value to the first threshold value may be used as the second threshold value. Here, a case will be described in which image data obtained by reading a document in which a pattern is drawn on a background of a horizontal stripe pattern is processed.

第1の2値化部303Aは、処理対象画素の周辺に白色の白画素が1つでも存在する場合に第1のしきい値を用いて2値化し、処理対象画素の周辺に白画素が1つも存在しなければ第2のしきい値を用いて2値化する。背景が白色でありことが多いからである。周辺の画素は、処理対象画素の左右(第1の方向の両側)それぞれに隣接する2つの画素、合計4画素とすることができる。横縞模様の背景の原稿を読み取って得られる画像データは、左右方向(X軸方向)に白画素でない画素が配列するからである。   The first binarization unit 303A performs binarization using the first threshold when there is even one white white pixel around the processing target pixel, and the white pixel exists around the processing target pixel. If none exists, binarization is performed using the second threshold value. This is because the background is often white. The peripheral pixels may be two pixels adjacent to the left and right (both sides in the first direction) of the pixel to be processed, for a total of four pixels. This is because the image data obtained by reading a document with a horizontal stripe pattern background has pixels that are not white pixels arranged in the left-right direction (X-axis direction).

図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 first binarization unit 303A binarizes the first reduced image data to generate first binarized data. Then, the first binarized data is output to the first recognition unit 305A. In addition, the second binarization unit 303B binarizes the second reduced image data and generates second binarized data. Then, the second binarized data is output to the second recognition unit 305B.

第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 unit 305A and the second recognizing unit 305B have the same functions except that the binarized data to be processed is different, so the first recognizing unit 305A will be described here. The first recognizing unit 305A receives the first binarized data from the first binarizing unit 303A. The first recognition unit 305A receives a pattern to be extracted from the image data, and forms the pattern and a shape composed of a plurality of pixels having a pixel value “1” included in the first binarized data. Compare. If the shape of the pattern is similar to the shape composed of a plurality of pixels having a pixel value “1” included in the first binarized data, the first recognizing unit 305A Is output to the determination unit 307. If the two are not similar to each other, a signal indicating that the first binarized data does not include the pattern is output to the determination unit 307. Shape similarity includes similarity.

判定部307は、第1認識部305Aから第1の2値化データがパターンを含むことを示す信号が入力される場合、または、第2認識部305Bから第2の2値化データがパターンを含むことを示す信号が入力される場合、画像データがパターンを含むと判断し、第1認識部305Aおよび第2認識部305B双方からパターンを含まないことを示す信号が入力される場合、画像データがパターンを含まないと判断し、判断結果をCPU111に出力する。   The determination unit 307 receives a signal indicating that the first binarized data includes a pattern from the first recognizing unit 305A or the second binarized data from the second recognizing unit 305B. When a signal indicating inclusion is input, it is determined that the image data includes a pattern, and when a signal indicating no pattern is input from both the first recognition unit 305A and the second recognition unit 305B, image data Is determined not to contain a pattern, and the determination result is output to the CPU 111.

次に、画像処理部30が実行する画像処理の具体例を説明する。図6は、画像データの一例として画像データの一部を示す図である。図6を参照して、図5と同様に、1つのマスが、1つの画素を示し、縦横それぞれ36の画素を含む画像データである。数字「2」または「3」で示される画素が、パターンを構成する画素を示している。なお、数字は説明のために付したものである。ハッチングの付された画素が、背景の模様を構成する画素を示す。背景の模様が、X軸方向に配列していない。数字「2」で示される画素は、パターンを構成する画素であって、背景の模様を構成しない画素を示す。数字「3」で示される画素は、パターンを構成する画素であって、背景の模様を構成する画素を示す。   Next, a specific example of image processing executed by the image processing unit 30 will be described. FIG. 6 is a diagram illustrating a part of image data as an example of image data. Referring to FIG. 6, similarly to FIG. 5, one square represents one pixel, and is image data including 36 pixels in the vertical and horizontal directions. Pixels indicated by the numbers “2” or “3” indicate pixels constituting the pattern. Numbers are given for explanation. The hatched pixels indicate the pixels constituting the background pattern. The background pattern is not arranged in the X-axis direction. The pixel indicated by the number “2” is a pixel that forms a pattern and does not form a background pattern. The pixel indicated by the numeral “3” is a pixel that forms a pattern and that forms a background pattern.

図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 first binarization unit 303A and the second binarization unit 303B are changed to one binarization unit 303, the first recognition unit 305A and the second binarization unit 303B. The recognition unit 305B is changed to one recognition unit 305. The function of the binarization unit 303 is the same as that of the first binarization unit 303A and the second binarization unit 303B, and the function of the recognition unit 305 is the same as that of the first recognition unit 305A and the second recognition unit 305B. The same. Since the binarization unit 303 can process only one reduced image data, when the resolution conversion unit 301 generates the first reduced image data, the first reduced image data is converted into the binarization unit 303. Output to. When the recognition unit 305 extracts a pattern from the binarized data and outputs a signal indicating that the binarized data includes the pattern, the determination unit 307A determines that the image data includes the pattern, and the determination result Is output to the CPU 111. On the other hand, if the recognition unit 305 cannot extract a pattern from the first binarized data and outputs a signal indicating that the binarized data does not include a pattern, an instruction to generate the second reduced image data Is output to the resolution converter 301.

解像度変換部301は、先に生成し、2値化部303に出力した1つ目の縮小画像データとは異なる縮小画像データを生成し、2値化部303にそれを出力する。2つ目に生成する縮小画像データに含まれる複数の画素と、1つ目に生成した縮小画像データに含まれる複数の画素との関係は、画像データの同じブロックから抽出された2つの画素が、画素画像データ中における位置がX軸方向に1画素以上2画素以下、Y軸方向に1画素以上2画素以下離れた関係にあるのが好ましい。   The resolution conversion unit 301 generates reduced image data that is different from the first reduced image data that has been generated and output to the binarization unit 303, and outputs the reduced image data to the binarization unit 303. The relationship between the plurality of pixels included in the second reduced image data and the plurality of pixels included in the first generated reduced image data is that the two pixels extracted from the same block of the image data are The positions in the pixel image data are preferably 1 pixel to 2 pixels apart in the X axis direction and 1 pixel to 2 pixels apart in the Y axis direction.

判定部307Aは、2つ目の縮小画像データを2値化した2値化データから認識部305でパターンが抽出され、2値化データがパターンを含むことを示す信号を出力する場合、画像データがパターンを含むと判断し、判断結果をCPU111に出力する。一方、2つ目の縮小画像データを2値化した2値化データから認識部305でパターンを抽出できず、2値化データがパターンを含まないことを示す信号を出力する場合、画像データがパターンを含ないと判断し、判断結果をCPU111に出力する。画像データにパターンが含まれていれば、2つの縮小画像データのいずれか一方にパターンが含まれるからである。   When the determination unit 307A extracts a pattern from the binarized data obtained by binarizing the second reduced image data and outputs a signal indicating that the binarized data includes the pattern, the image data Is included in the pattern, and the determination result is output to the CPU 111. On the other hand, when the recognition unit 305 cannot extract a pattern from the binarized data obtained by binarizing the second reduced image data and outputs a signal indicating that the binarized data does not include the pattern, the image data is It is determined that the pattern is not included, and the determination result is output to the CPU 111. This is because if the pattern is included in the image data, the pattern is included in one of the two reduced image data.

図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 image processing unit 30 when the image processing unit 30 executes the pattern extraction program stored in the ROM 113. Referring to FIG. 13, the image processing unit 30 determines whether image data has been received (step S01). The process waits until image data is received (NO in step S01). If image data is received, the process proceeds to step S02. That is, the image processing is processing that is executed by receiving image data. The image data is received by the image processing unit 30 reading the image data from the RAM 112 in accordance with an instruction from the CPU 111. Here, a case where image data including the portion shown in FIG. 5 is received will be described as an example.

ステップ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 CPU 111, and the process ends. In step S05, it is determined whether or not the pattern matching process is executed twice. If the pattern matching process is executed twice, the process proceeds to step S08. However, the pattern matching process is executed only once and must be executed twice. If so, the process proceeds to step S06.

ステップ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 CPU 111, and the process ends.

なお、ステップ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, MFP 100 according to the present embodiment generates reduced image data generated by thinning out a first number of pixels in the X-axis direction and thinning out a second number of pixels in the Y-axis direction from the image data. Since it is determined whether or not the binarized data obtained by binarizing includes a pattern, the number of pixels to be processed for pattern matching and the amount of data can be reduced to improve the processing speed.

また、画像データにおける位置が異なる第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 MFP 100 has been described as an example of the image processing apparatus. However, the pattern extraction method for causing the MFP 100 to execute the processes illustrated in FIGS. 14 to 16 and FIGS. It goes without saying that the invention can be understood as a pattern extraction program for causing the MFP 100 or the PCs 3, 3A, 3B, and 3C to execute processing.

今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。   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 claim 3, wherein each of the first threshold value and the second threshold value defines a density range.
(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 is a diagram showing an overall outline of an image forming system in one embodiment of the present invention. MFPの外観を示す斜視図である。1 is a perspective view showing an appearance of an MFP. MFPのハード構成の一例を示すブロック図である。2 is a block diagram illustrating an example of a hardware configuration of an MFP. FIG. 画像処理部の回路構成の一例を示す図である。It is a figure which shows an example of the circuit structure of an image process part. 縞模様の背景にパターンが描かれ原稿を読み取って得られた画像データの一部を示す図である。It is a figure which shows a part of image data obtained by reading a document with a pattern drawn on a striped background. 画像データの一例として画像データの一部を示す図である。It is a figure which shows a part of image data as an example of image data. 縮小画像データの一例を示す第1の図である。It is a 1st figure which shows an example of reduced image data. 縮小画像データの一例を示す第2の図である。It is a 2nd figure which shows an example of reduction image data. 縮小画像データの一例を示す第3の図である。It is a 3rd figure which shows an example of reduced image data. 2値化画像データの一例を示す第1の図である。It is a 1st figure which shows an example of binarized image data. 2値化画像データの一例を示す第2の図である。It is a 2nd figure which shows an example of binarized image data. 2値化画像データの一例を示す第3の図である。It is a 3rd figure which shows an example of binarized image data. 変形例における画像処理部の回路構成の一例を示す図である。It is a figure which shows an example of the circuit structure of the image process part in a modification. 画像処理部が実行する画像処理の流れの一例を示すフローチャートである。It is a flowchart which shows an example of the flow of the image process which an image process part performs. パターンマッチング処理の流れの一例を示すフローチャートである。It is a flowchart which shows an example of the flow of a pattern matching process. 2値化処理の一例を示すフローチャートである。It is a flowchart which shows an example of a binarization process.

符号の説明Explanation of symbols

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 SYMBOLS 1 Image forming system 2 Network 3 3, 3A, 3B, 3C Computer 4 Digital camera 5 Digital video camera 6 Mobile information terminal 9 Operation panel 20 Image reading part 20 Image reading part 30 Image processing part 40 image forming unit, 50 paper feeding unit, 60 facsimile unit, 61 communication control unit, 100 MFP, 101 main circuit, 111 CPU, 112 RAM, 113 ROM, 114 display unit, 115 operation unit, 116 HDD, 117 data communication control , 118 LAN terminal, 119 serial communication interface terminal, 119A memory card, 301 resolution conversion unit, 303 binarization unit, 303A first binarization unit, 303B second binarization unit, 305 recognition unit, 305A First recognition unit, 305B Second recognition unit, 307, 3 7A determination unit.

Claims (6)

第1の方向および第2の方向に配列された複数の画素の位置と画素値とを定義する画像データを取得する画像データ取得手段と、
前記取得された画像データから前記第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の縮小画像が含む複数の画素の前記画像データにおける位置から前記第1の方向および前記第2の方向それぞれに1以上かつ前記第1の数以下だけそれぞれ離れた複数の画素からなる前記第2の縮小画像を生成する、請求項1に記載の画像処理装置。   In the image data, the reduced image generation means includes at least one of the plurality of pixels included in the first reduced image in the image data from the positions in the image data and the first direction and the first direction. The image processing apparatus according to claim 1, wherein the second reduced image including a plurality of pixels that are separated by a number or less is generated. 前記2値化手段は、処理対象画素の周辺の画素の濃度を検出する濃度検出手段と、
前記検出された周辺画素の濃度が所定の濃度以下の白画素が存在する場合に第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の方向に並ぶ画素の濃度を検出する、請求項3に記載の画像処理装置。   The image processing apparatus according to claim 3, wherein the density detection unit detects a density of 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値化画像の少なくとも一方が所定のパターンを含むか否かを判断するステップと、を含むパターン抽出方法。
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の方向および第2の方向に配列された複数の画素の位置と画素値とを定義する画像データを受け付けるステップと、
前記受け付けられた画像データから前記第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.
JP2006326593A 2006-12-04 2006-12-04 Image processing device, pattern extraction method, and pattern extraction program Pending JP2008140208A (en)

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)

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