JP2014194659A - Image processing apparatus and computer program - Google Patents

Image processing apparatus and computer program Download PDF

Info

Publication number
JP2014194659A
JP2014194659A JP2013070648A JP2013070648A JP2014194659A JP 2014194659 A JP2014194659 A JP 2014194659A JP 2013070648 A JP2013070648 A JP 2013070648A JP 2013070648 A JP2013070648 A JP 2013070648A JP 2014194659 A JP2014194659 A JP 2014194659A
Authority
JP
Japan
Prior art keywords
processing
analysis
line
result
pixels
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.)
Granted
Application number
JP2013070648A
Other languages
Japanese (ja)
Other versions
JP6111796B2 (en
Inventor
Tomohiko Hasegawa
智彦 長谷川
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.)
Brother Industries Ltd
Original Assignee
Brother Industries Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Brother Industries Ltd filed Critical Brother Industries Ltd
Priority to JP2013070648A priority Critical patent/JP6111796B2/en
Publication of JP2014194659A publication Critical patent/JP2014194659A/en
Application granted granted Critical
Publication of JP6111796B2 publication Critical patent/JP6111796B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

PROBLEM TO BE SOLVED: To reduce image processing time for determination on an object in an image, in executing multiple kinds of analyses.SOLUTION: An image processing apparatus includes: a processing time determination unit which determines processing time for first analysis and processing time for second analysis of multiple analyses to be executed on an object in an image; an analysis processing unit which executes the first analysis prior to the second analysis when the processing time for the first analysis is determined to be less than the processing time for the second analysis, and executes the second analysis prior to the first analysis when the processing time for the first analysis is determined to be equal to or more than the processing time for the second analysis; and an attribute determination unit which determines an attribute of the object on the basis of a result of the processing executed.

Description

本発明は、画像処理技術に関し、特に、処理対象の画像内のオブジェクトに関する判断を実行する画像処理技術に関する。   The present invention relates to an image processing technique, and more particularly to an image processing technique for executing a determination regarding an object in an image to be processed.

特許文献1は、複数種類のアルゴリズムを利用した複数種類の解析処理を画像データに対して実行して、画像内の輪郭線を抽出する技術が開示されている。この技術では、画像処理装置は、複数種類の解析処理の処理結果を用いて、最終的に抽出される輪郭線を決定している。   Japanese Patent Application Laid-Open No. 2005-228561 discloses a technique for executing a plurality of types of analysis processing using a plurality of types of algorithms on image data and extracting a contour line in the image. In this technique, the image processing apparatus determines a contour line to be finally extracted using processing results of a plurality of types of analysis processing.

特開平7−92651号公報JP-A-7-92651

しかしながら、上記技術のように、複数種類の解析処理を用いる場合には、輪郭線を抽出するための処理時間が過大になる可能性があった。このような課題は、輪郭線の抽出に限らず、画像データに対する解析処理によって、画像内のオブジェクトに関する判定を行う際に共通する課題であった。   However, when a plurality of types of analysis processes are used as in the above technique, the processing time for extracting the contour line may be excessive. Such a problem is not limited to the extraction of the contour line, but is a problem common to the determination regarding the object in the image by the analysis processing on the image data.

本発明の目的は、複数種類の解析処理を実行する場合に、画像内のオブジェクトに関する判定を行う画像処理の処理時間を低減することである。   An object of the present invention is to reduce the processing time of image processing for performing determination related to an object in an image when a plurality of types of analysis processing are executed.

本発明は、上述の課題の少なくとも一部を解決するためになされたものであり、以下の適用例として実現することが可能である。   SUMMARY An advantage of some aspects of the invention is to solve at least a part of the problems described above, and the invention can be implemented as the following application examples.

[適用例1]画像処理装置であって、画像データによって表される画像内のオブジェクトを特定する特定部と、前記オブジェクトに対して実行されるべき複数の解析処理のうち、第1の解析処理の処理時間と、第2の解析処理の処理時間と、を判断する処理時間判断部と、前記第1の解析処理の処理時間が、前記第2の解析処理の処理時間未満であると判断される第1の場合に、前記第2の解析処理に先行して前記第1の解析処理を実行し、前記第1の解析処理の処理時間が、前記第2の解析処理の処理時間以上であると判断される第2の場合に、前記第1の解析処理に先行して、前記第2の解析処理を実行する解析処理部であって、前記第1の場合であって、前記第1の解析処理の処理結果が第1の結果である場合には、前記第2の解析処理を実行し、前記第1の解析処理の処理結果が第1の結果と異なる場合には、前記第2の解析処理を実行せず、前記第2の場合であって、前記第2の解析処理の処理結果が第2の結果である場合には、前記第1の解析処理を実行し、前記第2の解析処理の処理結果が第2の結果と異なる場合には、前記第1の解析処理を実行しない、前記解析処理部と、前記複数の解析処理のうち、実行された処理の処理結果に基づいて、前記オブジェクトの属性を判断する属性判断部と、を備える、画像処理装置。 Application Example 1 An image processing apparatus, which is a first analysis process among a plurality of analysis processes to be performed on a specifying unit that specifies an object in an image represented by image data and the object A processing time determination unit that determines the processing time of the second analysis process, and the processing time of the first analysis process is determined to be less than the processing time of the second analysis process. In the first case, the first analysis process is executed prior to the second analysis process, and the processing time of the first analysis process is equal to or longer than the processing time of the second analysis process. An analysis processing unit that executes the second analysis process prior to the first analysis process in the second case, wherein the first case is the first case, When the processing result of the analysis process is the first result, the second analysis process is performed. When the processing result of the first analysis process is different from the first result, the second analysis process is not executed, and the second analysis process is performed. If the processing result is the second result, the first analysis processing is executed. If the processing result of the second analysis processing is different from the second result, the first analysis processing is performed. An image processing apparatus comprising: the analysis processing unit that does not execute the process; and an attribute determination unit that determines an attribute of the object based on a processing result of the executed process among the plurality of analysis processes.

上記構成によれば、第1の解析処理と第2の解析処理のうち、処理時間が短いと判断される処理が先行して実行される。そして、第1の解析処理が先行して実行される場合であって、第1の解析処理の処理結果が第1の結果と異なる場合には、第2の解析処理が実行されない。また、第2の解析処理が先行して実行される場合であって、第2の解析処理の処理結果が第2の結果と異なる場合には、第1の解析処理が実行されない。この結果、第1の解析処理と第2の解析処理のうち、処理時間が長い処理が実行されることなく、オブジェクトの属性を判断できる可能性が高くなる。したがって、オブジェクトの属性を判断するための解析処理の処理時間を低減することができる。   According to the above configuration, the process determined to have a short processing time is executed in advance among the first analysis process and the second analysis process. Then, when the first analysis process is executed in advance and the processing result of the first analysis process is different from the first result, the second analysis process is not executed. In addition, when the second analysis process is executed in advance and the processing result of the second analysis process is different from the second result, the first analysis process is not executed. As a result, there is a high possibility that the attribute of the object can be determined without executing a process having a long processing time out of the first analysis process and the second analysis process. Therefore, it is possible to reduce the processing time of the analysis process for determining the attribute of the object.

[適用例2]適用例1に記載の画像処理装置であって、前記処理時間判断部は、前記第1の解析処理の処理対象である画素の個数に応じた第1の値を用いて、前記第1の解析処理の処理時間を判断し、前記第2の解析処理の処理対象である画素の個数に応じた第2の値を用いて、前記第2の解析処理の処理時間を判断する、画像処理装置。 Application Example 2 In the image processing apparatus according to Application Example 1, the processing time determination unit uses a first value corresponding to the number of pixels that are the processing target of the first analysis process, The processing time of the first analysis processing is determined, and the processing time of the second analysis processing is determined using a second value corresponding to the number of pixels that are the processing target of the second analysis processing. , Image processing device.

この構成によれば、処理対象である画素の個数に応じて、第1の解析処理の処理時間と、第2の解析処理の処理時間と、を適切に判断することができる。   According to this configuration, the processing time of the first analysis processing and the processing time of the second analysis processing can be appropriately determined according to the number of pixels to be processed.

[適用例3]適用例2に記載の画像処理装置であって、前記第1の解析処理は、前記オブジェクトを含む特定領域内の複数個の画素に対する処理を含み、前記第1の値は、前記特定領域内の画素の個数に応じた値であり、前記第2の解析処理は、前記オブジェクトを構成する複数個の画素に対する処理を含み、前記第2の値は、前記オブジェクトを構成する画素の個数に応じた値である、画像処理装置。 Application Example 3 In the image processing apparatus according to Application Example 2, the first analysis process includes a process for a plurality of pixels in a specific region including the object, and the first value is It is a value according to the number of pixels in the specific area, and the second analysis process includes a process for a plurality of pixels constituting the object, and the second value is a pixel constituting the object. An image processing apparatus having a value corresponding to the number of the images.

この構成によれば、第1の解析処理と第2の解析処理の処理内容に応じて、第1の解析処理の処理時間と、第2の解析処理の処理時間を適切に判断できる。   According to this configuration, the processing time of the first analysis processing and the processing time of the second analysis processing can be appropriately determined according to the processing contents of the first analysis processing and the second analysis processing.

[適用例4]適用例1ないし適用例3のいずれかに記載の画像処理装置であって、前記第1の解析処理は、処理対象の1個以上の画素毎に繰り返される第1の単位処理を含み、前記第2の解析処理は、処理対象の1個以上の画素毎に繰り返される第2の単位処理を含み、前記処理時間判断部は、前記第1の単位処理の処理負荷に応じた値を用いて、前記第1の解析処理の処理時間を判断し、前記第2の単位処理の処理負荷に応じた値を用いて、前記第2の解析処理の処理時間を判断する、画像処理装置。 Application Example 4 In the image processing apparatus according to any one of Application Examples 1 to 3, the first analysis process is a first unit process that is repeated for each of one or more pixels to be processed. The second analysis process includes a second unit process that is repeated for each of one or more pixels to be processed, and the processing time determination unit responds to a processing load of the first unit process. Image processing that uses the value to determine the processing time of the first analysis processing, and that uses the value according to the processing load of the second unit processing to determine the processing time of the second analysis processing apparatus.

この構成によれば、単位処理の処理負荷に応じて、第1の解析処理の処理時間と、第2の解析処理の処理時間と、を適切に判断することができる。   According to this configuration, it is possible to appropriately determine the processing time of the first analysis process and the processing time of the second analysis process in accordance with the processing load of the unit process.

[適用例5]適用例1ないし適用例4のいずれかに記載の画像処理装置であって、前記属性判断部は、前記複数の解析処理のうち、実行された処理の処理結果に基づいて、前記オブジェクトが、画像内の一部の領域を囲む囲み線であるか否かを判断する、画像処理装置。 Application Example 5 In the image processing apparatus according to any one of Application Example 1 to Application Example 4, the attribute determination unit is configured based on a processing result of an executed process among the plurality of analysis processes. An image processing apparatus that determines whether or not the object is a surrounding line surrounding a partial area in an image.

この構成によれば、オブジェクトが、画像内の一部の領域を囲む囲み線であるか否かを判断するための解析処理の処理時間を低減することができる。   According to this configuration, it is possible to reduce the processing time of the analysis processing for determining whether or not the object is a surrounding line surrounding a partial area in the image.

[適用例6]適用例5に記載の画像処理装置であって、前記第1の解析処理は、前記オブジェクトが線であるか否かを解析する処理であり、前記第1の解析処理の前記第1の結果は、前記オブジェクトが線であることを示す第1の条件を満たすことであり、前記属性判断部は、前記第1の解析処理の結果が前記第1の条件を満たさない場合には、前記第2の解析処理とは無関係に、前記オブジェクトが前記囲み線ではないと判断する、画像処理装置。 Application Example 6 In the image processing device according to Application Example 5, the first analysis process is a process of analyzing whether or not the object is a line, and the first analysis process includes the first analysis process. The first result is that the first condition indicating that the object is a line is satisfied, and the attribute determination unit determines that the result of the first analysis process does not satisfy the first condition. Is an image processing apparatus that determines that the object is not the surrounding line regardless of the second analysis processing.

この構成によれば、第1の解析処理が第2の解析処理に先行して実行された場合であって、第1の解析処理の結果が第1の条件を満たさない場合には、第2の解析処理を行うことなく、オブジェクトが囲み線ではないと判断できる。この結果、オブジェクトが囲み線であるか否かを判断するための解析処理の処理時間を低減することができる。   According to this configuration, when the first analysis process is executed prior to the second analysis process, and the result of the first analysis process does not satisfy the first condition, the second analysis process is performed. It is possible to determine that the object is not a surrounding line without performing the analysis process. As a result, it is possible to reduce the processing time of the analysis processing for determining whether or not the object is a surrounding line.

[適用例7]適用例6に記載の画像処理装置であって、前記第1の解析処理は、前記特定領域内の第1の方向に延びる複数の直線上において、前記オブジェクトを構成する画素の分布を解析する処理を含み、前記第1の条件は、前記オブジェクトを構成する画素が前記第1の方向に連続する個数が基準以下であることを含む、画像処理装置。 Application Example 7 In the image processing apparatus according to Application Example 6, in the first analysis process, the pixels constituting the object are arranged on a plurality of straight lines extending in the first direction in the specific area. The image processing apparatus includes a process of analyzing a distribution, and the first condition includes that a number of pixels constituting the object that are continuous in the first direction is equal to or less than a reference.

この構成によれば、第1の方向に延びる複数の直線上におけるオブジェクトを構成する画素の分布に基づいて、オブジェクトが線であるか否かを解析する。この結果、オブジェクトが線であるか否かを適切に判断することができる。   According to this configuration, whether or not the object is a line is analyzed based on the distribution of the pixels constituting the object on a plurality of straight lines extending in the first direction. As a result, it can be appropriately determined whether or not the object is a line.

[適用例8]適用例7に記載の画像処理装置であって、前記第1の解析処理は、さらに、前記特定領域内の前記第1の方向と交差する第2の方向に延びる複数の直線上において、前記オブジェクトを構成する画素の分布を解析する処理とを含み、前記第1の条件は、前記オブジェクトを構成する画素が前記第1の方向に連続する個数が基準以下であり、かつ、前記オブジェクトを構成する画素が前記第2の方向に連続する個数が基準以下であることを含む、画像処理装置。 Application Example 8 In the image processing apparatus according to Application Example 7, in the first analysis process, a plurality of straight lines extending in a second direction intersecting the first direction in the specific region is further included. The first condition is that the number of pixels constituting the object continuing in the first direction is not more than a reference, and An image processing apparatus comprising: a number of pixels constituting the object continuing in the second direction being equal to or less than a reference.

この構成によれば、第1の方向に延びる複数の直線上と、第2の方向に延びる複数の直線上と、におけるオブジェクトを構成する画素の分布に基づいて、オブジェクトが線であるか否かを解析する。この結果、オブジェクトが線であるか否かを適切に判断することができる。   According to this configuration, whether or not the object is a line based on the distribution of the pixels constituting the object on the plurality of straight lines extending in the first direction and on the plurality of straight lines extending in the second direction. Is analyzed. As a result, it can be appropriately determined whether or not the object is a line.

[適用例9]適用例5ないし適用例7のいずれかに記載の画像処理装置であって、前記第2の解析処理は、前記オブジェクトが画像内の一部の領域を囲む形状を成すか否かを解析する処理であり、前記第2の解析処理の前記第2の結果は、前記オブジェクトが画像内の一部の領域を囲む形状を成すことを示す第2の条件を満たすことであり、前記属性判断部は、前記第2の解析処理の結果が前記第2の条件を満たさない場合には、前記第1の解析処理とは無関係に、前記オブジェクトが前記囲み線ではないと判断する、画像処理装置。 Application Example 9 In the image processing device according to any one of Application Examples 5 to 7, the second analysis process determines whether or not the object forms a shape surrounding a partial region in the image. And the second result of the second analysis process is to satisfy a second condition indicating that the object forms a shape surrounding a partial region in the image, The attribute determination unit determines that the object is not the surrounding line regardless of the first analysis process when the result of the second analysis process does not satisfy the second condition. Image processing device.

この構成によれば、第2の解析処理が第1の解析処理に先行して実行された場合であって、第2の解析処理の結果が第2の条件を満たさない場合には、第2の解析処理を行うことなく、オブジェクトが囲み線ではないと判断できる。この結果、オブジェクトが囲み線であるか否かを判断するための解析処理の処理時間を低減することができる。   According to this configuration, when the second analysis process is executed prior to the first analysis process, and the result of the second analysis process does not satisfy the second condition, the second analysis process is performed. It is possible to determine that the object is not a surrounding line without performing the analysis process. As a result, it is possible to reduce the processing time of the analysis processing for determining whether or not the object is a surrounding line.

[適用例10]適用例9に記載の画像処理装置であって、前記第2の解析処理は、前記オブジェクトを構成する複数個の特定画素のそれぞれに対応する複数個の枠領域を設定する設定処理であって、前記枠領域は、対応する特定画素が、前記枠領域と、前記枠領域の内側とのいずれかの位置に含まれる枠状の領域である、前記設定処理と、前記複数個の枠領域のそれぞれについて、前記枠領域に含まれるオブジェクト部分領域の個数を判断する第1の判断処理であって、前記オブジェクト部分領域は、前記オブジェクトを構成する1個以上の前記特定画素が連続して並ぶ領域である、前記第1の判断処理と、前記オブジェクトを構成する複数個の前記特定画素に対する第1の特定画素の割合が基準以上であるか否かを判断する第2の判断処理であって、第1の特定画素は、前記オブジェクトを構成する複数個の前記特定画素のうち、対応する前記枠領域に含まれる前記前記オブジェクト部分領域の個数が2個である前記特定画素である、前記第2の判断処理と、を含み、前記第2の条件は、前記第1の特定画素の割合が基準以上であることを含む、画像処理装置。 Application Example 10 In the image processing apparatus according to Application Example 9, in the second analysis process, a plurality of frame areas corresponding to each of a plurality of specific pixels constituting the object are set. The frame region is a frame-shaped region in which the corresponding specific pixel is included in any position between the frame region and the inside of the frame region; 1 is a first determination process for determining the number of object partial areas included in the frame area for each of the frame areas, wherein the object partial area is continuous with one or more specific pixels constituting the object. A first determination process, and a second determination process for determining whether a ratio of the first specific pixel to a plurality of the specific pixels constituting the object is equal to or higher than a reference. The first specific pixel is the specific pixel in which the number of the object partial areas included in the corresponding frame area is two of the plurality of specific pixels constituting the object. And a second determination process, wherein the second condition includes a ratio of the first specific pixel being equal to or higher than a reference.

この構成によれば、オブジェクトを構成する複数個の特定画素のそれぞれに設定される枠領域を用いて、オブジェクトが画像内の一部の領域を囲むか否かを解析する。この結果、オブジェクトが画像内の一部の領域を囲むか否かを適切に判断することができる。   According to this configuration, it is analyzed whether or not the object surrounds a part of the region in the image using the frame region set for each of the plurality of specific pixels constituting the object. As a result, it is possible to appropriately determine whether or not the object surrounds a partial area in the image.

[適用例11]適用例9に記載の画像処理装置であって、前記第2の解析処理は、さらに、第2の特定画素に基づく条件が満たされるか否かを判断する第3の判断処理であって、前記第2の特定画素は、前記オブジェクトを構成する複数個の前記特定画素のうち、対応する前記枠領域に含まれる前記オブジェクト部分領域の個数がM個(Mは、1、3、4、5のうちのいずれかの整数)である前記特定画素である、前記第3の判断処理を含み、前記第2の条件は、前記第2の特定画素に基づく条件を含む、画像処理装置。 Application Example 11 In the image processing device according to Application Example 9, the second analysis process further includes a third determination process for determining whether or not a condition based on a second specific pixel is satisfied. In the second specific pixel, of the plurality of specific pixels constituting the object, the number of the object partial regions included in the corresponding frame region is M (M is 1, 3). Image processing, including the third determination process that is the specific pixel that is an integer of any one of 4, 5 and 5, wherein the second condition includes a condition based on the second specific pixel apparatus.

上記構成によれば、第2の特定画素に基づく条件を用いて、オブジェクトが画像内の一部の領域を囲むか否か解析する。この結果、オブジェクトが画像内の一部の領域を囲むか否かを適切に判断することができる。   According to the above configuration, the condition based on the second specific pixel is used to analyze whether or not the object surrounds a partial region in the image. As a result, it is possible to appropriately determine whether or not the object surrounds a partial area in the image.

なお、本発明は、種々の形態で実現することが可能であり、例えば、画像処理方法、これらの装置の機能または方法を実現するためのコンピュータプログラム、そのコンピュータプログラムを記録した記録媒体、等の形態で実現することができる。   The present invention can be realized in various forms, such as an image processing method, a computer program for realizing the functions or methods of these apparatuses, a recording medium on which the computer program is recorded, and the like. It can be realized in the form.

第1実施例における画像処理システムの構成を示すブロック図である。It is a block diagram which shows the structure of the image processing system in 1st Example. 画像処理システム1000の動作を示すフローチャートである。5 is a flowchart showing the operation of the image processing system 1000. 原稿および画像の一例を示す図である。It is a figure which shows an example of a manuscript and an image. 収縮処理と膨張処理を説明する図である。It is a figure explaining a contraction process and an expansion process. オブジェクト判定処理のフローチャートである。It is a flowchart of an object determination process. 線判定処理の説明図である。It is explanatory drawing of a line determination process. 形状判定処理のフローチャートである。It is a flowchart of a shape determination process. 形状判定処理の第1の説明図である。It is the 1st explanatory view of shape judging processing. 形状判定処理の第2の説明図である。It is the 2nd explanatory view of shape judging processing. 特定領域ESを用いる判定について説明する図である。It is a figure explaining determination using specific field ES. 処理順序決定処理のフローチャートである。It is a flowchart of a process order determination process. 部分画像PSIの一例と部分二値画像PBIの一例を示す図である。It is a figure which shows an example of the partial image PSI, and an example of the partial binary image PBI. 内包関係判定処理のフローチャートである。It is a flowchart of an inclusion relation determination process.

A.第1実施例:
A−1:画像処理システム1000の構成
図1は、第1実施例における画像処理システムの構成を示すブロック図である。画像処理システム1000は、画像処理装置としてのサーバ400と、複合機200と、を備えている。サーバ400は、インターネット70に接続されており、複合機200は、LAN(Local Area Network)50を介して、インターネット70に接続されている。この結果、サーバ400と複合機200は、LAN50とインターネット70とを介して、通信可能である。また、LAN50には、複合機200の利用者のパーソナルコンピュータ500が接続されていても良い。
A. First embodiment:
A-1: Configuration of Image Processing System 1000 FIG. 1 is a block diagram showing the configuration of the image processing system in the first embodiment. The image processing system 1000 includes a server 400 as an image processing apparatus and a multifunction device 200. The server 400 is connected to the Internet 70, and the multi-function device 200 is connected to the Internet 70 via a LAN (Local Area Network) 50. As a result, the server 400 and the multifunction device 200 can communicate with each other via the LAN 50 and the Internet 70. Further, the personal computer 500 of the user of the multifunction device 200 may be connected to the LAN 50.

サーバ400は、CPU410と、DRAMなどの揮発性記憶装置420と、ハードディスクドライブやフラッシュメモリなどの不揮発性記憶装置430と、インターネット70などのネットワークに接続するためのインタフェースを含む通信部480と、を備えている。揮発性記憶装置420には、CPU410が処理を行う際に生成される種々の中間データを一時的に格納するバッファ領域421が設けられている。不揮発性記憶装置430には、後述する画像処理をCPU410に実現させるコンピュータプログラム431が格納されている。コンピュータプログラム431は、DVD−ROMなどに記録された形態で提供され得る。   The server 400 includes a CPU 410, a volatile storage device 420 such as a DRAM, a nonvolatile storage device 430 such as a hard disk drive or a flash memory, and a communication unit 480 including an interface for connecting to a network such as the Internet 70. I have. The volatile storage device 420 is provided with a buffer area 421 for temporarily storing various intermediate data generated when the CPU 410 performs processing. The nonvolatile storage device 430 stores a computer program 431 that causes the CPU 410 to perform image processing to be described later. The computer program 431 can be provided in a form recorded on a DVD-ROM or the like.

CPU410は、コンピュータプログラム431を実行することにより、画像処理部300として機能する。画像処理部300は、処理対象の画像データ(対象画像データとも呼ぶ)を取得する画像データ取得部310と、対象画像データによって表される対象画像内のオブジェクトを特定するオブジェクト特定部320と、処理時間判断部330と、解析処理部350と、属性判断部360と、囲み線に囲まれたオブジェクトを除去する処理を実行する除去処理部370と、を備えている。解析処理部350は、オブジェクトに対して複数の解析処理を実行可能である。具体的には、解析処理部350は、オブジェクトが単色であるか否かを判定する色判定部351と、オブジェクトが線であるか否かを判定する線判定部352と、オブジェクトが、領域を囲む形状を有しているか否かを判定する形状判定部353と、を備えている。処理時間判断部330は、オブジェクトに対して実行されるべき複数の解析処理のうちの特定の処理の処理時間を判断する。属性判断部360は、複数の解析処理のうち、実行された処理の処理結果に基づいて、オブジェクトの属性、具体的には、オブジェクトが囲み線であるか否かを判断する。ここで、囲み線は、後述するように、対象画像内の一部の領域、例えば、他のオブジェクトを示す領域や、オブジェクトが含まれない背景領域を囲む線である。例えば、囲み線は、赤色のペンなどにより原稿上に形成され、この原稿を読み取ることによって得られる画像データ(スキャンデータ)によって表される画像上に現れる。これらの各機能部が行う具体的な画像処理については、後述する。   The CPU 410 functions as the image processing unit 300 by executing the computer program 431. The image processing unit 300 includes an image data acquisition unit 310 that acquires image data to be processed (also referred to as target image data), an object specification unit 320 that specifies an object in the target image represented by the target image data, and a processing It includes a time determination unit 330, an analysis processing unit 350, an attribute determination unit 360, and a removal processing unit 370 that executes a process of removing an object surrounded by a surrounding line. The analysis processing unit 350 can execute a plurality of analysis processes on the object. Specifically, the analysis processing unit 350 includes a color determination unit 351 that determines whether or not the object is a single color, a line determination unit 352 that determines whether or not the object is a line, A shape determination unit 353 that determines whether or not the shape has an enclosing shape. The processing time determination unit 330 determines the processing time of a specific process among a plurality of analysis processes to be executed on the object. The attribute determination unit 360 determines the attribute of the object, specifically, whether or not the object is a surrounding line, based on the processing result of the executed process among the plurality of analysis processes. Here, as described later, the encircling line is a line enclosing a partial area in the target image, for example, an area indicating another object or a background area not including the object. For example, the surrounding line is formed on an original with a red pen or the like, and appears on an image represented by image data (scan data) obtained by reading the original. Specific image processing performed by each of these functional units will be described later.

複合機200は、CPU210と、DRAMなどの揮発性記憶装置220と、フラッシュメモリやハードディスクドライブなどの不揮発性記憶装置230と、プリンタ部240と、スキャナ部250と、タッチパネルやボタンなどの操作部260と、液晶ディスプレイなどの表示部270と、LAN50などのネットワークに接続するためのインタフェースを含む通信部280と、を備えている。   The MFP 200 includes a CPU 210, a volatile storage device 220 such as a DRAM, a nonvolatile storage device 230 such as a flash memory and a hard disk drive, a printer unit 240, a scanner unit 250, and an operation unit 260 such as a touch panel and buttons. And a display unit 270 such as a liquid crystal display, and a communication unit 280 including an interface for connecting to a network such as the LAN 50.

揮発性記憶装置220には、CPU210が処理を行う際に生成される種々のデータを一時的に格納するバッファ領域221が設けられている。不揮発性記憶装置230には、制御プログラム231が格納されている。   The volatile storage device 220 is provided with a buffer area 221 for temporarily storing various data generated when the CPU 210 performs processing. A control program 231 is stored in the non-volatile storage device 230.

プリンタ部240は、インクジェット方式やレーザー方式などの印刷方式を用いて印刷を実行する。スキャナ部250は、光電変換素子(例えば、CCD、CMOS)を用いて原稿を読み取ることによってスキャンデータを生成する取得する。スキャンデータは、RGB画素データによって構成されたビットマップデータ(RGB画像データ)である。RGB画素データは、レッド(R)、グリーン(G)、ブルー(B)の3つの色成分の色成分値(本実施例の各色成分値は、256階調の階調値)を含む画素データである。以下では、色成分のうち、レッド成分をR成分とも呼び、グリーン成分をG成分とも呼び、ブルー成分をB成分とも呼ぶ。   The printer unit 240 executes printing using a printing method such as an inkjet method or a laser method. The scanner unit 250 obtains scan data by reading a document using a photoelectric conversion element (for example, CCD, CMOS). The scan data is bitmap data (RGB image data) composed of RGB pixel data. The RGB pixel data is pixel data including color component values of three color components of red (R), green (G), and blue (B) (each color component value in this embodiment is a gradation value of 256 gradations). It is. Hereinafter, among the color components, the red component is also referred to as R component, the green component is also referred to as G component, and the blue component is also referred to as B component.

CPU210は、制御プログラム231を実行することにより、通信制御部110と、装置制御部120と、として機能する。装置制御部120は、例えば、プリンタ部240やスキャナ部250を制御して、コピー処理、印刷処理、スキャン処理などを実行する。通信制御部110は、外部機器との通信を制御する機能部であり、具体的には、後述する画像処理において、サーバ400との間で、画像データの送受信を行う画像データ送受信部115を備えている。   The CPU 210 functions as the communication control unit 110 and the device control unit 120 by executing the control program 231. For example, the apparatus control unit 120 controls the printer unit 240 and the scanner unit 250 to execute copy processing, printing processing, scanning processing, and the like. The communication control unit 110 is a functional unit that controls communication with an external device. Specifically, the communication control unit 110 includes an image data transmission / reception unit 115 that transmits / receives image data to / from the server 400 in image processing to be described later. ing.

A−1:画像処理システム1000の動作
サーバ400の画像処理部300は、処理対象の画像データ(対象画像データとも呼ぶ)に対して画像処理を実行して、処理済みの画像データを生成する。この画像処理を含む画像処理システム1000の動作について説明する。
A-1: Operation of Image Processing System 1000 The image processing unit 300 of the server 400 performs image processing on image data to be processed (also referred to as target image data), and generates processed image data. The operation of the image processing system 1000 including this image processing will be described.

図2は、画像処理システム1000の動作を示すフローチャートである。このフローチャートの処理は、複合機200が、特定の動作モードの指定と、原稿SCの読取指示を、利用者から受け付けた場合に実行される。この特定の動作モードは、原稿SCから、囲み線に囲まれた特定のオブジェクトを除いた画像を表す画像データを生成するモードであり、特定オブジェクト除去モードとも呼ぶ。   FIG. 2 is a flowchart showing the operation of the image processing system 1000. The processing of this flowchart is executed when the multifunction device 200 receives a specific operation mode designation and an instruction to read the document SC from the user. This specific operation mode is a mode for generating image data representing an image obtained by removing a specific object surrounded by a surrounding line from the document SC, and is also referred to as a specific object removal mode.

処理が開始されると、ステップS105では、複合機200の装置制御部120(図1)は、スキャナ部250を用いて原稿SCを読み取ることによって、スキャンデータを生成する。   When the processing is started, in step S105, the apparatus control unit 120 (FIG. 1) of the multifunction device 200 reads the document SC using the scanner unit 250, thereby generating scan data.

図3は、原稿および画像の一例を示す図である。図3(A)には、スキャンデータによって表されるスキャン画像60の一例が示されている。スキャン画像60は、原稿SCを表す画像であるから、図3(A)は、原稿SCの一例を示す図と言うこともできる。   FIG. 3 is a diagram illustrating an example of a document and an image. FIG. 3A shows an example of a scan image 60 represented by scan data. Since the scan image 60 is an image representing the document SC, FIG. 3A can also be referred to as a diagram illustrating an example of the document SC.

スキャン画像60(原稿SC)は、オブジェクトとして、4個の文字61〜64と、2個の描画65、67と、1個の写真68と、囲み線66と、を含んでいる。描画は、例えば、イラスト、表、グラフ、線図、ベクトルグラフィックス、模様などを表すオブジェクトである。囲み線66は、オブジェクト除去モードで使用すべき囲み線の色として予め指定された色(本実施例では、赤)のペンを用いて、利用者によって原稿SCに手書きされたオブジェクトである。利用者は、除去対象のオブジェクトを囲む囲み線を原稿SCに手書きする。図3(A)の例では、囲み線66は、描画65を囲んでいる。なお、3個の文字61〜63は、赤色の文字であり、1個の文字64は、赤色ではない文字である。描画65は、赤色の部分を含んでおらず、描画67と写真68は、赤色の部分を含んでいる。   The scanned image 60 (original SC) includes four characters 61 to 64, two drawings 65 and 67, one photograph 68, and a surrounding line 66 as objects. Drawing is, for example, an object representing an illustration, a table, a graph, a diagram, vector graphics, a pattern, or the like. The surrounding line 66 is an object handwritten on the document SC by the user using a pen of a color (in this embodiment, red) designated in advance as the color of the surrounding line to be used in the object removal mode. The user manually draws a surrounding line surrounding the object to be removed on the document SC. In the example of FIG. 3A, the surrounding line 66 surrounds the drawing 65. The three characters 61 to 63 are red characters, and the one character 64 is a character that is not red. The drawing 65 does not include a red portion, and the drawing 67 and the photograph 68 include a red portion.

続いて、ステップS110では、サーバ400の画像データ送受信部115は、スキャンデータを、サーバ400に対して送信する。例えば、スキャンデータは、JPEG圧縮されて、サーバ400に送信される。この結果、サーバ400の画像処理部300の画像データ取得部310は、対象画像データとして、複合機200からスキャンデータを取得する。   Subsequently, in step S <b> 110, the image data transmission / reception unit 115 of the server 400 transmits scan data to the server 400. For example, the scan data is JPEG compressed and transmitted to the server 400. As a result, the image data acquisition unit 310 of the image processing unit 300 of the server 400 acquires scan data from the multifunction device 200 as target image data.

スキャンデータが取得されると、画像処理部300は、スキャン画像60内の囲み線を特定するための一連の処理を実行する(ステップS120〜S145)。   When the scan data is acquired, the image processing unit 300 executes a series of processes for specifying a surrounding line in the scan image 60 (steps S120 to S145).

先ず、ステップS120では、オブジェクト特定部320は、囲み線の候補となるオブジェクトを特定するために、スキャンデータに対して二値化処理を実行して、二値画像データを生成する。具体的には、スキャンデータは、スキャン囲み線の色である赤色を表す色値を有する画素(赤色オブジェクト画素)と、赤色以外の色を表す色値を有する画素(非赤色画素)と、に二値化される。例えば、R成分値が基準値Rth以上、かつ、G成分値が基準値Gth以下、かつ、B成分値が基準値Bth以下である画素は、赤色オブジェクト画素に分類される。そして、R成分値が基準値Rthより大きい、または、G成分値が基準値Gth未満、または、B成分値が基準値Bth未満である画素は、非赤色画素に分類される。なお、本実施例では、囲み線の色として赤色が想定されているので、本ステップにおいて、赤色オブジェクトが特定されているが、他の色が想定されている場合には、本ステップにおいて、当該他の色を含む範囲の色を有するオブジェクトが特定される。   First, in step S120, the object specifying unit 320 executes binarization processing on the scan data to generate binary image data in order to specify an object that is a candidate for a surrounding line. Specifically, the scan data is divided into a pixel having a color value representing red, which is the color of the scan surrounding line (red object pixel), and a pixel having a color value representing a color other than red (non-red pixel). Binarized. For example, a pixel whose R component value is equal to or greater than the reference value Rth, G component value is equal to or less than the reference value Gth, and B component value is equal to or less than the reference value Bth is classified as a red object pixel. A pixel having an R component value greater than the reference value Rth, a G component value less than the reference value Gth, or a B component value less than the reference value Bth is classified as a non-red pixel. In the present embodiment, since red is assumed as the color of the surrounding line, a red object is specified in this step. However, if another color is assumed, in this step An object having a range of colors including other colors is identified.

図3(B)は、二値画像データによって表される二値画像60Aの一例を示す図である。二値画像60Aには、赤色オブジェクト画素によって構成される赤色オブジェクトとして、3個の文字61A〜63Aと、囲み線66Aと、描画67および写真68(図3(A))の一部分である部分オブジェクト67A、68Aと、が含まれている。なお、文字64および描画65(図3(A))は、赤色ではないので、二値画像60Aにおいて、赤色オブジェクトとして現れていない。   FIG. 3B is a diagram illustrating an example of a binary image 60A represented by binary image data. In the binary image 60A, as a red object composed of red object pixels, three characters 61A to 63A, a surrounding line 66A, a drawing 67 and a partial object which is a part of a photograph 68 (FIG. 3A). 67A and 68A. Since the character 64 and the drawing 65 (FIG. 3A) are not red, they do not appear as red objects in the binary image 60A.

ステップS125では、オブジェクト特定部320は、赤色オブジェクトを収縮させる収縮処理と、赤色オブジェクトを膨張させる膨張処理とを、二値画像データに対してそれぞれ実行する。本実施例では、収縮処理が先に実行され、収縮処理済みの二値画像データ(収縮二値画像データ)に対して膨張処理が実行される。   In step S125, the object specifying unit 320 performs a contraction process for contracting the red object and an expansion process for expanding the red object on the binary image data. In this embodiment, the contraction process is executed first, and the expansion process is executed on the binary image data that has been subjected to the contraction process (contracted binary image data).

図4は、収縮処理と膨張処理を説明する図である。図4(A)には、二値画像60A(図3(B))の部分画像PI1が示されている。部分画像PI1は、収縮処理前の赤色オブジェクトの例としての囲み線66Aの一部と、ノイズ画素DTを含んでいる。ノイズ画素DTは、孤立した画素である。この孤立したノイズ画素DTは、スキャン画像60内のノイズによって二値画像60Aに現れた赤色オブジェクト画素であり、特定すべき赤色オブジェクトを構成していない。また、囲み線66Aは、断線した部分(断線部)NTを含む場合がある。例えば、スキャン画像60内の囲み線66に、比較的色が薄い部分がある場合や、比較的線の幅が狭い部分がある場合などに、二値画像60A内の囲み線66Aに、断線部NTが表れる場合がある。   FIG. 4 is a diagram illustrating the contraction process and the expansion process. FIG. 4A shows a partial image PI1 of the binary image 60A (FIG. 3B). The partial image PI1 includes a part of an encircling line 66A as an example of a red object before the contraction process, and a noise pixel DT. The noise pixel DT is an isolated pixel. The isolated noise pixel DT is a red object pixel that appears in the binary image 60A due to noise in the scan image 60, and does not constitute a red object to be specified. Further, the surrounding line 66A may include a disconnected portion (disconnected portion) NT. For example, when the surrounding line 66 in the scan image 60 has a relatively light color part or a part having a relatively narrow line width, the broken line part is shown in the surrounding line 66A in the binary image 60A. NT may appear.

収縮処理は、例えば、所定サイズのフィルタ、図4(A)の例では、縦3画素×横3画素のサイズのフィルタFI1を用いて実行される。具体的には、オブジェクト特定部320は、フィルタFI1を、二値画像60Aを表す二値画像データに対して適用して、収縮二値画像データを生成する。すなわち、オブジェクト特定部320は、注目画素に、フィルタFI1の中心位置CC1(図4(A)参照)が重なるように、フィルタFI1を二値画像60A上に配置する。オブジェクト特定部320は、フィルタFI1の範囲内に、非赤色画素が1個でも存在する場合には、注目画素に対応する収縮二値画像内の画素を非赤色画素に設定する。そして、オブジェクト特定部320は、フィルタFI1の範囲内に、非赤色画素がない場合、すなわち、フィルタFI1の範囲内の9個の画素が、全て赤色オブジェクト画素であるには、注目画素に対応する収縮二値画内の画素を赤色オブジェクト画素に設定する。オブジェクト特定部320は、二値画像60Aの全ての画素を注目画素として、収縮二値画像内の対応する画素を、非赤色画素および赤色オブジェクト画素のいずれかに設定することによって、収縮二値画像を表す収縮二値画像データを生成する。この説明から解るように、赤色オブジェクトを収縮させる収縮処理は、非赤色オブジェクトによって構成される領域(主として背景領域)を膨張させる処理と言うこともできる。   The contraction process is executed using, for example, a filter having a predetermined size, and in the example of FIG. 4A, a filter FI1 having a size of 3 vertical pixels × 3 horizontal pixels. Specifically, the object specifying unit 320 applies the filter FI1 to the binary image data representing the binary image 60A to generate contracted binary image data. That is, the object specifying unit 320 arranges the filter FI1 on the binary image 60A so that the center position CC1 (see FIG. 4A) of the filter FI1 overlaps the target pixel. If at least one non-red pixel exists within the range of the filter FI1, the object specifying unit 320 sets a pixel in the contracted binary image corresponding to the target pixel as a non-red pixel. Then, the object specifying unit 320 corresponds to the target pixel when there is no non-red pixel within the range of the filter FI1, that is, when all the nine pixels within the range of the filter FI1 are red object pixels. A pixel in the contracted binary image is set as a red object pixel. The object specifying unit 320 sets all the pixels of the binary image 60A as the target pixel, and sets the corresponding pixel in the contracted binary image as one of the non-red pixel and the red object pixel, whereby the contracted binary image Shrinkage binary image data representing is generated. As can be understood from this description, the contraction process for contracting a red object can be said to be a process for expanding a region (mainly a background region) constituted by non-red objects.

図4(B)には、収縮二値画像のうちの、図4(A)の部分画像PI1に対応する収縮部分画像PI2が示されている。収縮部分画像PI2には、ノイズ画素DTが現れていないことから解るように、収縮処理によって、ノイズ画素DTのような孤立した赤色オブジェクト画素を消去することができる。また、収縮部分画像PI2では、赤色オブジェクト、例えば、囲み線66Aが、部分画像PI1の囲み線66Aと比較して、細くなっている(収縮している)。また、収縮部分画像PI2では、囲み線66Aの断線部NTが、部分画像PI1の囲み線66Aの断線部NTと比較して、大きくなっている。   FIG. 4B shows a contracted partial image PI2 corresponding to the partial image PI1 in FIG. 4A among the contracted binary images. As understood from the fact that the noise pixel DT does not appear in the contracted partial image PI2, an isolated red object pixel such as the noise pixel DT can be erased by the contraction process. In the contracted partial image PI2, the red object, for example, the surrounding line 66A is thinner (contracted) than the surrounding line 66A of the partial image PI1. In the contracted partial image PI2, the disconnection portion NT of the surrounding line 66A is larger than the disconnection portion NT of the surrounding line 66A of the partial image PI1.

続く膨張処理は、例えば、所定サイズのフィルタ、図4(B)の例では、縦5画素×横5画素のサイズのフィルタFI2を用いて実行される。具体的には、オブジェクト特定部320は、フィルタFI2を、収縮二値画像を表す収縮二値画像データに対して適用して、膨張二値画像データを生成する。すなわち、オブジェクト特定部320は、注目画素に、フィルタFI2の中心位置CC2(図4(B)参照)が重なるように、フィルタFI2を収縮二値画像上に配置する。オブジェクト特定部320は、フィルタFI2の範囲内に、赤色オブジェクト画素が1個でも存在する場合には、注目画素に対応する膨張二値画像内の画素を赤色オブジェクト画素に設定する。そして、オブジェクト特定部320は、フィルタFI2の範囲内に、赤色オブジェクト画素がない場合、すなわち、フィルタFI2の範囲内の25個の画素が、全て非赤色画素であるには、注目画素に対応する膨張二値画内の画素を非赤色画素に設定する。オブジェクト特定部320は、収縮二値画像の全ての画素を注目画素として、膨張二値画像内の対応する画素を、非赤色画素および赤色オブジェクト画素のいずれかに設定することによって、膨張二値画像を表す膨張二値画像データを生成する。   The subsequent expansion process is executed using, for example, a filter having a predetermined size, and in the example of FIG. 4B, a filter FI2 having a size of 5 pixels vertically × 5 pixels horizontally. Specifically, the object specifying unit 320 applies the filter FI2 to the contracted binary image data representing the contracted binary image to generate expanded binary image data. That is, the object specifying unit 320 arranges the filter FI2 on the contracted binary image so that the center position CC2 (see FIG. 4B) of the filter FI2 overlaps the target pixel. When at least one red object pixel exists within the range of the filter FI2, the object specifying unit 320 sets a pixel in the expanded binary image corresponding to the target pixel as a red object pixel. Then, when there is no red object pixel in the range of the filter FI2, that is, the 25 pixels in the range of the filter FI2 are all non-red pixels, the object specifying unit 320 corresponds to the target pixel. Pixels in the expanded binary image are set to non-red pixels. The object specifying unit 320 sets all the pixels of the contracted binary image as the target pixel, and sets the corresponding pixel in the expanded binary image to one of the non-red pixel and the red object pixel, so that the expanded binary image Inflated binary image data is generated.

図4(C)には、膨張二値画像のうちの、図4(A)、(B)の部分画像PI1、PI2に対応する膨張部分画像PI3が示されている。膨張部分画像PI3の囲み線66Aには、断線部NTが現れていないことから解るように、膨張処理によって、囲み線66Aに現れ得る断線部NTを接続することができる。膨張部分画像PI3では、赤色オブジェクト、例えば、囲み線66Aが、部分画像PI1の囲み線66Aと比較して、太くなっている(膨張している)。   FIG. 4C shows an expanded partial image PI3 corresponding to the partial images PI1 and PI2 in FIGS. 4A and 4B of the expanded binary image. As can be understood from the fact that the disconnection portion NT does not appear in the surrounding line 66A of the inflated partial image PI3, the disconnection portion NT that can appear in the surrounding line 66A can be connected by the expansion process. In the expanded partial image PI3, a red object, for example, a surrounding line 66A is thicker (expanded) than the surrounding line 66A of the partial image PI1.

なお、上述したフィルタFI1、FI2のサイズ、すなわち、収縮処理による収縮の程度、および、膨張処理による膨張の程度は、一例である。ただし、収縮処理を先に実行し、膨張処理を後に実行する場合には、膨張処理による膨張の程度(フィルタFI2のサイズに対応する)は、収縮処理による収縮の程度(フィルタFI1のサイズに対応する)より大きいことが好ましい。こうすれば、断線部NTの接続を適切に実現することができる。仮に、収縮処理を先に実行し、膨張処理を後に実行する場合に、膨張処理による膨張の程度が、収縮処理による収縮の程度以下であると、収縮処理によって拡大した断線部NTが膨張処理によって接続されない可能性がある。   Note that the sizes of the filters FI1 and FI2 described above, that is, the degree of contraction by the contraction process and the degree of expansion by the expansion process are examples. However, when the contraction process is performed first and the expansion process is performed later, the degree of expansion by the expansion process (corresponding to the size of the filter FI2) is the degree of contraction by the contraction process (corresponding to the size of the filter FI1). Larger). If it carries out like this, the connection of the disconnection part NT can be implement | achieved appropriately. If the contraction process is executed first and the expansion process is executed later, if the degree of expansion by the expansion process is equal to or less than the degree of contraction by the contraction process, the disconnection portion NT expanded by the contraction process is caused by the expansion process. It may not be connected.

また、上記実施例とは逆に、膨張処理を先に実行し、収縮処理を後に実行する場合には、膨張処理による膨張の程度は、収縮処理による収縮の程度より小さいことが好ましい。こうすれば、ノイズ画素DTを適切に消去することができる。仮に、膨張処理を先に実行し、収縮処理を後に実行する場合に、膨張処理による膨張の程度が、収縮処理による収縮の程度以上であると、膨張処理によって拡大したノイズ画素DTが収縮処理によって消去されない可能性がある。   In contrast to the above embodiment, when the expansion process is executed first and the contraction process is executed later, the degree of expansion by the expansion process is preferably smaller than the degree of contraction by the contraction process. In this way, the noise pixel DT can be appropriately erased. If the expansion process is executed first and the contraction process is executed later, if the degree of expansion by the expansion process is equal to or greater than the degree of contraction by the contraction process, the noise pixel DT enlarged by the expansion process is It may not be erased.

以上説明した収縮・膨張処理(図2のステップS125)によって、ノイズ画素DTの消去や、断線部NTの接続を実現できるので、後に実行するオブジェクト判定処理において、囲み線の判定の精度を向上できる。また、無駄な処理(例えば、ノイズ画素DTを判定対象のオブジェクトとする処理)を低減することにより、処理負荷を低減することができる。   The above-described contraction / expansion process (step S125 in FIG. 2) can realize the elimination of the noise pixel DT and the connection of the disconnection portion NT, so that the accuracy of the surrounding line determination can be improved in the object determination process to be executed later. . In addition, the processing load can be reduced by reducing unnecessary processing (for example, processing in which the noise pixel DT is an object to be determined).

続くステップS130(図2)では、オブジェクト特定部320は、収縮・膨張処理後の二値画像データを利用して、赤色オブジェクトを特定して、特定された赤色オブジェクトに識別子を付すラベリングを実行する。ラベリングの結果、例えば、赤色オブジェクトと、識別子とを、対応付けたラベルデータが生成される。   In the subsequent step S130 (FIG. 2), the object specifying unit 320 uses the binary image data after the contraction / expansion processing to specify a red object, and executes labeling for attaching an identifier to the specified red object. . As a result of the labeling, for example, label data in which a red object is associated with an identifier is generated.

具体的には、オブジェクト特定部320は、連続する(互いに隣接する)1個以上の赤色オブジェクト画素で構成される1個の領域を、1個の赤色オブジェクトとして特定する。図3(B)の例では、3個の文字61A〜63Aと、囲み線66Aと、描画67および写真68(図3(A))の一部分である部分オブジェクト67A、68Aと、が特定され、これらの赤色オブジェクトのそれぞれに、互いに異なる識別子が付される。   Specifically, the object specifying unit 320 specifies one area composed of one or more continuous (adjacent) red object pixels as one red object. In the example of FIG. 3B, three characters 61A to 63A, a surrounding line 66A, a drawing 67 and partial objects 67A and 68A that are part of the photograph 68 (FIG. 3A) are specified. Each of these red objects is given a different identifier.

赤色オブジェクトが特定されると、ステップS145では、画像処理部300は、オブジェクト判定処理を実行する。図5は、オブジェクト判定処理のフローチャートである。オブジェクト判定処理は、特定された複数個の赤色オブジェクト61A〜63A、66A〜68Aのそれぞれが、囲み線であるか否かを、赤色オブジェクトごとに判定する処理である。1個の赤色オブジェクトの判定は、縦方向線判定処理(ステップS235)と、横方向線判定処理(ステップS240)と、形状判定処理(ステップS245)と、のうち、少なくとも1個の処理の処理結果に基づいて、実行される。   When the red object is specified, in step S145, the image processing unit 300 executes an object determination process. FIG. 5 is a flowchart of the object determination process. The object determination process is a process for determining, for each red object, whether or not each of the plurality of identified red objects 61A to 63A and 66A to 68A is a surrounding line. The determination of one red object is a process of at least one of the vertical line determination process (step S235), the horizontal line determination process (step S240), and the shape determination process (step S245). It is executed based on the result.

ステップS205では、解析処理部350は、処理対象の赤色オブジェクトを選択する。図3(B)の例では、3個の文字61A〜63Aと、囲み線66Aと、描画67および写真68の一部分である部分オブジェクト67A、68Aの中から、1個の赤色オブジェクトが処理対象として選択される。   In step S205, the analysis processing unit 350 selects a red object to be processed. In the example of FIG. 3B, one red object is selected as a processing target from among the three characters 61A to 63A, the surrounding line 66A, and the partial objects 67A and 68A that are parts of the drawing 67 and the photograph 68. Selected.

ステップS210では、解析処理部350の色判定部351は、処理対象の赤色オブジェクトが単色であるか否かを判定する単色判定処理を実行する。具体的には、色判定部351は、赤色オブジェクトの平均成分値(Rave1、Gave1、Bave1)を算出する。平均成分値(Rave1、Gave1、Bave1)は、処理対象の赤色オブジェクトを構成する全ての赤色オブジェクト画素の値の平均値を、色成分ごとに算出することによって得られる。次に、色判定部351は、平均成分値に近い成分値を有する赤色オブジェクト画素の割合(RT_R、RT_G、RT_B)を、以下の式(1)〜(3)を用いて、色成分ごとに算出する。   In step S210, the color determination unit 351 of the analysis processing unit 350 executes a single color determination process for determining whether or not the red object to be processed is a single color. Specifically, the color determination unit 351 calculates an average component value (Rave1, Gave1, Bave1) of the red object. The average component values (Rave1, Gave1, Bave1) are obtained by calculating the average value of all red object pixels constituting the red object to be processed for each color component. Next, the color determination unit 351 determines the ratio (RT_R, RT_G, RT_B) of red object pixels having component values close to the average component value for each color component using the following equations (1) to (3). calculate.

RT_R=(PN_Rave1/PNtotal) ...(1)
RT_G=(PN_Gave1/PNtotal) ...(2)
RT_B=(PN_Bave1/PNtotal) ...(3)
RT_R = (PN_Rave1 / PNtotal) ... (1)
RT_G = (PN_Gave1 / PNtotal) ... (2)
RT_B = (PN_Bave1 / PNtotal) (3)

ここで、PNtotalは、処理対象の赤色オブジェクトを構成する赤色オブジェクト画素の全体の個数である。PN_Rave1、PN_Gave1、PN_Bave1は、平均成分値(Rave1、Gave1、Bave1)に近い成分値を有する赤色オブジェクト画素の個数であり、色成分ごとに算出される。なお、本実施例では、R成分値が、(Rave1−ΔV1)≦R≦(Rave1+ΔV1)の範囲内である場合に、当該画素は、平均成分値に近いR成分値を有する画素であると判断される。同様に、G成分値が、(Gave1−ΔV1)≦G≦(Gave1+ΔV1)の範囲内である場合に、当該画素は、平均成分値に近いG成分値を有する画素であると判断される。B成分値が、(Bave1−ΔV1)≦B≦(Bave1+ΔV1)の範囲内である場合に、当該画素は、平均成分値に近いG成分値を有する画素であると判断される。なお、例えば、ΔV1は、256階調の成分値に対して、例えば、70に設定される。   Here, PNtotal is the total number of red object pixels constituting the red object to be processed. PN_Rave1, PN_Gave1, and PN_Bave1 are the number of red object pixels having component values close to the average component values (Rave1, Gave1, Bave1), and are calculated for each color component. In this embodiment, when the R component value is within the range of (Rave1−ΔV1) ≦ R ≦ (Rave1 + ΔV1), the pixel is determined to be a pixel having an R component value close to the average component value. Is done. Similarly, when the G component value is within the range of (Gave1−ΔV1) ≦ G ≦ (Gave1 + ΔV1), the pixel is determined to be a pixel having a G component value close to the average component value. When the B component value is within the range of (Bave1−ΔV1) ≦ B ≦ (Bave1 + ΔV1), the pixel is determined to be a pixel having a G component value close to the average component value. For example, ΔV1 is set to 70, for example, for a component value of 256 gradations.

そして、色判定部351は、成分ごとに算出された割合(RT_R、RT_G、RT_B)がそれぞれ基準値TH1以上である場合、すなわち、RT_R≧TH1、かつ、RT_G≧TH1、かつ、RT_B≧TH1である場合に、処理対象の赤色オブジェクトは単色であると判断する。また、色判定部351は、割合(RT_R、RT_G、RT_B)の少なくとも1つが基準値TH1未満である場合、すなわち、RT_R<TH1、または、RT_G<TH1、または、RT_B<TH1である場合に、処理対象の赤色オブジェクトは単色でないと判断する。基準値TH1は、実験的に設定される設計値であり、例えば、0.6に設定される。囲み線は、薄い赤色のペンで記入される場合もあれば、濃い赤色のペンで記入される場合もあるので、ステップS120(図2)では、薄い赤、濃い赤などを含む比較的広い範囲内の色を有する画素を赤色オブジェクト画素として抽出している。このために、本ステップでは、赤色オブジェクトが単色であるか否かを比較的厳密に判定している。   Then, the color determination unit 351, when the ratio (RT_R, RT_G, RT_B) calculated for each component is greater than or equal to the reference value TH1, that is, RT_R ≧ TH1, RT_G ≧ TH1, and RT_B ≧ TH1. In some cases, it is determined that the red object to be processed is a single color. Further, the color determination unit 351, when at least one of the ratios (RT_R, RT_G, RT_B) is less than the reference value TH1, that is, when RT_R <TH1, or RT_G <TH1, or RT_B <TH1. It is determined that the red object to be processed is not a single color. The reference value TH1 is a design value set experimentally, and is set to 0.6, for example. The encircling line may be written with a light red pen or a dark red pen, so in step S120 (FIG. 2), a relatively wide range including light red, dark red, etc. A pixel having a color inside is extracted as a red object pixel. For this reason, in this step, it is determined relatively strictly whether or not the red object is a single color.

単色判定処理によって、処理対象の赤色オブジェクトが単色でないと判定された場合には(ステップS215:NO)、属性判断部360は、処理対象の赤色オブジェクトは囲み線ではないと判断する(ステップS265)。1個の囲み線は、記入の途中でペンを代えることなく、一筆書きで記入されるのが一般的であるので、囲み線は単色であると考えられる。例えば、濃い赤色のペンを用いて、記入された囲み線は、濃い赤色の単色であり、薄い赤色のペンを用いて、記入された囲み線は、薄い赤色の単色であると考えられる。このために、本実施例では、単色であることを、赤色オブジェクトが囲み線であると判定するための必要条件として採用している。この結果、赤色オブジェクトが囲み線であるか否かを適切に判定することができる。例えば、図3(B)の囲み線66Aは、単色であると判定される。また、例えば、B3(B)の部分オブジェクト67Aが、薄い赤色や濃い赤色などを含む多数の色を含んでいる場合には、部分オブジェクト67Aは、単色ではないと判定される。   If it is determined by the single color determination process that the red object to be processed is not a single color (step S215: NO), the attribute determination unit 360 determines that the red object to be processed is not a surrounding line (step S265). . Since one encircling line is generally entered with a single stroke without changing the pen in the middle of entry, the encircling line is considered to be monochromatic. For example, an encircled line drawn using a dark red pen is considered to be a dark red monochromatic color, and an encircling line entered using a light red pen is considered to be a pale red monochromatic color. For this reason, in this embodiment, the single color is adopted as a necessary condition for determining that the red object is a surrounding line. As a result, it is possible to appropriately determine whether or not the red object is a surrounding line. For example, the surrounding line 66A in FIG. 3B is determined to be a single color. Further, for example, when the partial object 67A of B3 (B) includes a large number of colors including light red and dark red, it is determined that the partial object 67A is not a single color.

処理対象の赤色オブジェクトが単色であると判定された場合には(ステップS215:YES)、処理時間判断部330は、処理順序決定処理を実行する(ステップS220)。処理順序決定処理は、第1の解析処理としての線判定処理(後述するステップS235、S240)と、第2の解析処理としての形状判定処理(後述するステップS245)と、の処理時間を判断し、判断結果に基づいて線判定処理と形状判定処理との処理順序を決定する処理である。具体的には、処理時間判断部330は、線判定処理の処理時間が、形状判定処理の処理時間未満であると判断される場合には、形状判定処理に先行して、線判定処理を実行するように処理順序を決定する。また、処理時間判断部330は、線判定処理の処理時間が、形状判定処理の処理時間以上であると判断される場合には、線判定処理に先行して、形状判定処理を実行するように処理順序を決定する。処理順序決定処理の詳細は、線判定処理と形状判定処理を含むオブジェクト判定処理(図5)の全体を説明した後に説明する。   When it is determined that the red object to be processed is a single color (step S215: YES), the processing time determination unit 330 executes a processing order determination process (step S220). The processing order determination process determines processing times of a line determination process (steps S235 and S240 described later) as the first analysis process and a shape determination process (step S245 described later) as the second analysis process. In this process, the processing order of the line determination process and the shape determination process is determined based on the determination result. Specifically, when it is determined that the processing time of the line determination process is less than the processing time of the shape determination process, the processing time determination unit 330 executes the line determination process prior to the shape determination process. The processing order is determined as follows. In addition, when it is determined that the processing time of the line determination process is equal to or longer than the processing time of the shape determination process, the processing time determination unit 330 executes the shape determination process prior to the line determination process. Determine the processing order. Details of the processing order determination processing will be described after the entire object determination processing (FIG. 5) including the line determination processing and the shape determination processing is described.

ステップS230では、解析処理部350は、上述した処理順序決定処理で決定された処理順序に従って、実行すべき判定処理を決定する。例えば、処理順序決定処理において、形状判定処理に先行して、線判定処理を実行するように決定された場合には、縦方向線判定処理(ステップS235)、横方向線判定処理(ステップS240)、形状判定処理(ステップS245)の順序で、実行すべき判定処理が決定される。逆に、処理順序決定処理において、線判定処理に先行して、形状判定処理を実行するように決定された場合には、形状判定処理(ステップS245)、縦方向線判定処理(ステップS235)、横方向線判定処理(ステップS240)の順序で、実行すべき判定処理が決定される。なお、いずれの場合でも、本実施例では、縦方向線判定処理が、横方向線判定処理より先に実行されるように、予め定められている。これに代えて、横方向線判定処理が、縦方向線判定処理より先に実行されても良い。   In step S230, the analysis processing unit 350 determines a determination process to be executed in accordance with the processing order determined in the processing order determination process described above. For example, in the process order determination process, when it is determined to execute the line determination process prior to the shape determination process, the vertical direction line determination process (step S235) and the horizontal direction line determination process (step S240). The determination process to be executed is determined in the order of the shape determination process (step S245). Conversely, in the processing order determination process, when it is determined to execute the shape determination process prior to the line determination process, the shape determination process (step S245), the vertical line determination process (step S235), The determination process to be executed is determined in the order of the horizontal direction line determination process (step S240). In any case, in this embodiment, it is predetermined that the vertical direction line determination process is executed prior to the horizontal direction line determination process. Instead of this, the horizontal direction line determination process may be executed prior to the vertical direction line determination process.

先ず、線判定処理について説明する。図6は、線判定処理の説明図である。線判定処理は、処理対象の赤色オブジェクトが線であるか否かを判定する処理である。線判定処理は、線判定部352によって実行され、縦方向線判定処理(ステップS235)と、横方向線判定処理(ステップS240)とを含んでいる。   First, the line determination process will be described. FIG. 6 is an explanatory diagram of the line determination process. The line determination process is a process for determining whether or not the red object to be processed is a line. The line determination process is executed by the line determination unit 352, and includes a vertical line determination process (step S235) and a horizontal line determination process (step S240).

縦方向線判定処理は、赤色オブジェクトを含む処理領域内の縦方向(Y方向)に延びる複数の直線上において、赤色オブジェクト画素の分布を解析する処理を用いて実行される。具体的には、図6(A)に示すように、二値画像60A内の囲み線66A(図3(B))が処理対象の赤色オブジェクトである場合を例に説明する。線判定部352は、囲み線66Aに外接する矩形領域SI1を処理領域として特定する。線判定部352は、矩形領域SI1内のY方向(図6の縦方向)に沿った線L1(p)に沿って、連続する赤色オブジェクト画素の個数(連続画素数)を算出する。pは、X方向の線の位置を示す値であり、例えば、1≦p≦Wの範囲内の値である(Wは、矩形領域SI1のX方向の長さ(画素数))。図6(A)の例では、2つの連続画素数Lh1、Lh2が算出される。この場合には、線L1(p)に対応する連続画素数LN1(p)として、2つの連続画素数Lh1、Lh2の平均値((Lh1+Lh2)/2)を算出する。オブジェクト特定部320は、1≦p≦Wの範囲内のW本の線L1(p)の全てについて、それぞれ連続画素数LN1(p)を算出する。   The vertical direction line determination processing is executed using processing for analyzing the distribution of red object pixels on a plurality of straight lines extending in the vertical direction (Y direction) in a processing region including a red object. Specifically, as shown in FIG. 6A, an example will be described in which a surrounding line 66A (FIG. 3B) in the binary image 60A is a red object to be processed. The line determination unit 352 identifies the rectangular area SI1 circumscribing the surrounding line 66A as a processing area. The line determination unit 352 calculates the number of consecutive red object pixels (the number of continuous pixels) along the line L1 (p) along the Y direction (the vertical direction in FIG. 6) in the rectangular area SI1. p is a value indicating the position of the line in the X direction, for example, a value within a range of 1 ≦ p ≦ W (W is the length (number of pixels) in the X direction of the rectangular region SI1). In the example of FIG. 6A, two consecutive pixel numbers Lh1 and Lh2 are calculated. In this case, the average value ((Lh1 + Lh2) / 2) of the two continuous pixel numbers Lh1 and Lh2 is calculated as the continuous pixel number LN1 (p) corresponding to the line L1 (p). The object specifying unit 320 calculates the number of continuous pixels LN1 (p) for all W lines L1 (p) within the range of 1 ≦ p ≦ W.

線判定部352は、W本の線L1(p)について算出されたW個の連続画素数LN1(p)の平均値LN1aveを算出する。線判定部352は、平均連続画素数LN1aveが基準値TH2以下である場合に、赤色オブジェクトは、線であると判定し、平均連続画素数LNaveが基準値TH2未満である場合に、赤色オブジェクトは、線でないと判定する。すなわち、平均連続画素数LN1aveが基準値TH2以下であることが、縦方向線判定処理の判定条件である。   The line determination unit 352 calculates an average value LN1ave of the W consecutive pixel numbers LN1 (p) calculated for the W lines L1 (p). The line determination unit 352 determines that the red object is a line when the average continuous pixel number LN1ave is equal to or less than the reference value TH2, and the red object is determined when the average continuous pixel number LNave is less than the reference value TH2. Judge that it is not a line. That is, the determination condition of the vertical line determination process is that the average continuous pixel number LN1ave is equal to or less than the reference value TH2.

横方向線判定処理は、縦方向線判定処理と同様の処理を横方向(X方向)について実行する処理である。具体的には、線判定部352は、矩形領域SI1内のX方向(図6の横方向)に沿った線L2(q)に沿って、赤色オブジェクト画素の連続画素数を算出する。qは、線のY方向の線の位置(Y座標)を示す値であり、例えば、1≦q≦Hの範囲内の値である(Hは、矩形領域SI1のY方向の長さ(画素数))。図6(A)の例では、2つの連続画素数Lw1、Lw2が算出される。この場合には、線L2(q)に対応する連続画素数LN2(q)として、2つの連続画素数LW1、LW2の平均値を算出する。オブジェクト特定部320は、1≦q≦Hの範囲内のH本の線L2(q)の全てについて、それぞれ連続画素数LN2(q)を算出する。   The horizontal direction line determination process is a process for executing the same process as the vertical direction line determination process in the horizontal direction (X direction). Specifically, the line determination unit 352 calculates the number of continuous pixels of the red object pixels along the line L2 (q) along the X direction (lateral direction in FIG. 6) in the rectangular area SI1. q is a value indicating the position (Y coordinate) of the line in the Y direction of the line. For example, q is a value within the range of 1 ≦ q ≦ H (H is the length of the rectangular region SI1 in the Y direction (pixel number)). In the example of FIG. 6A, two consecutive pixel numbers Lw1 and Lw2 are calculated. In this case, the average value of the two continuous pixel numbers LW1 and LW2 is calculated as the continuous pixel number LN2 (q) corresponding to the line L2 (q). The object specifying unit 320 calculates the continuous pixel number LN2 (q) for all of the H lines L2 (q) within the range of 1 ≦ q ≦ H.

線判定部352は、H本の線L1(q)について算出されたH個の連続画素数LN1(q)の平均値LN1aveを算出する。線判定部352は、平均連続画素数LN2aveが基準値TH2以下である場合に、赤色オブジェクトは、線であると判定し、平均連続画素数LNaveが基準値TH2未満である場合に、赤色オブジェクトは、線でないと判定する。すなわち、平均連続画素数LN2aveが基準値TH2以下であることが、縦方向線判定処理の判定条件である。   The line determination unit 352 calculates an average value LN1ave of the H continuous pixel numbers LN1 (q) calculated for the H lines L1 (q). The line determination unit 352 determines that the red object is a line when the average continuous pixel number LN2ave is equal to or less than the reference value TH2, and the red object is determined when the average continuous pixel number LNave is less than the reference value TH2. Judge that it is not a line. That is, the determination condition of the vertical line determination process is that the average continuous pixel number LN2ave is equal to or less than the reference value TH2.

このように、X方向とY方向に延びる複数の直線上のそれぞれにおいて、赤色オブジェクト画素が連続する個数を算出することによって、オブジェクトの幅(線幅LW)を特定するので、オブジェクトの幅を適切に特定することができる。1個の囲み線は、赤色のペンで一筆書きされた一本の線であることが想定されるので、線であることを、赤色オブジェクトが囲み線であると判定するための必要条件として採用している。この結果、赤色オブジェクトが囲み線であるか否かを適切に判定することができる。例えば、図3(B)の囲み線66Aは、線であると判定される。   Thus, the object width (line width LW) is specified by calculating the number of consecutive red object pixels on each of a plurality of straight lines extending in the X direction and the Y direction. Can be specified. Since one encircling line is assumed to be a single line drawn with a red pen, it is assumed that it is a line as a necessary condition for determining that a red object is an encircling line. doing. As a result, it is possible to appropriately determine whether or not the red object is a surrounding line. For example, the surrounding line 66A in FIG. 3B is determined to be a line.

図6(B)には、二値画像60A内の部分オブジェクト68A(図3(B))が処理対象の赤色オブジェクトである場合を例に説明する。このような赤色オブジェクトが線でない場合には、図6(B)に示すように、Y方向の線L1(p)についての連続画素数Lh3や、X方向の線L2(q)についての連続画素数Lw3は、比較的大きくなる。この結果、部分オブジェクト68Aは、線判定処理において、線ではないと判定される。   FIG. 6B illustrates an example in which the partial object 68A (FIG. 3B) in the binary image 60A is a red object to be processed. When such a red object is not a line, as shown in FIG. 6B, the continuous pixel number Lh3 for the line L1 (p) in the Y direction and the continuous pixel for the line L2 (q) in the X direction. The number Lw3 is relatively large. As a result, the partial object 68A is determined not to be a line in the line determination process.

次に、形状判定処理について説明する。形状判定処理は、形状判定部353によって実行され、処理対象の赤色オブジェクトが、スキャン画像60内の一部の領域を囲む囲み形状を有しているか否かを判定する処理である。   Next, the shape determination process will be described. The shape determination process is a process that is executed by the shape determination unit 353 and determines whether or not the red object to be processed has a surrounding shape surrounding a part of the area in the scan image 60.

図7は、形状判定処理のフローチャートである。図8は、形状判定処理の第1の説明図である。図9は、形状判定処理の第2の説明図である。ステップS305では、形状判定部353は、赤色オブジェクトを構成する1個の赤色オブジェクト画素を注目画素として選択する。具体的には、形状判定部353は、矩形領域SI1(図8(A))内を、X方向の複数本の線Lxを、Y方向の負方向側から(図8の上方から)順次に走査して、検出される順番に1個ずつ赤色オブジェクト画素を選択する。   FIG. 7 is a flowchart of the shape determination process. FIG. 8 is a first explanatory diagram of the shape determination process. FIG. 9 is a second explanatory diagram of the shape determination process. In step S305, the shape determination unit 353 selects one red object pixel constituting the red object as a target pixel. More specifically, the shape determining unit 353 sequentially advances a plurality of lines Lx in the X direction from the negative direction side in the Y direction (from the upper side in FIG. 8) in the rectangular area SI1 (FIG. 8A). Scan and select red object pixels one by one in the order they are detected.

ステップS310では、形状判定部353は、選択された注目画素に対応する枠領域FLを設定する。図8(B)には、注目画素NPに対して設定される枠領域FLの一例が示されている。図8(B)に示すように、枠領域FLは、正方形の枠状の領域であり、枠の太さは、1画素分である。枠領域FLのX方向およびY方向の幅(画素数)FWは、図8(C)に示す式で表される。この式から解るように、枠領域FLの幅FWは、スキャン画像60の読み取り解像度RS(単位はdpi(dot per inch))と、赤色オブジェクトの線幅LW(単位は、画素)と、赤色オブジェクトのサイズOBS(単位は、画素)と、に応じて決定される。線幅LWには、例えば、線判定処理(図5のステップS220)にて算出された平均連続画素数LNaveが用いられる。オブジェクトサイズOBSには、例えば、矩形領域SI1の横幅Wと縦幅Hの平均値((H+W)/2)が用いられる。枠領域FLは、本実施例では、注目画素NPが中心に位置するように、設定される。以上の説明から解るように、枠領域FL内に含まれる画素数Mは、{(FW×4)−4}と表すことができる。   In step S310, the shape determination unit 353 sets a frame region FL corresponding to the selected target pixel. FIG. 8B shows an example of the frame region FL set for the target pixel NP. As shown in FIG. 8B, the frame area FL is a square frame-shaped area, and the thickness of the frame is one pixel. The width (number of pixels) FW in the X direction and the Y direction of the frame region FL is expressed by the equation shown in FIG. As can be seen from this equation, the width FW of the frame region FL includes the reading resolution RS of the scanned image 60 (unit is dpi (dot per inch)), the line width LW of the red object (unit is pixel), and the red object. The size is determined in accordance with the size OBS (unit: pixels). For the line width LW, for example, the average continuous pixel number LNave calculated in the line determination process (step S220 in FIG. 5) is used. For the object size OBS, for example, an average value ((H + W) / 2) of the horizontal width W and the vertical width H of the rectangular area SI1 is used. In this embodiment, the frame area FL is set so that the target pixel NP is located at the center. As can be understood from the above description, the number M of pixels included in the frame region FL can be expressed as {(FW × 4) −4}.

続くステップS315では、形状判定部353は、枠領域FL内のM個の画素を1個ずつ調べることによって、枠領域内のオブジェクト部分領域の個数Mvを算出する。オブジェクト部分領域は、枠領域FL内に、赤色オブジェクト画素が連続して並ぶ領域である。図8(B)の例では、2個のオブジェクト部分領域OA1、OA2が存在するので、個数Mvの値は「2」である。ここで、個数Mvを算出するのは、赤色オブジェクトと、枠領域FLとが、交差する数を認識するためである。図8(B)に示すように、個数Mvは、処理対象の赤色オブジェクトが枠領域FLと交差する数を示していることが解る。このために個数Mvを交差数Mvとも呼ぶ。交差数Mvが2である場合には、赤色オブジェクトは、枠領域FLが配置された矩形(枠配置矩形)内において、注目画素NPの位置(本実施例では、枠配置矩形の中心)を通り、枠配置矩形を横断する一本の線を成していると推定することができる。なお、枠領域FL内に位置すると言う場合には、1画素の太さの枠の内部に位置することを意味する。すなわち、枠領域FL内に位置する画素は、枠領域FLを構成する画素と言い換えることができる。例えば、図8(B)において、オブジェクト部分領域OA1、OB2は、枠領域FL内に位置しているが、注目画素NPや、オブジェクト部分領域OA1とオブジェクト部分領域OA2との間の複数個の赤色オブジェクト画素は、枠領域FL内には位置していない。また、枠配置矩形内に位置すると言う場合には、枠領域FL内または枠領域FLの内側の領域に位置していることを意味する。例えば、図8(B)において、オブジェクト部分領域OA1、OA2、注目画素NP、オブジェクト部分領域OA1とオブジェクト部分領域OA2との間の複数個の赤色オブジェクト画素は、全て枠配置矩形内に位置している。   In subsequent step S315, the shape determining unit 353 calculates the number Mv of the object partial areas in the frame area by examining the M pixels in the frame area FL one by one. The object partial area is an area in which red object pixels are continuously arranged in the frame area FL. In the example of FIG. 8B, since there are two object partial areas OA1 and OA2, the value of the number Mv is “2”. Here, the reason why the number Mv is calculated is to recognize the number of intersections between the red object and the frame area FL. As shown in FIG. 8B, it can be seen that the number Mv indicates the number of red objects to be processed that intersect the frame region FL. For this reason, the number Mv is also referred to as the intersection number Mv. When the intersection number Mv is 2, the red object passes through the position of the target pixel NP (in this embodiment, the center of the frame arrangement rectangle) within the rectangle (frame arrangement rectangle) in which the frame area FL is arranged. It can be estimated that a single line crossing the frame arrangement rectangle is formed. In addition, when it says that it is located in the frame area | region FL, it means that it is located inside the frame of the thickness of 1 pixel. In other words, the pixels located in the frame region FL can be rephrased as pixels constituting the frame region FL. For example, in FIG. 8B, the object partial areas OA1 and OB2 are located in the frame area FL, but the target pixel NP and a plurality of red colors between the object partial area OA1 and the object partial area OA2 are used. The object pixel is not located in the frame area FL. Further, when it is located within the frame arrangement rectangle, it means that it is located within the frame area FL or inside the frame area FL. For example, in FIG. 8B, the object partial areas OA1, OA2, the target pixel NP, and the plurality of red object pixels between the object partial area OA1 and the object partial area OA2 are all located within the frame arrangement rectangle. Yes.

例えば、図8(A)に示す枠領域FL2は、交差数Mvが2である例を示しているが、赤色オブジェクトは、枠配置矩形内において、枠配置矩形の中心を通り、枠配置矩形を横断する一本の線を成していることが解る。一方、図8(A)に示す枠領域FL1は、交差数Mvが1である例を示しているが、赤色オブジェクトは、枠配置矩形内で終端を形成しているので、中心を通る一本の線ではあるが、枠配置矩形を横断してはいない。   For example, the frame area FL2 shown in FIG. 8A shows an example in which the number of intersections Mv is 2, but the red object passes through the center of the frame arrangement rectangle in the frame arrangement rectangle and passes through the frame arrangement rectangle. It can be seen that it forms a single line that crosses. On the other hand, the frame area FL1 shown in FIG. 8A shows an example in which the number of intersections Mv is 1. However, since the red object forms the end in the frame arrangement rectangle, one line passing through the center is shown. This line does not cross the frame layout rectangle.

図7のステップS320では、形状判定部353は、全ての赤色オブジェクト画素が注目画素として選択されたか否かを判断する。未選択の赤色オブジェクト画素がある場合には(ステップS320:NO)、形状判定部353は、ステップS305に戻って、未選択の赤色オブジェクト画素を選択して、上述したステップS305〜S320までの処理を繰り返す。全ての赤色オブジェクト画素が選択された場合には(ステップS320:YES)、形状判定部353は、ステップS325に処理を進める。ステップS325に移行して時点で、処理対象の赤色オブジェクトを構成する全ての赤色オブジェクト画素に対応する枠領域FLについて、交差数Mvが算出されている。以下では、交差数Mvが「A(Aは自然数)」である枠領域FLに対応する赤色オブジェクト画素を、単に、交差数Mvが「A」の赤色オブジェクト画素と言う。また、赤色オブジェクト画素に対応する枠領域FLと赤色オブジェクトとの交差数Mvが「A」であることを、単に、赤色オブジェクト画素の交差数Mvが「A」である、と言う。   In step S320 of FIG. 7, the shape determination unit 353 determines whether all red object pixels have been selected as the target pixel. When there is an unselected red object pixel (step S320: NO), the shape determination unit 353 returns to step S305, selects an unselected red object pixel, and performs the processing from step S305 to S320 described above. repeat. When all the red object pixels are selected (step S320: YES), the shape determining unit 353 advances the process to step S325. At the time of shifting to step S325, the number of intersections Mv is calculated for the frame region FL corresponding to all red object pixels constituting the red object to be processed. Hereinafter, the red object pixel corresponding to the frame area FL whose intersection number Mv is “A (A is a natural number)” is simply referred to as a red object pixel whose intersection number Mv is “A”. Further, the fact that the number of intersections Mv between the frame area FL corresponding to the red object pixel and the red object is “A” simply means that the number of intersections Mv of the red object pixel is “A”.

ステップS325では、全ての赤色オブジェクト画素に対する、交差数Mvが2である赤色オブジェクト画素の割合RT2を算出する。交差数Mvが2である赤色オブジェクト画素を、第1の特定画素とも呼ぶ。ステップS330では、形状判定部353は、割合RT2が、基準値THa以上であるか否かを判断する。形状判定部353は、割合RT2が、基準値THa以上である場合には(ステップS330:YES)、赤色オブジェクトは、囲み形状であると判定する(ステップS370)。赤色オブジェクトが囲み形状である場合は、図8(A)に示す枠領域FL2のように、大部分の赤色オブジェクト画素(注目画素)の交差数Mvが2個になると考えられる。例外的に、図8(A)に示す枠領域FL1のように、一筆書きされた囲み線の端部近傍の赤色オブジェクト画素の交差数Mvは、2個にならない場合がある。また、ノイズなどによって、一部の赤色オブジェクト画素の交差数Mvが2にならない可能性がある。このような事情を考慮して、基準値THaを適切に規定することによって、赤色オブジェクトが囲み形状であるか否かを適切に判定することができる。本実施例では、THaは、0.85に設定されている。   In step S325, the ratio RT2 of red object pixels whose intersection number Mv is 2 with respect to all red object pixels is calculated. A red object pixel having an intersection number Mv of 2 is also referred to as a first specific pixel. In step S330, the shape determining unit 353 determines whether the ratio RT2 is equal to or greater than the reference value THa. When the ratio RT2 is equal to or greater than the reference value THa (step S330: YES), the shape determining unit 353 determines that the red object has a surrounding shape (step S370). When the red object has a surrounding shape, it is considered that the intersection number Mv of most red object pixels (target pixels) is two as in a frame region FL2 shown in FIG. Exceptionally, like the frame region FL1 shown in FIG. 8A, the number Mv of intersections of red object pixels in the vicinity of the end of the drawn stroke line may not be two. In addition, the number of intersections Mv of some red object pixels may not be 2 due to noise or the like. In consideration of such circumstances, it is possible to appropriately determine whether or not the red object has a surrounding shape by appropriately defining the reference value THa. In this embodiment, THa is set to 0.85.

図9を参照してさらに説明する。図9(A)には、赤色オブジェクトが、文字63A(図3(B))である例を示している。図9(A)に示す枠領域FL4は、交差数Mvが3である例を示しているが、赤色オブジェクトは、枠配置矩形内において、3つに分岐した形状を有していることが解る。また、図9(A)に示す枠領域FL5のように、文字の端部近傍の赤色オブジェクト画素は、交差数Mvが1になる可能性が高い。このように、赤色オブジェクトが文字である場合には、3つ以上に分岐した部分や、3個以上の端部を有する場合が多いので、交差数Mvが2ではない赤色オブジェクト画素の割合が、赤色オブジェクトが囲み形状である場合と比較して高くなる。赤色の文字は、単色判定処理(図5:ステップS210)において、単色であると判定され、縦方向判定処理(図5:ステップS235)や横方向判定処理(図5:ステップS240)において、線であると判定される可能性が比較的高い。しかしながら、形状判定処理では、赤色の文字は、囲み形状ではないと判断される。したがって、形状判定処理では、割合RT2を用いて判断することによって、囲み線でない赤色オブジェクト(例えば、文字)は囲み形状ではないと判断し、囲み線である赤色オブジェクトは囲み形状であると、適切に判断することができる。   Further description will be given with reference to FIG. FIG. 9A shows an example in which the red object is a character 63A (FIG. 3B). A frame region FL4 shown in FIG. 9A shows an example in which the number of intersections Mv is 3, but it is understood that the red object has a shape branched into three in the frame arrangement rectangle. . Further, as in the frame region FL5 shown in FIG. 9A, the red object pixel near the end of the character is likely to have the intersection number Mv of 1. In this way, when the red object is a character, it often has a portion branched into three or more and three or more ends, so the proportion of red object pixels whose intersection number Mv is not 2 is This is higher than when the red object has a surrounding shape. The red character is determined to be a single color in the single color determination process (FIG. 5: step S210), and in the vertical direction determination process (FIG. 5: step S235) or the horizontal direction determination process (FIG. 5: step S240) There is a relatively high possibility of being determined. However, in the shape determination process, it is determined that the red character is not a surrounding shape. Therefore, in the shape determination process, it is determined that a red object (for example, a character) that is not a surrounding line is not a surrounding shape by making a determination using the ratio RT2, and a red object that is a surrounding line is appropriately Can be judged.

ここで、図8(C)の式に示すように、枠領域FLの幅FWは、解像度RSが大きいほど大きく、赤色オブジェクトの線幅LWが大きいほど大きく、オブジェクトサイズOBSが大きいほど大きく、設定されている。この理由を説明する。枠領域FLの幅FWが、線幅LWに対して過度に小さい場合には、例えば、極端な例では、枠領域FLの枠配置矩形内の全体が、赤色オブジェクト画素で埋まり、分岐の数を示す交差数Mvを適切に算出できない可能性がある。また、枠領域FLの幅FWが、オブジェクトサイズOBSや線幅LWに対して過度に大きい場合には、枠領域FLの枠配置矩形内に、1個の赤色オブジェクトの互いに離れた複数の部分が配置される可能性が高くなる。例えば、枠領域FLの枠配置矩形内に、複数の線が配置される可能性が比較的高くなる。この結果、注目画素NPを通る1個の部分の分岐の数を示す交差数Mvを適切に算出できない可能性がある。なお、解像度RSが高いほど、1画素に対応する原稿上の寸法(例えば、300dpiである場合には、(1/300)インチ)が小さくなるので、画素数で示される枠領域FLの幅FWの値は、解像度RSが高いほど大きくされる。この結果、原稿上において想定される囲み線のサイズに応じた適切な枠領域FLの幅FW(画素数)を決定することができる。   Here, as shown in the equation of FIG. 8C, the width FW of the frame region FL increases as the resolution RS increases, increases as the line width LW of the red object increases, and increases as the object size OBS increases. Has been. The reason for this will be explained. When the width FW of the frame area FL is excessively small with respect to the line width LW, for example, in an extreme example, the entire frame arrangement rectangle of the frame area FL is filled with red object pixels, and the number of branches is reduced. There is a possibility that the indicated intersection number Mv cannot be calculated appropriately. In addition, when the width FW of the frame area FL is excessively larger than the object size OBS and the line width LW, a plurality of separated parts of one red object are included in the frame arrangement rectangle of the frame area FL. The possibility of being placed increases. For example, the possibility that a plurality of lines are arranged within the frame arrangement rectangle of the frame region FL is relatively high. As a result, there is a possibility that the number of intersections Mv indicating the number of branches of one part passing through the target pixel NP cannot be calculated appropriately. Note that the higher the resolution RS, the smaller the dimension on the document corresponding to one pixel (for example, (1/300) inch in the case of 300 dpi), so the width FW of the frame area FL indicated by the number of pixels. The value of is increased as the resolution RS is higher. As a result, it is possible to determine an appropriate width FW (number of pixels) of the frame area FL according to the size of the encircled line assumed on the document.

形状判定部353は、交差数Mvが2である赤色オブジェクト画素の割合RT2が、基準値THa未満である場合には(ステップS330:NO)、ステップS340に処理を進める。ここで、交差数Mvが2である赤色オブジェクト画素の割合RT2が、基準値THa未満である場合に、直ちに、赤色オブジェクトは、囲み形状でないと判定しない。これは、交差数Mvが2である赤色オブジェクト画素の割合RT2が、比較的少ない場合であっても、所定の条件を満たす場合には、赤色オブジェクトが囲み線である可能性があるからである。   When the ratio RT2 of the red object pixels whose intersection number Mv is 2 is less than the reference value THa (step S330: NO), the shape determination unit 353 advances the process to step S340. Here, when the ratio RT2 of the red object pixels whose intersection number Mv is 2 is less than the reference value THa, it is not immediately determined that the red object is not a surrounding shape. This is because even if the ratio RT2 of the red object pixels having the intersection number Mv of 2 is relatively small, the red object may be a surrounding line if the predetermined condition is satisfied. .

例えば、図8(A)に示す囲み線66Aでは、上述したように、交差数Mvが1である赤色オブジェクト画素が、一筆書きの囲み線66Aの開始端と、終了端の近傍に存在している。具体的には、一筆書きの囲み線の両端(開始端と終了端)が、完全に一致していない場合、例えば、両端が離れている場合(図8(A))、両端の一方の端部が、囲み線の他方の端部とは異なる位置に接している場合(図9(B))、両端の近傍で、囲み線が交差している場合(図9(C))には、交差数Mvが1である赤色オブジェクト画素が存在し得る。   For example, in the encircling line 66A shown in FIG. 8A, as described above, the red object pixel having the intersection number Mv of 1 exists in the vicinity of the start end and the end end of the encircling line 66A of one stroke. Yes. Specifically, when both ends (start end and end end) of the stroke line drawn with one stroke do not completely match, for example, when both ends are separated (FIG. 8A), one end of both ends When the part is in contact with a position different from the other end of the enclosing line (FIG. 9B), when the encircling line intersects in the vicinity of both ends (FIG. 9C), There may be a red object pixel with an intersection number Mv = 1.

また、図9(B)に示すように、両端の一方の端部が、囲み線の他方の端部とは異なる位置に接している囲み線66Bでは、交差数Mvが3である赤色オブジェクト画素(図9(B)の枠領域FL7参照)が存在し得る。さらに、図9(C)に示すように、両端の近傍で交差している囲み線66Cでは、交差数Mvが4である赤色オブジェクト画素(図9(B)の枠領域FL9参照)が存在し得る。さらに、ノイズの影響がある場合を除いて、赤色オブジェクトが、一筆書きの囲み線である場合には、交差数Mvが5以上である赤色オブジェクト画素は、存在しない。ここで、交差数Mvが、「1、3、4」のうちのいずれかである赤色オブジェクト画素を、第2の特定画素とも呼ぶ。また、交差数Mvが、「5」以上である赤色オブジェクト画素を、第3の特定画素とも呼ぶ。以上の説明から解るように、第1の特定画素の割合RT2が基準値THa未満であっても、第2の特定画素や第3の特定画素の分布状況が、上記の囲み線の特徴を備えていれば、赤色オブジェクトが囲み線である可能性は比較的高いと言うことができる。このことを考慮して、ステップS340以降の処理が実行される。   Further, as shown in FIG. 9B, a red object pixel whose intersection number Mv is 3 in a surrounding line 66B in which one end of both ends is in contact with a position different from the other end of the surrounding line. (See frame region FL7 in FIG. 9B). Further, as shown in FIG. 9C, in a surrounding line 66C intersecting in the vicinity of both ends, there is a red object pixel having an intersection number Mv of 4 (see frame region FL9 in FIG. 9B). obtain. Further, except when there is an influence of noise, when the red object is a one-stroke outline, there is no red object pixel having an intersection number Mv of 5 or more. Here, the red object pixel whose intersection number Mv is any one of “1, 3, 4” is also referred to as a second specific pixel. A red object pixel whose intersection number Mv is “5” or more is also referred to as a third specific pixel. As can be understood from the above description, even if the ratio RT2 of the first specific pixel is less than the reference value THa, the distribution state of the second specific pixel and the third specific pixel has the characteristics of the surrounding line. If so, it can be said that the possibility that the red object is a surrounding line is relatively high. In consideration of this, the processing after step S340 is executed.

ステップS340では、形状判定部353は、全ての赤色オブジェクト画素に対する、交差数Mvが5以上である赤色オブジェクト画素(第3の特定画素)の割合RT5を算出する。ステップS350では、形状判定部353は、第3の特定画素の割合RT5が、基準値THb以下であるか否かを判断する。形状判定部353は、第3の特定画素の割合RT5が、基準値THbより大きい場合には(ステップS350:NO)、赤色オブジェクトは、囲み形状でないと判定する(ステップS375)。上述したように、赤色オブジェクトが、一筆書きの囲み線である場合には、第3の特定画素は、ノイズなどの例外的な要因で第3の特定画素であると判断される場合を除いて、基本的に存在しないからである。基準値THbは、例えば、赤色オブジェクトが囲み線である場合に、ノイズによって発生し得る第3の特定画素の個数の上限値より僅かに大きな値に設定される。具体的には、本実施例では、基準値THbは、0.1に設定されている。形状判定処理では、割合RT5を用いて判断することによって、囲み線でない赤色オブジェクトを、判定対象から適切に除外することができる。   In step S340, the shape determination unit 353 calculates a ratio RT5 of red object pixels (third specific pixels) having an intersection number Mv of 5 or more with respect to all red object pixels. In step S350, the shape determining unit 353 determines whether or not the third specific pixel ratio RT5 is equal to or less than the reference value THb. When the ratio RT5 of the third specific pixel is larger than the reference value THb (step S350: NO), the shape determining unit 353 determines that the red object is not a surrounding shape (step S375). As described above, when the red object is a one-stroke outline, the third specific pixel is determined to be the third specific pixel due to an exceptional factor such as noise. Because basically it does not exist. For example, when the red object is a surrounding line, the reference value THb is set to a value slightly larger than the upper limit value of the number of third specific pixels that can be generated by noise. Specifically, in this embodiment, the reference value THb is set to 0.1. In the shape determination process, it is possible to appropriately exclude a red object that is not a surrounding line from the determination target by making a determination using the ratio RT5.

第3の特定画素の割合RT5が、基準値THb以下である場合には(ステップS350:YES)、形状判定部353は、後述する判定に用いる特定領域ESを設定する(ステップS355)。図10は、特定領域ESを用いる判定について説明する図である。形状判定部353は、交差数Mvが、「1、3、4」のうちのいずれかである複数個の赤色オブジェクト画素(第2の特定画素)の位置(座標)に基づいて、複数個の第2の特定画素の重心GCを算出する。上述したように、赤色オブジェクトが囲み線である場合には、第2の特定画素は、一筆書きの囲み線の両端の近傍に集中して存在する(図8(A)、図9(B)(C))。したがって、図10(A)に示すように、赤色オブジェクトが囲み線である場合には、重心GCは、一筆書きの囲み線の両端の近傍に位置する。   When the ratio RT5 of the third specific pixel is equal to or less than the reference value THb (step S350: YES), the shape determination unit 353 sets a specific region ES used for determination described later (step S355). FIG. 10 is a diagram illustrating determination using the specific area ES. Based on the position (coordinates) of the plurality of red object pixels (second specific pixels) whose intersection number Mv is any one of “1, 3, 4”, the shape determination unit 353 The center of gravity GC of the second specific pixel is calculated. As described above, when the red object is an encircling line, the second specific pixels are concentrated in the vicinity of both ends of the encircling line drawn with one stroke (FIGS. 8A and 9B). (C)). Therefore, as shown in FIG. 10A, when the red object is an encircling line, the center of gravity GC is located near both ends of the encircling line drawn with one stroke.

形状判定部353は、重心GCを中心として、正方形の特定領域ESを設定する。特定領域ESのX方向およびY方向の幅(画素数)EWは、図10(B)に示す式で表される。この式から解るように、特定領域ESの幅EWは、枠領域FLの幅FW(図8(C))と同様に、スキャン画像60の読み取り解像度RSと、赤色オブジェクトの線幅LWと、画素)と、赤色オブジェクトのサイズOBSと、に応じて決定される。   The shape determination unit 353 sets a square specific region ES with the center of gravity GC as the center. The width (number of pixels) EW in the X direction and the Y direction of the specific area ES is expressed by the formula shown in FIG. As can be seen from this equation, the width EW of the specific area ES is the same as the width FW of the frame area FL (FIG. 8C), the reading resolution RS of the scanned image 60, the line width LW of the red object, and the pixels ) And the size OBS of the red object.

続くステップS360では、形状判定部353は、全ての第2の特定画素に対する、特定領域ES内に位置する第2の特定画素の割合RTCを算出する。ステップS365では、形状判定部353は、第2の特定画素の割合RTCが、基準値THc以上であるか否かを判断する。形状判定部353は、第2の特定画素の割合RTCが、基準値THcより小さい場合には(ステップS365:NO)、赤色オブジェクトは、囲み形状でないと判定する(ステップS375)。上述したように、赤色オブジェクトが、一筆書きの囲み線である場合には、第2の特定画素は、赤色オブジェクトの一部分に集中する、すなわち、一筆書きの囲み線の両端近傍(すなわち、特定領域ES内)に集中する。一方、文字を構成する線の端部は、文字内の複数の箇所に分散して存在する。例えば、文字「Y」(図9(A)参照)の端部は、文字「Y」の下側の中央部分に1箇所、文字の右上部分と左上部分にそれぞれ1箇所ずつ存在する。また、文字を構成する線は、文字内で様々な数に分岐し得る。例えば、文字「Y」(図9(A)参照)は、中央部分で3つに分岐している。したがって、赤色オブジェクトが文字である場合には、第2の特定画素は、赤色オブジェクトの一部分に集中することなく、分散する可能性が高い。形状判定処理では、割合RTCを用いて判断することによって、囲み線でない赤色オブジェクト(例えば、文字)は囲み形状ではないと判断し、囲み線を示す赤色オブジェクトは囲み形状であると、適切に判断することができる。基準値THcは、例えば、実験的に設定される設計値であり、本実施例では、0.5に設定されている。   In subsequent step S360, the shape determining unit 353 calculates the ratio RTC of the second specific pixels located in the specific region ES with respect to all the second specific pixels. In step S365, the shape determination unit 353 determines whether or not the ratio RTC of the second specific pixel is equal to or greater than the reference value THc. When the ratio RTC of the second specific pixel is smaller than the reference value THc (step S365: NO), the shape determining unit 353 determines that the red object is not a surrounding shape (step S375). As described above, when the red object is a one-stroke outline, the second specific pixels are concentrated on a part of the red object, that is, near both ends of the one-stroke outline (that is, the specific area). Concentrate on ES). On the other hand, the ends of the lines constituting the character are distributed at a plurality of locations in the character. For example, there is one end of the character “Y” (see FIG. 9A) in the central portion below the character “Y”, and one in each of the upper right portion and the upper left portion of the character. Further, the lines constituting the character can be branched into various numbers within the character. For example, the letter “Y” (see FIG. 9A) branches into three at the central portion. Therefore, when the red object is a character, the second specific pixel is highly likely to be dispersed without being concentrated on a part of the red object. In the shape determination processing, it is determined that a red object (for example, a character) that is not a surrounding line is not a surrounding shape by making a determination using the ratio RTC, and it is appropriately determined that a red object indicating the surrounding line is a surrounding shape. can do. The reference value THc is, for example, a design value set experimentally, and is set to 0.5 in this embodiment.

第2の特定画素の割合RTcが、基準値THc以上である場合には(ステップS365:YES)、形状判定部353は、赤色オブジェクトは、囲み形状であると判定する(ステップS370)。   When the ratio RTc of the second specific pixel is equal to or greater than the reference value THc (step S365: YES), the shape determination unit 353 determines that the red object has a surrounding shape (step S370).

ここで、図10(B)の式に示すように、特定領域ESの幅EWは、枠領域FLの幅FW(図8(C))と同様に、解像度RSが大きいほど大きく、赤色オブジェクトの線幅LWが大きいほど大きく、オブジェクトサイズOBSが大きいほど大きく、設定されている。特定領域ESの幅EWが、オブジェクトサイズOBSに対して過度に大きい場合には、第2の特定画素が比較的広い範囲に広がって分布している場合であっても、割合RTCが基準値THc以上になる可能性がある。また、特定領域ESの幅EWが、オブジェクトサイズOBSに対して過度に小さい場合には、第2の特定画素が比較的狭い範囲に集中している場合であっても、割合RTCが基準値THc未満になる可能性がある。このため、特定領域ESは、オブジェクトサイズOBSに対して適切なサイズに設定されることが好ましい。赤色オブジェクトの線幅LWは、オブジェクトのサイズと相関があり、赤色オブジェクトが囲み線である場合に、オブジェクトのサイズが大きいほど、線幅LWが太くなる可能性が高いと考えられる。また、解像度RSが高いほど、1画素に対応する原稿上の寸法(例えば、300dpiである場合には、(1/300)インチ)が小さくなるので、画素数で示される特定領域ESの幅EWの値は、解像度RSが高いほど大きくされる。この結果、原稿上において想定される囲み線のサイズに応じた適切な特定領域ESの幅FW(画素数)を決定することができる。   Here, as shown in the equation of FIG. 10B, the width EW of the specific area ES is larger as the resolution RS is larger, as is the width FW of the frame area FL (FIG. 8C). The larger the line width LW is, the larger the object size OBS is. When the width EW of the specific area ES is excessively large with respect to the object size OBS, even if the second specific pixels are spread and distributed over a relatively wide range, the ratio RTC is the reference value THc. There is a possibility that Further, when the width EW of the specific area ES is excessively small with respect to the object size OBS, the ratio RTC is equal to the reference value THc even when the second specific pixels are concentrated in a relatively narrow range. Could be less. For this reason, it is preferable that the specific area ES is set to an appropriate size with respect to the object size OBS. The line width LW of the red object has a correlation with the size of the object, and when the red object is a surrounding line, it is considered that the larger the size of the object, the higher the possibility that the line width LW becomes thicker. Further, the higher the resolution RS, the smaller the dimension on the document corresponding to one pixel (for example, (1/300) inch in the case of 300 dpi), so the width EW of the specific area ES indicated by the number of pixels. The value of is increased as the resolution RS is higher. As a result, it is possible to determine an appropriate width FW (number of pixels) of the specific area ES according to the size of the encircled line assumed on the document.

ステップS370またはステップS375において、処理対象の赤色オブジェクトが囲み形状であるか否かが判定されると、形状判定処理は終了される。以上説明した形状判定処理において、処理対象の赤色オブジェクトが囲み形状であると判定するための条件は、以下の3つである。
(1)第1の特定画素の割合RT2が基準値THa以上であること(ステップS330)
(2)第3の特定画素の割合RT5が基準値THb未満であること(ステップS350)
(3)第2の特定画素の割合RTCが基準値THc以上であること(ステップS365)
If it is determined in step S370 or step S375 whether the red object to be processed has a surrounding shape, the shape determination process ends. In the shape determination process described above, there are the following three conditions for determining that the red object to be processed is a surrounding shape.
(1) The ratio RT2 of the first specific pixel is greater than or equal to the reference value THa (step S330).
(2) The ratio RT5 of the third specific pixel is less than the reference value THb (step S350).
(3) The ratio RTC of the second specific pixel is greater than or equal to the reference value THc (step S365).

上記実施例では、条件(1)が満たされる場合には、他の条件とは無関係に、赤色オブジェクトは囲み形状である、と判定される。また、条件(2)と条件(3)は、両方が満たされる場合に限り、条件(1)が満たされない場合であっても、赤色オブジェクトは囲み形状であると、判定される。このような条件(1)〜(3)の使い方は一例であり、これに限られない。例えば、基準値THa、THb、THcを大きめに設定するか小さめに設定するかなどに応じて、これらの条件(1)〜(3)の使い方は、変化し得る。例えば、条件(1)と条件(2)が満たされる場合と、条件(1)と条件(3)が満たされる場合と、の2つの場合には、赤色オブジェクトは囲み形状である、と判定され、それ以外の場合には、赤色オブジェクトは囲み形状でない、と判定されても良い。また、条件(1)〜(3)の全部が満たされる場合のみに、赤色オブジェクトは囲み形状である、と判定されても良い。また、条件(2)および(3)の一方または両方は、判定されなくても良い。例えば、条件(1)が満たされたと、条件(2)および条件(3)の少なくとも一方が満たされた場合に、赤色オブジェクトは囲み形状であると判定され、これ以外の場合に、赤色オブジェクトは囲み形状でないと判定されても良い。   In the above embodiment, when the condition (1) is satisfied, it is determined that the red object has a surrounding shape regardless of other conditions. Further, only when both the condition (2) and the condition (3) are satisfied, it is determined that the red object has a surrounding shape even when the condition (1) is not satisfied. Such usage of the conditions (1) to (3) is an example, and is not limited thereto. For example, depending on whether the reference values THa, THb, and THc are set larger or smaller, the usage of these conditions (1) to (3) can change. For example, it is determined that the red object has a surrounding shape in the two cases of the case where the condition (1) and the condition (2) are satisfied and the case where the condition (1) and the condition (3) are satisfied. In other cases, it may be determined that the red object is not a surrounding shape. Moreover, it may be determined that the red object has a surrounding shape only when all of the conditions (1) to (3) are satisfied. Moreover, one or both of the conditions (2) and (3) may not be determined. For example, when the condition (1) is satisfied, when at least one of the condition (2) and the condition (3) is satisfied, the red object is determined to have a surrounding shape, and otherwise, the red object is It may be determined that the shape is not a surrounding shape.

図5に戻って説明を続ける。ステップS250では、属性判断部360は、直前に実行された判定処理の判定条件が満たされたか否かを判断する。すなわち、直前に実行された判定処理が縦方向線判定処理(ステップS235)または横方向線判定処理(ステップS240)である場合には、当該判定処理において線であると判定されたか否かが判断される。また、直前に実行された判定処理が形状判定処理(ステップS245)である場合には、当該判定処理において囲み形状であると判定されたか否かが判断される。   Returning to FIG. In step S250, the attribute determination unit 360 determines whether the determination condition of the determination process executed immediately before is satisfied. That is, if the determination process executed immediately before is the vertical line determination process (step S235) or the horizontal line determination process (step S240), it is determined whether or not it is determined that the line is determined in the determination process. Is done. Further, when the determination process executed immediately before is the shape determination process (step S245), it is determined whether or not it is determined that the surrounding shape is determined in the determination process.

直前に実行された判定処理の判定条件が満たされた場合には(ステップS250:YES)、属性判断部360は、全ての判定処理が実行されたか否か、すなわち、縦方向線判定処理(ステップS235)と横方向線判定処理(ステップS240)と形状判定処理(ステップS245)とが全て実行されたか否か、を判断する(ステップS255)。実行されていない判定処理がある場合には(ステップS255:NO)、属性判断部360は、ステップS230に戻る。この結果、実行されていない判定処理のうち、実行順序が次の判定処理が実行される。なお、次にどの判定処理が実行されるかは、後述する処理順序決定処理にて決定される。全ての判定処理が実行された場合には(ステップS255:YES)、属性判断部360は、処理対象の赤色オブジェクトは、囲み線であると判断する(ステップS260)。   When the determination condition of the determination process executed immediately before is satisfied (step S250: YES), the attribute determination unit 360 determines whether all the determination processes have been executed, that is, the vertical line determination process (step It is determined whether all of S235), horizontal line determination processing (step S240), and shape determination processing (step S245) have been executed (step S255). If there is a determination process that has not been executed (step S255: NO), the attribute determination unit 360 returns to step S230. As a result, among the determination processes that are not executed, the determination process having the next execution order is executed. Note that which determination process is executed next is determined by a process order determination process described later. If all the determination processes have been executed (step S255: YES), the attribute determination unit 360 determines that the red object to be processed is a surrounding line (step S260).

一方、直前に実行された判定処理の判定条件が満たされない場合には(ステップS250:NO)、属性判断部360は、処理対象の赤色オブジェクトは、囲み線でないと判断する(ステップS265)。   On the other hand, when the determination condition of the determination process executed immediately before is not satisfied (step S250: NO), the attribute determination unit 360 determines that the red object to be processed is not a surrounding line (step S265).

ステップS270では、画像処理部300は、全ての赤色オブジェクトが選択済みであるか否かを判断する。未選択の赤色オブジェクトがある場合には(ステップS270:NO)、画像処理部300は、ステップS205に戻って、未選択の赤色オブジェクトを選択して、上述したステップS205〜S265までの処理を繰り返す。全ての赤色オブジェクトが選択された場合には(ステップS270:YES)、画像処理部300は、オブジェクト判定処理を終了する。   In step S270, the image processing unit 300 determines whether all red objects have been selected. If there is an unselected red object (step S270: NO), the image processing unit 300 returns to step S205, selects the unselected red object, and repeats the processing from step S205 to S265 described above. . If all red objects have been selected (step S270: YES), the image processing unit 300 ends the object determination process.

以上の説明から解るように、処理対象の赤色オブジェクトが単色であると判定された場合(ステップS215:NO)には、以下の3つの判定条件(A)〜(C)がそれぞれ判断される。当該3つの判定条件が全て満たされた場合には、赤色オブジェクトは、囲み線であると判断される。以下の3つの条件(A)〜(C)のうち、少なくとも1つの判定条件が満たされない場合には、赤色オブジェクトは、囲み線でないと判断される。   As understood from the above description, when it is determined that the red object to be processed is a single color (step S215: NO), the following three determination conditions (A) to (C) are respectively determined. When all the three determination conditions are satisfied, the red object is determined to be a surrounding line. If at least one of the following three conditions (A) to (C) is not satisfied, the red object is determined not to be a surrounding line.

(A)縦方向線判定処理(ステップS235)で線であると判定されること
(B)横方向線判定処理(ステップS240)で線であると判定されること
(C)形状判定処理(ステップS245)で囲み線であると判定されること
(A) It is determined as a line in the vertical direction line determination process (step S235) (B) It is determined as a line in the horizontal direction line determination process (step S240) (C) Shape determination process (step It is determined that it is a surrounding line in S245)

この説明から解るように、本実施例では、赤色オブジェクトが囲み線であると判定される場合には、3つの判定処理(解析処理)が実行されるが、赤色オブジェクトが囲み線でないと判定される場合には、3つの判定処理の全てが実行されない場合がある。すなわち、3つの判定処理のうち、先行して実行される判定処理(例えば、第1の解析処理としての線判定処理)において判定条件が満たされない場合には、解析処理部350は、残りの判定処理(例えば、第2の解析処理としての形状判定処理)を実行せず、属性判断部360は、先行して実行された判定処理の処理結果に基づいて、赤色オブジェクトは囲み線でないと判断する。   As will be understood from this description, in this embodiment, when it is determined that the red object is an encircling line, three determination processes (analysis processes) are performed, but it is determined that the red object is not an encircling line. In some cases, all three determination processes may not be executed. That is, when the determination condition is not satisfied in the determination process executed in advance among the three determination processes (for example, the line determination process as the first analysis process), the analysis processing unit 350 determines the remaining determinations. Processing (for example, shape determination processing as the second analysis processing) is not executed, and the attribute determination unit 360 determines that the red object is not a surrounding line based on the processing result of the determination processing executed in advance. .

ここで、本実施例では、ステップS220の処理順序決定処理において、3つの判定処理の処理順序を適切に決定することによって、オブジェクト判定処理の処理時間の低減を図っている。以下、処理順序決定処理の詳細を説明する。   In this embodiment, the processing time of the object determination process is reduced by appropriately determining the processing order of the three determination processes in the process order determination process of step S220. Details of the processing order determination process will be described below.

図11は、処理順序決定処理のフローチャートである。図6(A)、図8(A)に示すように、二値画像60A内の囲み線66A(図3(B))が処理対象の赤色オブジェクトである場合を例に説明する。ステップS221では、処理時間判断部330は、処理対象の赤色オブジェクトに外接する矩形領域SI1の内部に含まれる画素数(H×W)を算出する。Hは、矩形領域SI1の縦方向(Y方向)の画素数を表している。Wは、矩形領域SI1の横方向(X方向)の画素数を表している。   FIG. 11 is a flowchart of processing order determination processing. As shown in FIGS. 6A and 8A, an example will be described in which a surrounding line 66A (FIG. 3B) in the binary image 60A is a red object to be processed. In step S221, the processing time determination unit 330 calculates the number of pixels (H × W) included in the rectangular area SI1 circumscribing the red object to be processed. H represents the number of pixels in the vertical direction (Y direction) of the rectangular area SI1. W represents the number of pixels in the horizontal direction (X direction) of the rectangular area SI1.

ステップS222では、処理時間判断部330は、処理対象の赤色オブジェクトを構成する赤色オブジェクト画素の個数Sを算出する。図6(A)、図8(A)の例では、囲み線66Aを構成する画素(黒色の部分の画素)の個数が、赤色オブジェクト画素の個数Sとして算出される。   In step S222, the processing time determination unit 330 calculates the number S of red object pixels constituting the red object to be processed. In the examples of FIGS. 6A and 8A, the number of pixels (black part pixels) constituting the surrounding line 66A is calculated as the number S of red object pixels.

ステップS223では、処理時間判断部330は、形状判定処理で用いられる枠領域FL(図8(B))の画素数Mを算出する。図8(B)を参照して説明したように、枠領域FL内に含まれる画素数Mは、枠領域FLのX方向およびY方向の幅(画素数)FWに基づいて、M={(FW×4)−4}の式によって算出される。   In step S223, the processing time determination unit 330 calculates the number M of pixels in the frame region FL (FIG. 8B) used in the shape determination process. As described with reference to FIG. 8B, the number M of pixels included in the frame region FL is based on the width (number of pixels) FW in the X direction and the Y direction of the frame region FL. FW × 4) −4}.

図11において破線で示すステップS224は、実施例では実行されない。ステップSS224については、変形例として後述する。   Step S224 indicated by a broken line in FIG. 11 is not executed in the embodiment. Step SS224 will be described later as a modified example.

ステップS225では、処理時間判断部330は、線判定処理の処理時間は、形状判定処理の処理時間未満であるか否かを判断する。本ステップの判断において、線判定処理の処理時間を評価する評価値には、ステップS221にて算出された矩形領域SI1内の画素数(H×W)が用いられる。上述したように、線判定処理(横方向線判定処理と縦方向線判定処理)は、矩形領域SI1内の全ての画素を処理対象として実行される処理である。したがって、線判定処理の処理時間は、矩形領域SI1内の画素数(H×W)に概ね比例すると考えられる。また、形状判定処理の処理時間を評価する評価値には、ステップS222にて算出された赤色オブジェクト画素の個数Sと、ステップS223にて算出された枠領域FLの画素数Mと、の積(S×M)が用いられる。上述したように、形状判定処理は、S個の赤色オブジェクト画素のそれぞれに枠領域FLを設定し、S個の枠領域FLのそれぞれのM個の画素を処理対象とする処理である。したがって、形状判定処理の処理時間は、赤色オブジェクト画素の個数Sと、枠領域FLの画素数Mと、の積(S×M)に概ね比例すると考えられる。   In step S225, the processing time determination unit 330 determines whether or not the processing time of the line determination process is less than the processing time of the shape determination process. In the determination of this step, the number of pixels (H × W) in the rectangular area SI1 calculated in step S221 is used as the evaluation value for evaluating the processing time of the line determination process. As described above, the line determination process (the horizontal direction line determination process and the vertical direction line determination process) is a process that is executed on all the pixels in the rectangular area SI1. Therefore, the processing time of the line determination process is considered to be approximately proportional to the number of pixels (H × W) in the rectangular area SI1. The evaluation value for evaluating the processing time of the shape determination process is a product of the number S of red object pixels calculated in step S222 and the number M of pixels in the frame area FL calculated in step S223 ( S × M) is used. As described above, the shape determination process is a process in which a frame region FL is set for each of the S red object pixels, and each of the M pixels in the S frame region FL is a processing target. Therefore, it is considered that the processing time of the shape determination process is approximately proportional to the product (S × M) of the number S of red object pixels and the number M of pixels in the frame region FL.

処理時間判断部330は、(H×W)の値が、(S×M)の値未満である場合には、線判定処理の処理時間は、形状判定処理の処理時間未満であると判断する。処理時間判断部330は、(H×W)の値が、(S×M)の値以上である場合には、線判定処理の処理時間は、形状判定処理の処理時間以上であると判断する。   When the value of (H × W) is less than the value of (S × M), the processing time determination unit 330 determines that the processing time of the line determination process is less than the processing time of the shape determination process. . When the value of (H × W) is equal to or greater than the value of (S × M), the processing time determination unit 330 determines that the processing time of the line determination process is equal to or greater than the processing time of the shape determination process. .

線判定処理の処理時間が、形状判定処理の処理時間未満であると判断される場合には(ステップS225:YES)、処理時間判断部330は、線判定処理を先行処理に決定する(ステップS226)。すなわち、形状判定処理に先行して、線判定処理を実行するように処理順序が決定される。また、処理時間判断部330は、線判定処理の処理時間が、形状判定処理の処理時間以上であると判断される場合には(ステップS225:NO)、処理時間判断部330は、形状処理を先行処理に決定する(ステップS227)。すなわち、線判定処理に先行して、形状判定処理を実行するように処理順序が決定される。   When it is determined that the processing time of the line determination process is less than the processing time of the shape determination process (step S225: YES), the processing time determination unit 330 determines the line determination process as a preceding process (step S226). ). That is, prior to the shape determination process, the processing order is determined so as to execute the line determination process. In addition, when it is determined that the processing time of the line determination processing is equal to or longer than the processing time of the shape determination processing (step S225: NO), the processing time determination unit 330 performs the shape processing. The preceding process is determined (step S227). That is, prior to the line determination process, the processing order is determined so as to execute the shape determination process.

以上説明した処理順序決定処理によれば、判定処理(解析処理)の処理時間に応じて、線判定処理と、形状判定処理、のうち、処理時間が短いと判断される処理が先行して実行される。したがって、先行して実行された判定処理が判定条件を満たさない場合には、処理時間が長い判定処理を実行することなく、赤色オブジェクトは囲み線でないと判断される。例えば、線判定処理が先行して実行された結果、赤色オブジェクトが線でないと判定された場合には、赤色オブジェクトは、形状判定処理とは無関係に囲み線でないと判断される。逆に、形状判定処理が先行して実行された結果、赤色オブジェクトが囲み形状でないと判定された場合には、赤色オブジェクトは、線判定処理とは無関係に囲み線でないと判断される。この結果、線判定処理と形状判定処理のうち、処理時間が長い処理が実行されることなく、赤色オブジェクトが囲み線であるか否かを判断できる可能性が高くなる。したがって、赤色オブジェクトが囲み線であるか否かを判断するための解析処理の処理時間を低減することができる。   According to the processing order determination processing described above, processing that is determined to have a short processing time among the line determination processing and the shape determination processing is executed in advance according to the processing time of the determination processing (analysis processing). Is done. Therefore, when the determination process executed in advance does not satisfy the determination condition, it is determined that the red object is not a surrounding line without executing the determination process with a long processing time. For example, if it is determined that the red object is not a line as a result of the line determination process being executed in advance, the red object is determined not to be a surrounding line regardless of the shape determination process. Conversely, if the red object is determined not to be a surrounding shape as a result of the shape determination process being executed in advance, it is determined that the red object is not a surrounding line regardless of the line determination process. As a result, there is a high possibility that it is possible to determine whether or not the red object is a surrounding line without executing a process having a long processing time among the line determination process and the shape determination process. Therefore, it is possible to reduce the processing time of the analysis process for determining whether or not the red object is a surrounding line.

さらに、処理時間判断部330は、線判定処理の処理対象である画素の個数に応じた第1の値を用いて、線判定処理の処理時間を判断し、形状判定処理の処理対象である画素の個数に応じた第2の値を用いて、形状判定処理の処理時間を判断する。この結果、線判定処理の処理時間と、形状判定処理の処理時間と、を適切に判断することができる。   Furthermore, the processing time determination unit 330 determines the processing time of the line determination process using the first value corresponding to the number of pixels that are the target of the line determination process, and the pixel that is the target of the shape determination process. The processing time of the shape determination process is determined using the second value corresponding to the number of the images. As a result, it is possible to appropriately determine the processing time of the line determination process and the processing time of the shape determination process.

より具体的には、線判定処理は、赤色オブジェクトを含む矩形領域内の複数個の画素に対する処理を含むので、第1の値には、矩形領域内の画素の個数に応じた値(H×W)が用いられる。また、形状判定処理は、赤色オブジェクトを構成する複数個の画素に対する処理を含むので、第2の値には、オブジェクトを構成する画素の個数に応じた値(S×M)が用いられる。この結果、線判定処理と、形状判定処理との、それぞれの処理内容に応じて、第1の解析処理と第2の処理時間を適切に判断できる。   More specifically, since the line determination processing includes processing for a plurality of pixels in the rectangular area including the red object, the first value includes a value (H × W) is used. Since the shape determination process includes a process for a plurality of pixels constituting the red object, a value (S × M) corresponding to the number of pixels constituting the object is used as the second value. As a result, the first analysis process and the second processing time can be appropriately determined according to the contents of the line determination process and the shape determination process.

例えば、図6(A)に示す囲み線66Aのような線状のオブジェクトが赤色オブジェクトである場合と、図6(B)に示す描画の部分オブジェクト68Aのような線状でないオブジェクトが赤色オブジェクトである場合と、を比較する。線状のオブジェクトは、図6(A)の例のように、外接する矩形領域の画素数(H×W)と比較して、オブジェクト領域の画素数Sが大幅に少ない場合がある((H×W)>>S)。この場合には、(H×W)>(S×M)が成立するので、形状判定処理の処理時間が、線判定処理の処理時間より短くなると判断される。一方、図6(B)に示す描画の部分オブジェクト68Aのような線状でないオブジェクトは、外接する矩形領域の画素数(H×W)と、オブジェクト領域の画素数Sと、の差が、比較的小さい場合がある。図6(B)の例では、外接する矩形領域SI1のほとんどがオブジェクト画素で占められているので、矩形領域の画素数(H×W)と、オブジェクト領域の画素数Sと、の差が、比較的小さいことが解る。この場合には、(H×W)<(S×M)が成立するので、形状判定処理の処理時間が、線判定処理の処理時間より短くなると判断される。   For example, a linear object such as a surrounding line 66A shown in FIG. 6A is a red object, and a non-linear object such as a drawing partial object 68A shown in FIG. 6B is a red object. Compare with the case. As in the example of FIG. 6A, the linear object may have a significantly smaller number of pixels S in the object area than the number of pixels (H × W) in the circumscribed rectangular area ((H × W) >> S). In this case, since (H × W)> (S × M) is established, it is determined that the processing time of the shape determination process is shorter than the processing time of the line determination process. On the other hand, a non-linear object such as the drawing partial object 68A shown in FIG. 6B has a difference between the number of pixels in the circumscribed rectangular area (H × W) and the number of pixels S in the object area. May be small. In the example of FIG. 6B, since most of the circumscribed rectangular area SI1 is occupied by object pixels, the difference between the number of pixels in the rectangular area (H × W) and the number of pixels S in the object area is It can be seen that it is relatively small. In this case, since (H × W) <(S × M) is established, it is determined that the processing time of the shape determination process is shorter than the processing time of the line determination process.

図2に戻って説明を続ける。オブジェクト判定処理が終了すると、続くステップS150(図2)では、特定された囲み線(囲み線であると判定された赤色オブジェクト)の中から、1個の囲み線を処理対象として選択する。図3の例では、1個の囲み線66A(図3(B))のみが特定されているので、当該囲み線66Aが選択される。   Returning to FIG. 2, the description will be continued. When the object determination processing is completed, in the subsequent step S150 (FIG. 2), one surrounding line is selected as a processing target from among the specified surrounding lines (red object determined to be the surrounding line). In the example of FIG. 3, since only one surrounding line 66A (FIG. 3B) is specified, the surrounding line 66A is selected.

ステップS155では、画像処理部300の除去処理部370は、除去対象のオブジェクトを含む部分画像データを生成する。具体的には、除去処理部370は、二値画像60Aにおいて、処理対象の囲み線66に外接する外接矩形OS1(図3(B))を特定する。除去処理部370は、当該外接矩形OS1に対応する部分画像PSI(図3(A))を、スキャン画像60から切り出すことによって、部分画像PSIを表す部分画像データを生成する。   In step S155, the removal processing unit 370 of the image processing unit 300 generates partial image data including the object to be removed. Specifically, the removal processing unit 370 identifies a circumscribed rectangle OS1 (FIG. 3B) circumscribing the processing target enclosing line 66 in the binary image 60A. The removal processing unit 370 generates partial image data representing the partial image PSI by cutting out the partial image PSI (FIG. 3A) corresponding to the circumscribed rectangle OS1 from the scan image 60.

図12は、部分画像PSIの一例(図12(A))と、部分二値画像PBIの一例(図12(B))を示す図である。図12に示すように、部分画像PSIは、囲み線66と、描画65を、オブジェクトとして含んでいる。   FIG. 12 is a diagram illustrating an example of the partial image PSI (FIG. 12A) and an example of the partial binary image PBI (FIG. 12B). As shown in FIG. 12, the partial image PSI includes a surrounding line 66 and a drawing 65 as objects.

ステップS160では、除去処理部370は、部分画像PSI内のオブジェクトを特定するために、部分画像データに対して二値化処理を実行して、部分二値画像データを生成する。具体的には、部分画像データは、背景を構成する背景画素と、オブジェクトを構成するオブジェクト画素と、に二値化される。例えば、除去処理部370は、例えば、囲み線66A(図3(B))の近傍に位置する複数個の画素、例えば、囲み線66Aの外側に位置する複数個の画素であって、囲み線66Aに沿って配置された複数個の画素の値の平均値(Rave2、Gave2、Bave2)を、二値化のための基準の色として算出する。あるいは、除去処理部370は、スキャン画像60において、部分画像PSIの外側に位置する画素であって、部分画像PSIの外縁に沿って配置された複数個の画素の値の平均値(Rave2、Gave2、Bave2)を、二値化のための基準の色として算出する。そして、除去処理部370は、(Rave2−ΔV2)≦R≦(Rave2+ΔV2)、かつ、(Gave2−ΔV2)≦G≦(Gave2+ΔV2)、かつ、(Bave2−ΔV2)≦B≦(Bave2+ΔV2)を満たす画素値(RGB値)を有する画素を背景画素に分類し、背景画素と決定すべき画素以外の画素をオブジェクト画素に分類する。除去処理部370は、部分画像PSIに含まれる全ての画素を、背景画素とオブジェクト画素とのいずれかに分類することによって、部分二値画像データを生成する。   In step S160, the removal processing unit 370 performs binarization processing on the partial image data in order to identify an object in the partial image PSI, and generates partial binary image data. Specifically, the partial image data is binarized into a background pixel constituting the background and an object pixel constituting the object. For example, the removal processing unit 370 includes, for example, a plurality of pixels located near the surrounding line 66A (FIG. 3B), for example, a plurality of pixels located outside the surrounding line 66A. An average value (Rave2, Gave2, Bave2) of a plurality of pixels arranged along 66A is calculated as a reference color for binarization. Alternatively, the removal processing unit 370 is an average value (Rave2, Gave2) of a plurality of pixels that are located outside the partial image PSI in the scan image 60 and are arranged along the outer edge of the partial image PSI. , Bave2) is calculated as a reference color for binarization. Then, the removal processing unit 370 satisfies (Rave 2 −ΔV 2) ≦ R ≦ (Rave 2 + ΔV 2), (Gave 2 −ΔV 2) ≦ G ≦ (Gave 2 + ΔV 2), and (Bave 2 −ΔV 2) ≦ B ≦ (Bave 2 + ΔV 2) Pixels having values (RGB values) are classified as background pixels, and pixels other than the pixels to be determined as background pixels are classified as object pixels. The removal processing unit 370 generates partial binary image data by classifying all pixels included in the partial image PSI as either background pixels or object pixels.

ステップS165では、除去処理部370は、生成された部分二値画像データを用いて、オブジェクトを特定して、特定されたオブジェクトに識別子を付すラベリングを実行する。ラベリングの結果、例えば、オブジェクトと、識別子とを、対応付けたラベルデータが生成される。   In step S165, the removal processing unit 370 identifies an object using the generated partial binary image data, and performs labeling that adds an identifier to the identified object. As a result of labeling, for example, label data in which an object is associated with an identifier is generated.

具体的には、除去処理部370は、連続する(互いに隣接する)1個以上のオブジェクト画素で構成される1個の領域を、1個のオブジェクトとして特定する。図12(B)の例では、部分二値画像PBIにおいて、オブジェクト画素によって構成されるオブジェクトとして、囲み線66Dと、描画65Dと、が特定され、これらのオブジェクトのそれぞれに、互いに異なる識別子が付される。なお、部分二値画像PBI内に特定されるオブジェクトには、ステップS150で選択された処理対象の囲み線が含まれる。囲み線を表すオブジェクトには、例えば、囲み線であることが認識できるように、他のオブジェクトとは異なる特別な識別子が付される。   Specifically, the removal processing unit 370 identifies one area composed of one or more consecutive (adjacent) object pixels as one object. In the example of FIG. 12B, in the partial binary image PBI, a surrounding line 66D and a drawing 65D are specified as objects configured by object pixels, and different identifiers are assigned to these objects. Is done. Note that the object specified in the partial binary image PBI includes the processing target enclosure selected in step S150. For example, a special identifier different from other objects is attached to the object representing the surrounding line so that the object can be recognized as the surrounding line.

オブジェクトが特定されると、続くステップS170では、除去処理部370は、部分二値画像PBIに含まれる囲み線以外のオブジェクトが、囲み線に内包されているか否かを判定する内包関係判定処理を実行する。   When the object is specified, in subsequent step S170, the removal processing unit 370 performs inclusion relation determination processing for determining whether or not an object other than the enclosure line included in the partial binary image PBI is included in the enclosure line. Run.

図13は、内包関係判定処理のフローチャートである。ステップS405では、除去処理部370は、部分二値画像PBI内に特定されたオブジェクトの中から囲み線以外のオブジェクトを処理対象として選択する。図12(B)の例では、描画65Dが、処理対象のオブジェクトとして選択される。   FIG. 13 is a flowchart of the inclusion relationship determination process. In step S405, the removal processing unit 370 selects an object other than the enclosing line as a processing target from among the objects specified in the partial binary image PBI. In the example of FIG. 12B, the drawing 65D is selected as the object to be processed.

ステップS410では、除去処理部370は、図12(B)に示すように、4本の判定線A1〜A4を設定する。4本の判定線A1〜A4は、処理対象のオブジェクト(具体的には、描画65D)の重心CCを基点として、上方向(−Y方向)、下方向(+Y方向)、左方向(−X方向)、右方向(+X方向)にそれぞれ延びる半直線である。   In step S410, the removal processing unit 370 sets four determination lines A1 to A4 as shown in FIG. The four determination lines A1 to A4 are based on the center of gravity CC of the object to be processed (specifically, the drawing 65D) as an origin, upward (−Y direction), downward (+ Y direction), and left direction (−X Direction) and rightward (+ X direction).

ステップS415では、除去処理部370は、4本の判定線A1〜A4のそれぞれと、囲み線66Dと、の交点の個数(交点数Mx)を、判定線ごとに特定する。具体的には、除去処理部370は、部分二値画像PBIにおいて、処理対象の判定線上の画素を、基点(重心CC)から外側に向かって順次に走査する。そして、除去処理部370は、判定線上に検出された交点の数をカウントする。例えば、図12(B)の例では、4本の判定線A1〜A4のそれぞれと、囲み線66Dとは、1個ずつ交点CP1〜CP4を有することが解る。   In step S415, the removal processing unit 370 specifies the number of intersections (intersection number Mx) between each of the four determination lines A1 to A4 and the surrounding line 66D for each determination line. Specifically, the removal processing unit 370 sequentially scans pixels on the determination line to be processed from the base point (center of gravity CC) toward the outside in the partial binary image PBI. Then, the removal processing unit 370 counts the number of intersection points detected on the determination line. For example, in the example of FIG. 12B, it can be seen that each of the four determination lines A1 to A4 and the surrounding line 66D have one intersection point CP1 to CP4.

ステップS420では、除去処理部370は、交点数Mxが奇数であるか否かを判定線ごとに判断し、4本の判定線A1〜A4のうち、交点数Mxが奇数である判定線(以下、奇数判定線と呼ぶ)の数LInを特定する。図12(B)の例では、4本の判定線A1〜A4の交点数Mxは、全て「1」であるので、奇数判定線LInの数は「4」である。   In step S420, the removal processing unit 370 determines, for each determination line, whether or not the intersection number Mx is an odd number, and among the four determination lines A1 to A4, a determination line (hereinafter referred to as the intersection number Mx is an odd number). The number LIn). In the example of FIG. 12B, since the number Mx of intersections of the four determination lines A1 to A4 is all “1”, the number of odd number determination lines LIn is “4”.

ステップS425では、除去処理部370は、奇数判定線の数LInが3以上であるか否かを判断する。奇数判定線の数LInが3以上である場合には(ステップS425:YES)、除去処理部370は、処理対象のオブジェクトは、囲み線66Dに内包されていると判定する(ステップS430)。奇数判定線の数LInが3未満である場合には(ステップS425:NO)、除去処理部370は、処理対象のオブジェクトは、囲み線66Dに内包されていないと判定する(ステップS435)。   In step S425, the removal processing unit 370 determines whether or not the number of odd determination lines LIn is 3 or more. When the number LIn of the odd number determination lines is 3 or more (step S425: YES), the removal processing unit 370 determines that the object to be processed is included in the surrounding line 66D (step S430). When the number LIn of the odd number determination lines is less than 3 (step S425: NO), the removal processing unit 370 determines that the object to be processed is not included in the surrounding line 66D (step S435).

囲み線66Dが閉曲線であり、判定線の終点(部分二値画像PBIの画像の端)は、閉曲線の外側にあると仮定する。判定線の基点から終点に向かって走査する場合に、囲み線66Dとの交点を通過する度に、判定線上の注目点(走査位置)の内外関係が変化する。内外関係が変化するとは、注目点の位置が、囲み線の内側から外側に変化する、あるいは、囲み線の外側から内側に変化することを意味する。したがって、判定線の基点が囲み線の内側に位置する場合には、判定線の基点から終点までの間の交点数Mxは、終点が必ず囲み線の外側に位置することを考慮すると、奇数になることが解る。   It is assumed that the surrounding line 66D is a closed curve, and the end point of the determination line (the end of the image of the partial binary image PBI) is outside the closed curve. When scanning from the base point of the determination line toward the end point, the internal / external relationship of the point of interest (scanning position) on the determination line changes every time it passes through the intersection with the surrounding line 66D. The change in the internal / external relationship means that the position of the attention point changes from the inside to the outside of the surrounding line, or changes from the outside to the inside of the surrounding line. Accordingly, when the base point of the determination line is located inside the enclosing line, the number of intersections Mx between the base point of the determination line and the end point is an odd number considering that the end point is always located outside the enclosing line. I understand that

逆に、判定線の基点が囲み線の外側に位置する場合には、判定線の基点から終点までの間の交点数Mxは、偶数になることが解る。例えば、仮に、囲み線66Dの外側に位置するサンプル点SP1(図12(B))から上下左右方向にそれぞれ延びる4本の判定線A5〜A8を考える。2本の判定線A5、A7は、それぞれ囲み線66Dとの間に、2個の交点を有する(図12(B)のCP5〜CP8)。一方、他の2本の判定線A6、A8は、いずれも囲み線66Dとの間に交点を有さない(0個の交点を有する)。このように、囲み線66Dの外側に位置するサンプル点SP1を基点とする判定線の基点から終点までの間の交点数Mxは、偶数(この例では、0または2)である。   Conversely, when the base point of the determination line is located outside the encircling line, it is understood that the number of intersection points Mx between the base point of the determination line and the end point is an even number. For example, let us consider four determination lines A5 to A8 respectively extending in the vertical and horizontal directions from the sample point SP1 (FIG. 12B) located outside the surrounding line 66D. The two determination lines A5 and A7 each have two intersections with the surrounding line 66D (CP5 to CP8 in FIG. 12B). On the other hand, neither of the other two determination lines A6 and A8 has an intersection with the surrounding line 66D (has 0 intersections). As described above, the number of intersection points Mx between the base point and the end point of the determination line with the sample point SP1 positioned outside the surrounding line 66D as the base point is an even number (in this example, 0 or 2).

このように、処理対象のオブジェクト上を基点とする判定線を設定すれば、判定線と囲み線との交点数Mxに基づいて、処理対象のオブジェクトが、囲み線に内包されている(囲み線の内側にある)か否かを、判定することができる。ここで、4本の判定線A1〜A4を設定し、交点数Mxが奇数である判定線が3以上である場合に、処理対象のオブジェクトが囲み線に内包されていると判断している理由を説明する。これは、例外的に、処理対象のオブジェクトが囲み線に内包されている場合でも、交点数Mxが偶数になる場合があり得るからである。例えば、囲み線66Dは、手書きで記入されることを想定しているので、図12(B)に示すように、一筆書きの両端部の近傍に隙間BTが生じる場合がある。仮に、図12(B)の下方向の判定線A2が、隙間BTを通ると、判定線A2の交点数Mxは、0(偶数)になってしまうことが解る。このような場合に、例えば、1本の判定線に基づいて判定を行うとすれば、誤った判定結果となり得ることは明らかである。本実施例では、4本の判定線のうちの奇数判定線の数LInが、3個以上であるか否かに基づいているので、例外的に、1個の判定線の交点数Mxが偶数になった場合であっても適切に内包関係を判定することができる。   In this way, if a determination line having a base point on the processing target object is set, the processing target object is included in the surrounding line based on the intersection number Mx of the determination line and the surrounding line (the surrounding line). Can be determined). Here, when four determination lines A1 to A4 are set and the number of intersection points Mx is an odd number is 3 or more, it is determined that the object to be processed is included in the enclosing line Will be explained. This is because, as an exception, even when the object to be processed is included in the enclosing line, the intersection number Mx may be an even number. For example, since the encircling line 66D is assumed to be written by handwriting, a gap BT may be generated in the vicinity of both ends of one-stroke writing as shown in FIG. If the determination line A2 in the downward direction in FIG. 12B passes through the gap BT, it can be seen that the intersection number Mx of the determination line A2 becomes 0 (even). In such a case, for example, if the determination is made based on one determination line, it is clear that an erroneous determination result can be obtained. In this embodiment, since the number LIn of the odd number judgment lines among the four judgment lines is based on whether or not it is 3 or more, the number of intersections Mx of one judgment line is exceptionally even. Even in such a case, the inclusion relationship can be appropriately determined.

ステップS440では、除去処理部370は、囲み線以外の全てのオブジェクトが処理対象として選択済みであるか否かを判断する。未選択のオブジェクトがある場合には(ステップS440:NO)、除去処理部370は、ステップS405に戻って、未選択のオブジェクトを選択して、上述したステップS405〜S440までの処理を繰り返す。全てのオブジェクトが選択された場合には(ステップS440:YES)、除去処理部370は、内包関係判定処理を終了する。   In step S440, the removal processing unit 370 determines whether all objects other than the enclosing line have been selected as processing targets. If there is an unselected object (step S440: NO), the removal processing unit 370 returns to step S405, selects the unselected object, and repeats the processing from step S405 to S440 described above. If all the objects have been selected (step S440: YES), the removal processing unit 370 ends the inclusion relationship determination process.

内包関係判定処理が終了すると、続くステップS175(図2)では、除去処理部370は、囲み線66と、囲み線66に内包されていると判定されたオブジェクトとを、スキャン画像60(図3(A))から除去するオブジェクト除去処理を実行する。除去処理部370は、部分二値画像PBI(図12(B))に基づいて、スキャン画像60上において、囲み線66と、囲み線66に内包されているオブジェクト(描画65)と、を構成する複数個の画素を特定する。除去処理部370は、特定された複数個の画素の画素値を、スキャン画像60の背景の色を表す画素値に変更する。背景の色を表す画素値は、例えば、原稿の用紙の色(白)を表す画素値であり、ステップS160(図2)にて算出された二値化のための基準の色を表す画素値(Rave2、Gave2、Bave2)が用いられる。これによって、スキャン画像60から、囲み線66と描画65とが除去された処理済み画像60C(図3(C))を表す処理済みの画像データが生成される。   When the inclusion relation determination process is completed, in the subsequent step S175 (FIG. 2), the removal processing unit 370 converts the surrounding line 66 and the object determined to be included in the surrounding line 66 into the scanned image 60 (FIG. 3). The object removal process to be removed from (A)) is executed. Based on the partial binary image PBI (FIG. 12B), the removal processing unit 370 configures a surrounding line 66 and an object (drawing 65) included in the surrounding line 66 on the scan image 60. A plurality of pixels to be identified are specified. The removal processing unit 370 changes the pixel values of the specified plurality of pixels to pixel values representing the background color of the scanned image 60. The pixel value representing the background color is, for example, a pixel value representing the color (white) of the original paper, and a pixel value representing the reference color for binarization calculated in step S160 (FIG. 2). (Rave2, Gave2, Bave2) are used. Thus, processed image data representing the processed image 60C (FIG. 3C) from which the surrounding line 66 and the drawing 65 are removed is generated from the scanned image 60.

ステップS180では、画像処理部300は、全ての囲み線が選択済みであるか否かを判断する。未選択の囲み線がある場合には(ステップS180:NO)、画像処理部300は、ステップS150に戻って、未選択の囲み線を選択して、上述したステップS150〜S180までの処理を繰り返す。全ての囲み線が選択された場合には(ステップS180:YES)、画像処理部300は、処理済みの画像データを、スキャンデータ(対象画像データ)の送信元である複合機200に対して送信して(ステップS185)、処理を終了する。   In step S180, the image processing unit 300 determines whether all the surrounding lines have been selected. If there is an unselected enclosing line (step S180: NO), the image processing unit 300 returns to step S150, selects an unselected enclosing line, and repeats the processes from steps S150 to S180 described above. . When all the encircling lines are selected (step S180: YES), the image processing unit 300 transmits the processed image data to the MFP 200 that is the transmission source of the scan data (target image data). (Step S185), and the process is terminated.

複合機200の画像データ送受信部115は、サーバ400から処理済みの画像データを受信すると、例えば、当該画像データを、不揮発性記憶装置230に格納して処理を終了する。この処理済みの画像データは、例えば、プリンタ部240を用いて、処理済みの画像データによって表される画像を用紙に印刷するために用いられる。   When receiving the processed image data from the server 400, the image data transmission / reception unit 115 of the multifunction device 200 stores the image data in the nonvolatile storage device 230, for example, and ends the processing. This processed image data is used, for example, to print an image represented by the processed image data on a sheet using the printer unit 240.

以上説明した本実施例の画像処理によれば、利用者は、所望のオブジェクトを赤色のペンで記入した囲み線で囲んだ原稿を、複合機200のスキャナ部250に読み取らせることによって、原稿から所望のオブジェクトが除去された画像を表す画像データを取得することができる。なお、囲み線は、除去すべきオブジェクトの指定以外にも用いられ得る。例えば、画像処理部300は、オブジェクト除去処理(ステップS175)に代えて、囲み線で囲まれたオブジェクトを表す画像だけを含み、囲み線で囲まれていないオブジェクトを除去した画像を表す画像データを生成する処理を実行しても良い。一般的に言えば、囲み線によって囲まれたオブジェクトを特定し、特定されたオブジェクトを含む部分画像を表す部分画像データを用いて、所定の画像処理を実行するために、囲み線は用いられ得る。   According to the image processing of the present embodiment described above, the user reads a document surrounded by a box line in which a desired object is filled with a red pen by causing the scanner unit 250 of the multifunction device 200 to read the document. Image data representing an image from which a desired object has been removed can be acquired. Note that the surrounding line can be used in addition to the designation of the object to be removed. For example, instead of the object removal process (step S175), the image processing unit 300 includes only image data representing an object surrounded by a surrounding line, and image data representing an image obtained by removing an object not surrounded by the surrounding line. You may perform the process to produce | generate. Generally speaking, an encircling line can be used to identify an object enclosed by an encircling line and perform predetermined image processing using partial image data representing a partial image including the identified object. .

さらに、本実施例のオブジェクト判定処理によれば、オブジェクトを構成する複数個の特定画素(具体的には赤色オブジェクト画素)のそれぞれに設定される枠領域FL(図8)に基づいて、赤色オブジェクトが囲み線であるか否かを判定する。この結果、オブジェクトの分岐の状態を枠領域FLとの交差数Mvに基づいて、赤色オブジェクトの形状を適切に解析して、赤色オブジェクトが囲み線であるか否かを適切に判定することができる。   Furthermore, according to the object determination process of the present embodiment, the red object is based on the frame area FL (FIG. 8) set for each of a plurality of specific pixels (specifically, red object pixels) constituting the object. It is determined whether or not is an enclosing line. As a result, the shape of the red object can be appropriately analyzed based on the number of intersections Mv with the frame region FL as to the branching state of the object, and it can be appropriately determined whether or not the red object is a surrounding line. .

より具体的には、複数個の特定画素のうち、交差数Mvが2個である枠領域FL(2個のオブジェクト部分領域を含む枠領域FL)に対応する第1の特定画素の割合RT2を用いて、赤色オブジェクトが囲み線であるか否かを判定する(図7:ステップS325)。この結果、赤色オブジェクトが囲み線であるか否かを適切に判定することができる。   More specifically, the ratio RT2 of the first specific pixels corresponding to the frame area FL (frame area FL including two object partial areas) having a crossing number Mv of two of the plurality of specific pixels is calculated. It is used to determine whether the red object is a surrounding line (FIG. 7: step S325). As a result, it is possible to appropriately determine whether or not the red object is a surrounding line.

さらに、形状判定部353は、交差数MvがM個(Mは、1、3、4のうちのいずれかの整数)である枠領域FLに対応する複数個の第2の特定画素のうち、特定領域ES(図10)に含まれる第2の特定画素の割合RTCを用いて、赤色オブジェクトが囲み線であるか否かを判定する(図7:ステップS365)。この結果、赤色オブジェクトが囲み線であるか否かを、さらに、精度良く判定することができる。   Furthermore, the shape determination unit 353 includes, among the plurality of second specific pixels corresponding to the frame region FL, where the number of intersections Mv is M (M is an integer of 1, 3, and 4). It is determined whether or not the red object is a surrounding line using the ratio RTC of the second specific pixel included in the specific area ES (FIG. 10) (FIG. 7: Step S365). As a result, whether or not the red object is a surrounding line can be determined with higher accuracy.

さらに、形状判定部353は、交差数Mvが5個以上である枠領域FLに対応する第3の特定画素の割合RT5を用いて、赤色オブジェクトが囲み線であるか否かを判定する(図7:ステップS340)。この結果、赤色オブジェクトが囲み線であるか否かを、さらに、精度良く判定することができる。   Further, the shape determination unit 353 determines whether or not the red object is a surrounding line using the ratio RT5 of the third specific pixel corresponding to the frame region FL having the intersection number Mv of 5 or more (FIG. 7: Step S340). As a result, whether or not the red object is a surrounding line can be determined with higher accuracy.

また、線判定部352は、赤色オブジェクトに外接する矩形領域の2つの方向(X方向とY方向)に延びる複数の直線上において、赤色オブジェクト画素の分布を解析する処理を含む線判定処理(図5のステップS235、ステップS240)を実行する。この結果、複数方向における赤色オブジェクト画素の分布に基づいて、オブジェクトが線であるか否かを適切に判断することができる。   The line determination unit 352 also includes a line determination process including a process of analyzing the distribution of red object pixels on a plurality of straight lines extending in two directions (X direction and Y direction) of a rectangular area circumscribing the red object (see FIG. Step S235 of Step 5 and Step S240) are executed. As a result, it is possible to appropriately determine whether or not the object is a line based on the distribution of red object pixels in a plurality of directions.

なお、線判定処理は、1つの方向における赤色オブジェクト画素の分布を解析する処理のみを含んでも良い。すなわち、縦方向線判定処理と横方向線判定処理とのうちの一方の処理だけが実行されても良い。この場合には、比較的短時間でオブジェクトが線であるか否かを判断することができる。   Note that the line determination processing may include only processing for analyzing the distribution of red object pixels in one direction. That is, only one of the vertical direction line determination process and the horizontal direction line determination process may be executed. In this case, it can be determined whether or not the object is a line in a relatively short time.

B.変形例
(1)上記実施例の処理順序決定処理では、処理対象の画素数を単純に比較することによって、処理時間の比較を行っているが、これに加えて、処理対象の画素毎に繰り返される単位処理の処理負荷を考慮しても良い。具体的には、図11のフローチャートにて破線で示すステップS224において、処理時間判断部330は、線判定処理の単位処理の処理負荷に応じた係数C1と、形状判定処理の単位処理の処理負荷に応じた係数C2と、を取得する。係数C1、C2は、処理負荷を相対的に示す値であれば良い。例えば、係数C1、C2は、特定の試験用画像データを用いて測定された処理時間の実測値を、処理対象とする画素数で除した値に基づいて予め決定された値を用いても良い。あるいは、係数C1、C2は、オブジェクト判定処理を行うコンピュータとして想定される特定種のコンピュータにおいて、単位処理を実行した場合に要するクロックのカウント値に基づいて決定されても良い。係数C1、C2は、特定種のコンピュータ用にコンパイルして得られる機械語における単位処理の処理ステップ数に基づいて決定されても良い。
B. Modification (1) In the processing order determination process of the above embodiment, the processing times are compared by simply comparing the number of pixels to be processed. In addition to this, the processing order determination process is repeated for each pixel to be processed. The processing load of unit processing may be taken into consideration. Specifically, in step S224 indicated by a broken line in the flowchart of FIG. 11, the processing time determination unit 330 determines the coefficient C1 according to the processing load of the unit processing of the line determination processing and the processing load of the unit processing of the shape determination processing. And a coefficient C2 corresponding to. The coefficients C1 and C2 may be values that relatively indicate the processing load. For example, the coefficients C1 and C2 may be values determined in advance based on a value obtained by dividing an actual value of processing time measured using specific test image data by the number of pixels to be processed. . Alternatively, the coefficients C1 and C2 may be determined based on a clock count value required when unit processing is executed in a specific type of computer assumed as a computer that performs object determination processing. The coefficients C1 and C2 may be determined based on the number of unit processing steps in a machine language obtained by compiling for a specific type of computer.

この場合には、線判定処理の処理時間を評価する評価値には、第1実施例における評価値(H×W)と、係数C1と、の積が用いられる。また、形状判定処理の処理時間を評価する評価値には、第1実施例における評価値(S×M)と、係数C2と、の積が用いられる。すなわち、ステップS225(図11)において、処理時間判断部330は、{C1×(H×W)}の値が、{C2×(S×M)}の値未満である場合には、線判定処理の処理時間は、形状判定処理の処理時間未満であると判断する。処理時間判断部330は、{C1×(H×W)}の値が、C2×(S×M)}の値以上である場合には、線判定処理の処理時間は、形状判定処理の処理時間以上であると判断する。本変形例によれば、単位処理の処理負荷に応じて、線判定処理の処理時間と、形状判定処理の第2の解析処理の処理時間と、を精度良く判断することができる。この結果、線判定処理と、形状判定処理と、のいずれの処理を先行して実行すべきであるかを適切に判断することができる。   In this case, the product of the evaluation value (H × W) in the first embodiment and the coefficient C1 is used as the evaluation value for evaluating the processing time of the line determination process. Further, the product of the evaluation value (S × M) in the first embodiment and the coefficient C2 is used as the evaluation value for evaluating the processing time of the shape determination process. That is, in step S225 (FIG. 11), the processing time determination unit 330 determines that the line determination is performed when the value of {C1 × (H × W)} is less than the value of {C2 × (S × M)}. It is determined that the processing time of the process is less than the processing time of the shape determination process. When the value of {C1 × (H × W)} is equal to or greater than the value of C2 × (S × M)}, the processing time determination unit 330 sets the processing time of the line determination processing as the processing of the shape determination processing. Judge that it is over time. According to this modification, it is possible to accurately determine the processing time of the line determination process and the processing time of the second analysis process of the shape determination process according to the processing load of the unit process. As a result, it is possible to appropriately determine which one of the line determination process and the shape determination process should be executed in advance.

(2)上記実施例では、第1の解析処理の例として線判定処理を挙げ、第2の解析処理の例として形状判定処理を挙げているが、これに限られない。第1の解析処理と第2の解析処理には、互いに異なる処理であって、画像データを解析して解析結果を得るための任意の処理が用いられ得る。例えば、第1の解析処理は、例えば、画像内の特定のオブジェクトが文字であるか否かを判定する処理であり、第2の解析処理は、画像内の特定のオブジェクトが写真であるか否かを判定する処理であっても良い。この場合には、例えば、第1の解析処理によって、文字であると判定された場合には、第2の解析処理とは無関係に、特定のオブジェクトは文字であると判定される。第2の解析処理によって、写真であると判定された場合には、第1の解析処理とは無関係に、特定のオブジェクトは写真であると判定される。そして、第1の解析処理の処理時間が第2の解析処理の処理時間未満であると判断される場合には、第1の解析処理が第2の解析処理に先行して実行される。この結果、第1の解析処理によって、特定のオブジェクトが文字であると判定された場合には、第2の解析処理は、実行されない。また、第1の解析処理の処理時間が第2の解析処理の処理時間以上であると判断される場合には、第2の解析処理が第1の解析処理に先行して実行される。この結果、第2の解析処理によって、特定のオブジェクトが写真であると判定された場合には、第1の解析処理は、実行されない。この結果、第1の解析処理と第2の解析処理のうち、処理時間が長い解析処理の実行を抑制して、解析処理全体の処理時間を低減することができる。 (2) In the above embodiment, the line determination process is given as an example of the first analysis process, and the shape determination process is given as an example of the second analysis process. However, the present invention is not limited to this. The first analysis process and the second analysis process are different processes, and any process for analyzing image data and obtaining an analysis result can be used. For example, the first analysis processing is processing for determining whether or not a specific object in the image is a character, for example, and the second analysis processing is whether or not the specific object in the image is a photograph. It may be a process for determining whether or not. In this case, for example, when it is determined by the first analysis process that the character is a character, the specific object is determined to be a character regardless of the second analysis process. When the second analysis process determines that the photograph is a photograph, the specific object is determined to be a photograph regardless of the first analysis process. If it is determined that the processing time of the first analysis process is less than the processing time of the second analysis process, the first analysis process is executed prior to the second analysis process. As a result, when it is determined by the first analysis process that the specific object is a character, the second analysis process is not executed. Further, when it is determined that the processing time of the first analysis process is equal to or longer than the processing time of the second analysis process, the second analysis process is executed prior to the first analysis process. As a result, when it is determined by the second analysis process that the specific object is a photograph, the first analysis process is not executed. As a result, among the first analysis process and the second analysis process, the execution of the analysis process having a long processing time can be suppressed, and the processing time of the entire analysis process can be reduced.

(3)上記実施例では、線判定処理と、形状判定処理と、の2つの処理の処理時間を比較しているが、3以上の処理の処理時間を比較しても良い。例えば、変形例(2)で例示した特定のオブジェクトが文字であるか否かを判定する処理と、特定のオブジェクトが写真であるか否かを判定する処理と、に加えて、特定のオブジェクトが描画であるか否かを判定する処理と、を実行する場合を例に説明する。この場合には、これらの3つの判定処理の処理時間を互いに比較して、3つの判定処理の処理順序を決定することが好ましい。すなわち、処理時間判断部330は、これらの3つの判定処理の処理時間の評価値をそれぞれ算出し、評価値が小さい順に、すなわち、処理時間が短い順に、3つの判定処理の処理順序を決定することが好ましい。こうすることで、これらの3つの判定処理のうちの1個の処理で、特定のオブジェクトの属性(写真、描画、文字のいずれか)を決定できた場合には、その時点で実行されていない判定処理の有無に拘わらずに、特定のオブジェクトの属性が決定される。 (3) In the above embodiment, the processing times of the two processes of the line determination process and the shape determination process are compared, but the processing times of three or more processes may be compared. For example, in addition to the process of determining whether or not the specific object illustrated in the modification example (2) is a character and the process of determining whether or not the specific object is a photograph, the specific object A case where the process of determining whether or not the drawing is performed will be described as an example. In this case, it is preferable to determine the processing order of the three determination processes by comparing the processing times of these three determination processes with each other. That is, the processing time determination unit 330 calculates the evaluation values of the processing times of these three determination processes, respectively, and determines the processing order of the three determination processes in ascending order of the evaluation values, that is, the processing time is short. It is preferable. In this way, if one of these three determination processes can determine the attribute (photograph, drawing, or character) of a specific object, it is not executed at that time. Regardless of the presence or absence of the determination process, the attribute of a specific object is determined.

(4)上記実施例の形状判定処理では、判定対象の赤色オブジェクトを構成する全ての赤色オブジェクト画素に対して、枠領域FLが設定されているが、一部の赤色オブジェクト画素に対してのみ、枠領域FLを設定しても良い。具体的には、1個の赤色オブジェクト画素に対して、枠領域FLを設定した場合には、当該1個の赤色オブジェクト画素から所定距離内(例えば、2画素分の距離内)に位置する他の赤色オブジェクト画素は、枠領域FLの設定対象から除去しても良い。あるいは、判定対象の赤色オブジェクトを構成する全ての赤色オブジェクト画素のうち、X座標とY座標の両方が奇数である画素に対して、枠領域FLを設定し、X座標とY座標のうちの少なくとも一方が奇数である画素に対して、枠領域FLを設定しないこととしても良い。この場合には、割合RT2、RTC、RT5には、それぞれ、枠領域FLが設定された赤色オブジェクト画素の個数に対する、第1、第2、第3の特定画素の割合が用いられる。 (4) In the shape determination process of the above embodiment, the frame area FL is set for all red object pixels constituting the red object to be determined, but only for some of the red object pixels. A frame area FL may be set. Specifically, when the frame region FL is set for one red object pixel, the frame area FL is located within a predetermined distance (for example, within a distance of two pixels) from the one red object pixel. These red object pixels may be removed from the setting target of the frame area FL. Alternatively, a frame region FL is set for a pixel in which both the X coordinate and the Y coordinate are odd numbers among all the red object pixels constituting the red object to be determined, and at least one of the X coordinate and the Y coordinate is set. The frame area FL may not be set for pixels where one is an odd number. In this case, the ratios of the first, second, and third specific pixels with respect to the number of red object pixels in which the frame area FL is set are used as the ratios RT2, RTC, and RT5, respectively.

同様に、上記実施例の線判定処理では、赤色オブジェクトに外接する矩形領域内の全ての画素を処理対象にして平均連続画素数LN1ave、LN2aveを算出している。これに代えて、例えば、矩形領域内の一部の画素のみを処理対象にして、平均連続画素数LN1ave、LN2aveを算出しても良い。例えば、縦方向線判定処理では、矩形領域内の全てのY方向(縦方向)に沿った線のうち、X座標が奇数である線上の画素のみを処理対象としても良い。   Similarly, in the line determination process of the above embodiment, the average continuous pixel numbers LN1ave and LN2ave are calculated for all the pixels in the rectangular area circumscribing the red object. Instead of this, for example, the average continuous pixel numbers LN1ave and LN2ave may be calculated with only some of the pixels in the rectangular area as the processing target. For example, in the vertical direction line determination processing, only pixels on a line having an odd X coordinate among all lines along the Y direction (vertical direction) in the rectangular area may be processed.

このような場合には、処理時間判断部330は、例えば、係数を乗じることによって、処理時間の評価値を調整しても良い。例えば、処理時間判断部330は、形状判定処理の処理時間の評価値(S×M)に、全ての赤色オブジェクト画素の個数に対する、枠領域FLが設定される赤色オブジェクト画素の比率を、係数として乗じても良い。また、処理時間判断部330は、線判定処理の処理時間の評価値(H×W)に、矩形領域内の全ての縦方向の線の数に対する、連続画素数の算出対象となる線の数を、係数として乗じても良い。また、形状判定処理の処理時間の評価値(S×M)に乗じるべき係数と、線判定処理の処理時間の評価値(H×W)に乗じるべき係数と、が同程度である場合には、係数を乗じなくても良い。   In such a case, the processing time determination unit 330 may adjust the evaluation value of the processing time by, for example, multiplying by a coefficient. For example, the processing time determination unit 330 uses, as a coefficient, the ratio of the red object pixels in which the frame region FL is set to the number of all red object pixels in the evaluation value (S × M) of the processing time of the shape determination process. You may multiply. In addition, the processing time determination unit 330 uses the evaluation value (H × W) of the processing time of the line determination process as the number of lines for which the number of continuous pixels is calculated with respect to the number of all vertical lines in the rectangular area. May be multiplied as a coefficient. In addition, when the coefficient to be multiplied by the evaluation value (S × M) of the processing time of the shape determination process and the coefficient to be multiplied by the evaluation value (H × W) of the processing time of the line determination process are approximately the same It is not necessary to multiply the coefficient.

(5)なお、上記実施例のオブジェクト判定処理(図5)は、縦方向判定処理(ステップS235)と、横方向判定処理(ステップS240)と、の両方を含んでいる。そして、方向判定処理で、線であると判定されることと、横方向判定処理で、線であると判定されること、の両方が、赤色オブジェクトが囲み線であると判断されるための必要条件とされている。これに代えて、オブジェクト判定処理は、縦方向判定処理と、横方向判定処理との、いずれか一方の処理だけを含み、当該一方の処理で、線であると判定されることが、赤色オブジェクトが囲み線であると判断されるための必要条件とされても良い。 (5) Note that the object determination process (FIG. 5) of the above embodiment includes both the vertical direction determination process (step S235) and the horizontal direction determination process (step S240). Both the direction determination process determines that the line is a line and the horizontal direction determination process determines that the line is a line. It is a condition. Instead, the object determination process includes only one of the vertical direction determination process and the horizontal direction determination process, and it is determined that the object is determined to be a line by the one process. May be a necessary condition for determining that is a surrounding line.

(6)上記実施例のオブジェクト判定処理における線判定処理の処理時間の評価値(H×W)は、縦方向判定処理と、横方向判定処理と、のそれぞれの処理時間の評価値である。これに代えて、線判定処理の処理時間の評価値として、縦方向判定処理と、横方向判定処理と、との処理時間の合計の評価値、すなわち、(H×W)×2が採用されても良い。 (6) The evaluation value (H × W) of the processing time of the line determination process in the object determination process of the above embodiment is an evaluation value of each processing time of the vertical direction determination process and the horizontal direction determination process. Instead, as the evaluation value of the processing time of the line determination processing, the total evaluation value of the processing time of the vertical direction determination processing and the horizontal direction determination processing, that is, (H × W) × 2 is adopted. May be.

(7)上記実施例における枠領域FLのサイズ(幅FW)や、特定領域ESのサイズ(幅EW)は、図8(C)や図10(B)の式を用いて算出されているが、これに代えて、固定値が用いられても良い。また、枠領域FLの形状や特定領域ESの形状は、正方形に限らず、長方形であっても良いし、円形であっても良いし、三角形や五角形などの各種の多角形であっても良い。 (7) Although the size (width FW) of the frame region FL and the size (width EW) of the specific region ES in the above-described embodiment are calculated using the equations of FIG. 8 (C) and FIG. 10 (B). Instead of this, a fixed value may be used. Further, the shape of the frame region FL and the shape of the specific region ES are not limited to a square, but may be a rectangle, a circle, or various polygons such as a triangle or a pentagon. .

(8)なお、本実施例の対象画像データは、スキャナによって読み取られたスキャンデータが採用されているが、例えば、デジタルカメラなどで撮影された撮影画像データであっても良いし、文書や描画などを作成するためのアプリケーションプログラムを用いて生成された画像データであっても良い。また、囲み線は、例えば、ペンを用いて記入された囲み線に限られず、上記アプリケーションプログラムを用いて、画像内に描画された囲み線であっても良い。この場合には、例えば、マウスなどのポインティングデバイスを用いて、フリーハンドで描画された囲み線であっても、当該囲み線を適切に特定することができる。 (8) Note that the target image data of the present embodiment employs scan data read by a scanner, but may be, for example, photographed image data photographed by a digital camera or the like, or a document or drawing For example, the image data may be generated using an application program for creating the image data. In addition, the surrounding line is not limited to the surrounding line written using a pen, for example, and may be a surrounding line drawn in an image using the application program. In this case, for example, even with a surrounding line drawn freehand by using a pointing device such as a mouse, the surrounding line can be appropriately identified.

(9)上記実施例においてサーバ400の画像処理部300によって実行される画像処理は、サーバ400とは異なる装置、例えば、複合機200と接続されたパーソナルコンピュータ500(図1)によって実行されても良い。この場合には、この画像処理は、例えば、複合機200のスキャナ部250や、単体のスキャナ(図示せず)を、制御するためにパーソナルコンピュータ500にインストールされたスキャナドライバキャナによって実行されても良い。また、この画像処理は、複合機200のCPU210や、単体のスキャナのCPUによって実行されても良い。また、サーバ400は、1つの筐体の装置に限らず、複数の計算機を含む計算システム(例えば、いわゆるクラウドコンピューティングを実現する分散型の計算システム)によって構成されていても良い。 (9) In the above embodiment, the image processing executed by the image processing unit 300 of the server 400 may be executed by a device different from the server 400, for example, the personal computer 500 (FIG. 1) connected to the multifunction device 200. good. In this case, the image processing may be executed by a scanner driver canister installed in the personal computer 500 for controlling the scanner unit 250 of the multifunction device 200 or a single scanner (not shown), for example. good. Further, this image processing may be executed by the CPU 210 of the multifunction device 200 or the CPU of a single scanner. The server 400 is not limited to a single housing device, and may be configured by a computing system including a plurality of computers (for example, a distributed computing system that realizes so-called cloud computing).

(10)上記実施例において、ハードウェアによって実現されていた構成の一部をソフトウェアに置き換えるようにしてもよく、逆に、ソフトウェアによって実現されていた構成の一部をハードウェアに置き換えるようにしてもよい。 (10) In the above embodiment, a part of the configuration realized by hardware may be replaced with software, and conversely, a part of the configuration realized by software may be replaced with hardware. Also good.

110...通信制御部、115...画像データ送受信部、120...装置制御部、200...複合機、210...CPU、220...揮発性記憶装置、221...バッファ領域、230...不揮発性記憶装置、231...制御プログラム、240...プリンタ部、250...スキャナ部、260...操作部、270...表示部、280...通信部、300...画像処理部、310...画像データ取得部、320...オブジェクト特定部、330...処理時間判断部、350...解析処理部、351...色判定部、352...線判定部、353...形状判定部、360...属性判断部、370...除去処理部、400...サーバ、410...CPU、420...揮発性記憶装置、421...バッファ領域、430...不揮発性記憶装置、431...コンピュータプログラム、480...通信部、500...パーソナルコンピュータ、70...インターネット、1000...画像処理システム   110 ... communication control unit, 115 ... image data transmission / reception unit, 120 ... device control unit, 200 ... multifunction device, 210 ... CPU, 220 ... volatile storage device, 221 .. Buffer area 230 Non-volatile storage device 231 Control program 240 Printer unit 250 Scanner unit 260 Operation unit 270 Display unit 280 ..Communication unit, 300 ... Image processing unit, 310 ... Image data acquisition unit, 320 ... Object identification unit, 330 ... Processing time determination unit, 350 ... Analysis processing unit, 351 .. Color determination unit, 352... Line determination unit, 353... Shape determination unit, 360... Attribute determination unit, 370... Removal processing unit, 400. ... volatile storage device, 421 ... buffer area, 430 ... nonvolatile storage device, 431 ... computer program, 480 ... communication unit, 500 ... persona Computer, 70 ... Internet, 1000 ... image processing system

Claims (12)

画像処理装置であって、
画像データによって表される画像内のオブジェクトを特定する特定部と、
前記オブジェクトに対して実行されるべき複数の解析処理のうち、第1の解析処理の処理時間と、第2の解析処理の処理時間と、を判断する処理時間判断部と、
前記第1の解析処理の処理時間が、前記第2の解析処理の処理時間未満であると判断される第1の場合に、前記第2の解析処理に先行して前記第1の解析処理を実行し、前記第1の解析処理の処理時間が、前記第2の解析処理の処理時間以上であると判断される第2の場合に、前記第1の解析処理に先行して、前記第2の解析処理を実行する解析処理部であって、
前記第1の場合であって、前記第1の解析処理の処理結果が第1の結果である場合には、前記第2の解析処理を実行し、前記第1の解析処理の処理結果が第1の結果と異なる場合には、前記第2の解析処理を実行せず、
前記第2の場合であって、前記第2の解析処理の処理結果が第2の結果である場合には、前記第1の解析処理を実行し、前記第2の解析処理の処理結果が第2の結果と異なる場合には、前記第1の解析処理を実行しない、
前記解析処理部と、
前記複数の解析処理のうち、実行された処理の処理結果に基づいて、前記オブジェクトの属性を判断する属性判断部と、
を備える、画像処理装置。
An image processing apparatus,
A specifying unit for specifying an object in the image represented by the image data;
A processing time determination unit that determines a processing time of a first analysis process and a processing time of a second analysis process among a plurality of analysis processes to be performed on the object;
In the first case where the processing time of the first analysis processing is determined to be less than the processing time of the second analysis processing, the first analysis processing is performed prior to the second analysis processing. And in the second case where the processing time of the first analysis process is determined to be equal to or longer than the processing time of the second analysis process, the second analysis process is preceded by the second analysis process. An analysis processing unit for executing the analysis processing of
In the first case, when the processing result of the first analysis processing is the first result, the second analysis processing is executed, and the processing result of the first analysis processing is the first result. If the result is different from the result of 1, the second analysis process is not executed,
In the second case, when the processing result of the second analysis processing is the second result, the first analysis processing is executed, and the processing result of the second analysis processing is the first result. When the result is different from the result of 2, the first analysis process is not executed.
The analysis processing unit;
An attribute determination unit that determines an attribute of the object based on a processing result of an executed process among the plurality of analysis processes;
An image processing apparatus comprising:
請求項1に記載の画像処理装置であって、
前記処理時間判断部は、前記第1の解析処理の処理対象である画素の個数に応じた第1の値を用いて、前記第1の解析処理の処理時間を判断し、前記第2の解析処理の処理対象である画素の個数に応じた第2の値を用いて、前記第2の解析処理の処理時間を判断する、画像処理装置。
The image processing apparatus according to claim 1,
The processing time determination unit determines a processing time of the first analysis process by using a first value corresponding to the number of pixels to be processed by the first analysis process, and performs the second analysis. An image processing apparatus that determines a processing time of the second analysis process by using a second value corresponding to the number of pixels to be processed.
請求項2に記載の画像処理装置であって、
前記第1の解析処理は、前記オブジェクトを含む特定領域内の複数個の画素に対する処理を含み、
前記第1の値は、前記特定領域内の画素の個数に応じた値であり、
前記第2の解析処理は、前記オブジェクトを構成する複数個の画素に対する処理を含み、
前記第2の値は、前記オブジェクトを構成する画素の個数に応じた値である、画像処理装置。
The image processing apparatus according to claim 2,
The first analysis process includes a process for a plurality of pixels in a specific area including the object,
The first value is a value according to the number of pixels in the specific region,
The second analysis process includes a process for a plurality of pixels constituting the object,
The image processing apparatus, wherein the second value is a value corresponding to the number of pixels constituting the object.
請求項1ないし請求項3のいずれかに記載の画像処理装置であって、
前記第1の解析処理は、処理対象の1個以上の画素毎に繰り返される第1の単位処理を含み、
前記第2の解析処理は、処理対象の1個以上の画素毎に繰り返される第2の単位処理を含み、
前記処理時間判断部は、前記第1の単位処理の処理負荷に応じた値を用いて、前記第1の解析処理の処理時間を判断し、前記第2の単位処理の処理負荷に応じた値を用いて、前記第2の解析処理の処理時間を判断する、画像処理装置。
An image processing apparatus according to any one of claims 1 to 3,
The first analysis process includes a first unit process that is repeated for each of one or more pixels to be processed;
The second analysis process includes a second unit process that is repeated for each of one or more pixels to be processed,
The processing time determination unit determines a processing time of the first analysis process by using a value according to a processing load of the first unit process, and a value according to a processing load of the second unit process. An image processing apparatus that determines the processing time of the second analysis process using the above-described method.
請求項1ないし請求項4のいずれかに記載の画像処理装置であって、
前記属性判断部は、前記複数の解析処理のうち、実行された処理の処理結果に基づいて、前記オブジェクトが、画像内の一部の領域を囲む囲み線であるか否かを判断する、画像処理装置。
An image processing apparatus according to any one of claims 1 to 4,
The attribute determining unit determines whether the object is a surrounding line surrounding a partial area in the image based on a processing result of an executed process among the plurality of analysis processes. Processing equipment.
請求項5に記載の画像処理装置であって、
前記第1の解析処理は、前記オブジェクトが線であるか否かを解析する処理であり、
前記第1の解析処理の前記第1の結果は、前記オブジェクトが線であることを示す第1の条件を満たすことであり、
前記属性判断部は、前記第1の解析処理の結果が前記第1の条件を満たさない場合には、前記第2の解析処理とは無関係に、前記オブジェクトが前記囲み線ではないと判断する、画像処理装置。
The image processing apparatus according to claim 5,
The first analysis process is a process of analyzing whether or not the object is a line;
The first result of the first analysis process is to satisfy a first condition indicating that the object is a line;
The attribute determination unit determines that the object is not the surrounding line regardless of the second analysis process when the result of the first analysis process does not satisfy the first condition. Image processing device.
請求項6に記載の画像処理装置であって、
前記第1の解析処理は、前記特定領域内の第1の方向に延びる複数の直線上において、前記オブジェクトを構成する画素の分布を解析する処理を含み、
前記第1の条件は、前記オブジェクトを構成する画素が前記第1の方向に連続する個数が基準以下であることを含む、画像処理装置。
The image processing apparatus according to claim 6,
The first analysis process includes a process of analyzing a distribution of pixels constituting the object on a plurality of straight lines extending in a first direction in the specific region,
The first condition is an image processing apparatus, wherein the number of pixels constituting the object that are continuous in the first direction is equal to or less than a reference.
請求項7に記載の画像処理装置であって、
前記第1の解析処理は、さらに、前記特定領域内の前記第1の方向と交差する第2の方向に延びる複数の直線上において、前記オブジェクトを構成する画素の分布を解析する処理とを含み、
前記第1の条件は、前記オブジェクトを構成する画素が前記第1の方向に連続する個数が基準以下であり、かつ、前記オブジェクトを構成する画素が前記第2の方向に連続する個数が基準以下であることを含む、画像処理装置。
The image processing apparatus according to claim 7,
The first analysis processing further includes processing for analyzing distribution of pixels constituting the object on a plurality of straight lines extending in a second direction intersecting the first direction in the specific region. ,
The first condition is that the number of pixels constituting the object continuing in the first direction is less than a reference, and the number of pixels constituting the object continuing in the second direction is less than a reference. An image processing apparatus.
請求項5ないし請求項7のいずれかに記載の画像処理装置であって、
前記第2の解析処理は、前記オブジェクトが画像内の一部の領域を囲む形状を成すか否かを解析する処理であり、
前記第2の解析処理の前記第2の結果は、前記オブジェクトが画像内の一部の領域を囲む形状を成すことを示す第2の条件を満たすことであり、
前記属性判断部は、前記第2の解析処理の結果が前記第2の条件を満たさない場合には、前記第1の解析処理とは無関係に、前記オブジェクトが前記囲み線ではないと判断する、画像処理装置。
An image processing apparatus according to any one of claims 5 to 7,
The second analysis process is a process of analyzing whether or not the object has a shape surrounding a partial area in the image;
The second result of the second analysis process is to satisfy a second condition indicating that the object has a shape surrounding a partial region in the image,
The attribute determination unit determines that the object is not the surrounding line regardless of the first analysis process when the result of the second analysis process does not satisfy the second condition. Image processing device.
請求項9に記載の画像処理装置であって、
前記第2の解析処理は、
前記オブジェクトを構成する複数個の特定画素のそれぞれに対応する複数個の枠領域を設定する設定処理であって、前記枠領域は、対応する特定画素が、前記枠領域と、前記枠領域の内側とのいずれかの位置に含まれる枠状の領域である、前記設定処理と、
前記複数個の枠領域のそれぞれについて、前記枠領域に含まれるオブジェクト部分領域の個数を判断する第1の判断処理であって、前記オブジェクト部分領域は、前記オブジェクトを構成する1個以上の前記特定画素が連続して並ぶ領域である、前記第1の判断処理と、
前記オブジェクトを構成する複数個の前記特定画素に対する第1の特定画素の割合が基準以上であるか否かを判断する第2の判断処理であって、第1の特定画素は、前記オブジェクトを構成する複数個の前記特定画素のうち、対応する前記枠領域に含まれる前記前記オブジェクト部分領域の個数が2個である前記特定画素である、前記第2の判断処理と、
を含み、
前記第2の条件は、前記第1の特定画素の割合が基準以上であることを含む、画像処理装置。
The image processing apparatus according to claim 9,
The second analysis process includes
A setting process for setting a plurality of frame regions corresponding to each of a plurality of specific pixels constituting the object, wherein the frame region includes a corresponding specific pixel, the frame region, and an inner side of the frame region. The setting process, which is a frame-like region included in any of the positions,
A first determination process for determining the number of object partial areas included in the frame area for each of the plurality of frame areas, wherein the object partial area is one or more of the specific parts constituting the object The first determination process, which is an area in which pixels are continuously arranged;
A second determination process for determining whether a ratio of the first specific pixel to a plurality of the specific pixels constituting the object is greater than or equal to a reference, wherein the first specific pixel constitutes the object; The second determination process, wherein the number of the object partial regions included in the corresponding frame region is the specific pixel among the plurality of the specific pixels.
Including
The second condition is an image processing device including a ratio of the first specific pixel being equal to or higher than a reference.
請求項9に記載の画像処理装置であって、
前記第2の解析処理は、さらに、
第2の特定画素に基づく条件が満たされるか否かを判断する第3の判断処理であって、前記第2の特定画素は、前記オブジェクトを構成する複数個の前記特定画素のうち、対応する前記枠領域に含まれる前記オブジェクト部分領域の個数がM個(Mは、1、3、4、5のうちのいずれかの整数)である前記特定画素である、前記第3の判断処理を含み、
前記第2の条件は、前記第2の特定画素に基づく条件を含む、画像処理装置。
The image processing apparatus according to claim 9,
The second analysis process further includes:
A third determination process for determining whether or not a condition based on a second specific pixel is satisfied, wherein the second specific pixel corresponds among a plurality of the specific pixels constituting the object; Including the third determination process, which is the specific pixel in which the number of the object partial areas included in the frame area is M (M is an integer of any one of 1, 3, 4, and 5). ,
The image processing apparatus, wherein the second condition includes a condition based on the second specific pixel.
画像処理を実行するためのコンピュータプログラムであって、
画像データによって表される画像内のオブジェクトを特定する特定機能と、
前記オブジェクトに対して実行されるべき複数の解析処理のうち、第1の解析処理の処理時間と、第2の解析処理の処理時間と、を判断する処理時間判断機能と、
前記第1の解析処理の処理時間が、前記第2の解析処理の処理時間未満であると判断される第1の場合に、前記第2の解析処理に先行して前記第1の解析処理を実行し、前記第1の解析処理の処理時間が、前記第2の解析処理の処理時間以上であると判断される第2の場合に、前記第1の解析処理に先行して、前記第2の解析処理を実行する解析処理機能であって、
前記第1の場合であって、前記第1の解析処理の処理結果が第1の結果である場合には、前記第2の解析処理を実行し、前記第1の解析処理の処理結果が第1の結果と異なる場合には、前記第2の解析処理を実行せず、
前記第2の場合であって、前記第2の解析処理の処理結果が第2の結果である場合には、前記第1の解析処理を実行し、前記第2の解析処理の処理結果が第2の結果と異なる場合には、前記第1の解析処理を実行しない、
前記解析処理機能と、
前記複数の解析処理のうち、実行された処理の処理結果に基づいて、前記オブジェクトの属性を判断する属性判断機能と、
をコンピュータに実現させるコンピュータプログラム。
A computer program for executing image processing,
A specific function that identifies the object in the image represented by the image data;
A processing time determination function for determining a processing time of a first analysis process and a processing time of a second analysis process among a plurality of analysis processes to be performed on the object;
In the first case where the processing time of the first analysis processing is determined to be less than the processing time of the second analysis processing, the first analysis processing is performed prior to the second analysis processing. And in the second case where the processing time of the first analysis process is determined to be equal to or longer than the processing time of the second analysis process, the second analysis process is preceded by the second analysis process. An analysis processing function for executing the analysis processing of
In the first case, when the processing result of the first analysis processing is the first result, the second analysis processing is executed, and the processing result of the first analysis processing is the first result. If the result is different from the result of 1, the second analysis process is not executed,
In the second case, when the processing result of the second analysis processing is the second result, the first analysis processing is executed, and the processing result of the second analysis processing is the first result. When the result is different from the result of 2, the first analysis process is not executed.
The analysis processing function;
An attribute determination function for determining an attribute of the object based on a processing result of an executed process among the plurality of analysis processes;
A computer program that causes a computer to realize
JP2013070648A 2013-03-28 2013-03-28 Image processing apparatus and computer program Active JP6111796B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013070648A JP6111796B2 (en) 2013-03-28 2013-03-28 Image processing apparatus and computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013070648A JP6111796B2 (en) 2013-03-28 2013-03-28 Image processing apparatus and computer program

Publications (2)

Publication Number Publication Date
JP2014194659A true JP2014194659A (en) 2014-10-09
JP6111796B2 JP6111796B2 (en) 2017-04-12

Family

ID=51839871

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013070648A Active JP6111796B2 (en) 2013-03-28 2013-03-28 Image processing apparatus and computer program

Country Status (1)

Country Link
JP (1) JP6111796B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020022055A1 (en) * 2018-07-24 2020-01-30 ソニー株式会社 Information processing device and method, and program

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1084481A (en) * 1996-06-28 1998-03-31 Dainippon Screen Mfg Co Ltd Gradation interpolation method for image and its device, and recording medium recording program to execute the processing
JP2005100121A (en) * 2003-09-25 2005-04-14 Fuji Photo Film Co Ltd Device and program for determination of type and discrimination condition of feature quantity used in discrimination processing, recording medium with program recorded, and device for selection of data of specific content
JP2008242751A (en) * 2007-03-27 2008-10-09 Seiko Epson Corp Image discrimination method, image discrimination device, and program
JP2009140369A (en) * 2007-12-07 2009-06-25 Sony Corp Group learning device and group learning method, object detection device and object detection method, and computer program
JP4806101B2 (en) * 2010-02-01 2011-11-02 株式会社モルフォ Object detection apparatus and object detection method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1084481A (en) * 1996-06-28 1998-03-31 Dainippon Screen Mfg Co Ltd Gradation interpolation method for image and its device, and recording medium recording program to execute the processing
JP2005100121A (en) * 2003-09-25 2005-04-14 Fuji Photo Film Co Ltd Device and program for determination of type and discrimination condition of feature quantity used in discrimination processing, recording medium with program recorded, and device for selection of data of specific content
JP2008242751A (en) * 2007-03-27 2008-10-09 Seiko Epson Corp Image discrimination method, image discrimination device, and program
JP2009140369A (en) * 2007-12-07 2009-06-25 Sony Corp Group learning device and group learning method, object detection device and object detection method, and computer program
JP4806101B2 (en) * 2010-02-01 2011-11-02 株式会社モルフォ Object detection apparatus and object detection method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020022055A1 (en) * 2018-07-24 2020-01-30 ソニー株式会社 Information processing device and method, and program
JPWO2020022055A1 (en) * 2018-07-24 2021-08-05 ソニーグループ株式会社 Information processing equipment and methods, and programs
US11431887B2 (en) 2018-07-24 2022-08-30 Sony Semiconductor Solutions Corporation Information processing device and method for detection of a sound image object
JP7338627B2 (en) 2018-07-24 2023-09-05 ソニーグループ株式会社 Information processing device and method, and program

Also Published As

Publication number Publication date
JP6111796B2 (en) 2017-04-12

Similar Documents

Publication Publication Date Title
JP5361574B2 (en) Image processing apparatus, image processing method, and program
JP6494249B2 (en) Image forming apparatus, image forming method, and program
KR20080006112A (en) Halftoning method and apparatus to improve sharpness in boundary region
JP5842441B2 (en) Image processing apparatus and program
JP5838984B2 (en) Image processing apparatus and computer program
JP5335581B2 (en) Image processing apparatus, image processing method, and program
JP2010074342A (en) Image processing apparatus, image forming apparatus, and program
JP6107270B2 (en) Image processing apparatus and computer program
KR101903617B1 (en) Method for editing static digital combined images comprising images of multiple objects
JP6111796B2 (en) Image processing apparatus and computer program
US9277074B2 (en) Image processing apparatus, method, and medium determining whether image data of a page to be processed is blank and contains a foreground object and transmitting the foreground object obtained by removing a background object
US10339636B2 (en) Image processing apparatus that specifies edge pixel in target image by calculating edge strength
JP4867903B2 (en) Image processing program and image processing apparatus
JP5217960B2 (en) Image processing apparatus, image processing method, and program
JP4569785B2 (en) Binarization device and binarization processing program
JP2007028181A (en) Image processor
JP6070317B2 (en) Image processing apparatus and computer program
JP2019016898A (en) Image processing system, and computer program
JP4974367B2 (en) Region dividing method and apparatus, and program
JP2023132586A (en) Image processing device, image processing method, and program
JP2019195117A (en) Information processing apparatus, information processing method, and program
JP6442846B2 (en) Image processing apparatus, image processing method, and program
JP6331772B2 (en) Image processing apparatus and computer program
JP5822750B2 (en) Apparatus and method for detecting impurities in read image
JP5803643B2 (en) Image processing apparatus, image processing method, and computer program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20151208

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20161125

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20161206

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170126

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20170214

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170227

R150 Certificate of patent or registration of utility model

Ref document number: 6111796

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150