JP2015060441A - Image processing apparatus, method of controlling the same, and program for controlling the same - Google Patents

Image processing apparatus, method of controlling the same, and program for controlling the same Download PDF

Info

Publication number
JP2015060441A
JP2015060441A JP2013194387A JP2013194387A JP2015060441A JP 2015060441 A JP2015060441 A JP 2015060441A JP 2013194387 A JP2013194387 A JP 2013194387A JP 2013194387 A JP2013194387 A JP 2013194387A JP 2015060441 A JP2015060441 A JP 2015060441A
Authority
JP
Japan
Prior art keywords
scanning
branch point
found
point
path
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
JP2013194387A
Other languages
Japanese (ja)
Other versions
JP6163998B2 (en
Inventor
哲嗣 松谷
Tetsuji Matsutani
哲嗣 松谷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Konica Minolta Inc
Original Assignee
Konica Minolta Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Konica Minolta Inc filed Critical Konica Minolta Inc
Priority to JP2013194387A priority Critical patent/JP6163998B2/en
Publication of JP2015060441A publication Critical patent/JP2015060441A/en
Application granted granted Critical
Publication of JP6163998B2 publication Critical patent/JP6163998B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an image processing apparatus configured to properly extract each of graphics included in an image, a method and program for controlling the image processing apparatus.SOLUTION: An image forming apparatus, as an image processing apparatus, scans a contour extracted from an image starting from an arbitrary point on the contour, to search for a branch point and the start point on the contour (S105), stores a position of the branch point and a plurality of paths branched from the branch point when the branch point is detected(S110), selects the rightmost path as a path to be scanned, when the branch point is detected (S111), extracts a graphic formed by a scanned trajectory when the start point is detected (S115), and scans an unscanned path of the paths branched from a new start point, which is a branch point detected during scanning (S121).

Description

本発明は、画像処理装置、画像処理装置の制御方法、および画像処理装置の制御プログラムに関し、より特定的には、複数の図形を含む画像からそれぞれの図形を抽出する画像処理装置、画像処理装置の制御方法、および画像処理装置の制御プログラムに関する。   The present invention relates to an image processing apparatus, an image processing apparatus control method, and an image processing apparatus control program. More specifically, the present invention relates to an image processing apparatus and an image processing apparatus that extract each figure from an image including a plurality of figures. And a control program for the image processing apparatus.

画像形成装置を始めとする画像処理装置は、原稿をスキャンすることなどにより得られた画像(スキャンデータ)を、マイクロソフトオフィス(登録商標)などのオフィスソフトのファイル形式に変換する画像処理機能を有している。この画像処理機能には、図の編集能力に課題があることが知られている。すなわち、画像処理装置は、常に画像全体を一枚の画像として変換するため、変換対象となる画像が複数の図形を含んでいる場合であっても、変換後の画像において図形毎に編集(たとえば色、大きさ、形状、位置などの変更)を行うことができないという課題があった。   Image processing apparatuses such as image forming apparatuses have an image processing function for converting an image (scan data) obtained by scanning a document into a file format of office software such as Microsoft Office (registered trademark). doing. It is known that this image processing function has a problem in the editing ability of the figure. That is, since the image processing apparatus always converts the entire image as a single image, even if the image to be converted includes a plurality of figures, editing is performed for each figure in the converted image (for example, There has been a problem that the color, size, shape, position, etc. cannot be changed.

上記課題を解決するためには、複数の図形の各々を編集可能な状態に分離(分解)して画像から抽出する必要がある。複数の図形を含む画像から図形を抽出する方法には、主に次の3つの方法がある。   In order to solve the above problem, it is necessary to extract (decompose) each of the plurality of figures into an editable state and extract them from the image. There are mainly the following three methods for extracting a figure from an image including a plurality of figures.

第1の方法は、ラベリングにより図形を抽出する方法である。第1の方法は、画像内の任意の注目画素と、注目画素に隣接する隣接画素とを比較し、注目画素と隣接画素とが同じ色であれば同じ図形(同じ領域)と判断し、異なる色であれば異なる図形(異なる領域)であると判断する方法である。第1の方法には、いくつかの問題が存在する。   The first method is a method of extracting a figure by labeling. The first method compares an arbitrary pixel of interest in an image with an adjacent pixel adjacent to the pixel of interest, and if the pixel of interest and the adjacent pixel have the same color, the same graphic (the same region) is determined and is different. This is a method of judging that the color is a different figure (different area) if it is a color. There are several problems with the first method.

抽出対象となる画像が、複数のボックスと、複数のボックスの各々を接続する矢印(線)とで構成されたフローチャートであり、ブロックおよび線は同一色である場合を想定する。この場合、第1の方法では、同一色であるブロックと矢印とを分離して抽出することはできなかった。   It is assumed that the image to be extracted is a flowchart composed of a plurality of boxes and arrows (lines) connecting each of the plurality of boxes, and the blocks and the lines are the same color. In this case, the first method cannot separate and extract blocks and arrows having the same color.

また、抽出対象となる画像に含まれる図形の外枠に、図形内部とは別の色が施されている場合、第1の方法では、図形内部と、図形の外枠とが別々の図形として抽出されていた。   Also, when the outer frame of the figure included in the image to be extracted is colored differently from the inside of the figure, in the first method, the inside of the figure and the outer frame of the figure are separated as separate figures. It was extracted.

第2の方法は、輪郭追跡という方法である。第2の方法は、画像内の図形の輪郭を走査することにより得られた閉曲線を図形として抽出する方法である。第2の方法では、抽出対象となる画像が互いに隣接した複数の図形を含んでいる場合、複数の図形をひとまとまりの図形として見た場合の輪郭のみを走査する結果、複数の図形の各々を分離して抽出することはできなかった。   The second method is contour tracking. The second method is a method of extracting a closed curve obtained by scanning the contour of a graphic in the image as a graphic. In the second method, when the image to be extracted includes a plurality of adjacent graphics, only the contours when the plurality of graphics are viewed as a group of graphics are scanned. It could not be separated and extracted.

第2の方法における、複数の図形の各々を分離して抽出することはできないという問題を解決し得る技術は、たとえば下記特許文献1および2などに開示されている。   Techniques that can solve the problem that the plurality of figures cannot be separated and extracted in the second method are disclosed, for example, in Patent Documents 1 and 2 below.

下記特許文献1には、画像処理装置によりディジタル画像の輪郭を追跡し画像領域を把握して輪郭情報を生成する画像処理方法が開示されている。この画像処理方法では、入力されたディジタル画像について、出発点の進行方向両端の画素の色と同じ画素の境界辺を追跡する輪郭追跡を行って輪郭線分を抽出する輪郭線分処理を行い、抽出された輪郭線分に関して分岐処理及び合成処理を行い、輪郭線分の結合で決まる輪郭を形成してディジタル画像の輪郭情報を生成する。   Patent Document 1 below discloses an image processing method in which the contour of a digital image is tracked by an image processing device, the image area is grasped, and contour information is generated. In this image processing method, the input digital image is subjected to contour line processing for extracting a contour line segment by performing contour tracking for tracking the boundary side of the pixel that is the same as the color of the pixels at both ends in the traveling direction of the starting point, Branch processing and synthesis processing are performed on the extracted contour line segment, and a contour determined by the combination of the contour line segments is formed to generate contour information of the digital image.

下記特許文献2には、交点抽出部が、入力画像から抽出した罫線同士の交点を抽出し、記憶部が、交点に属する各罫線に沿ってこの交点からそれぞれ遠ざかるまたは近づく向きの腕ベクトルと、この腕ベクトルが経路探索に用いられたか否かを示すフラグとを含んだ交点情報を記憶する枠線認識装置が開示されている。この枠線認識装置では、枠線抽出部が、所定の交点を始点として腕ベクトルの向きに従った経路探索を行うことによって閉じた経路が検出された場合に、この閉じた経路を枠線として抽出し、閉じた経路の検出に用いられた腕ベクトルに対応するフラグを使用済みへ更新し、すべてのフラグが使用済みへ更新された場合に、経路探索を終了させるように枠線認識装置を構成する。   In Patent Document 2 below, an intersection extraction unit extracts an intersection of ruled lines extracted from an input image, and a storage unit moves away from or approaches the intersection along each ruled line belonging to the intersection. A frame line recognition device that stores intersection information including a flag indicating whether or not this arm vector has been used for route search is disclosed. In this frame line recognition device, when a closed path is detected by a path search in accordance with the direction of the arm vector from a predetermined intersection as a starting point, the frame line extraction unit uses the closed path as a frame line. Extract and update the flag corresponding to the arm vector used to detect the closed route to used, and if all the flags are updated to used, the frame line recognition device will end the route search. Configure.

特開2006−31245号公報JP 200631245 A 特開2012−64098号公報JP 2012-64098 A

特許文献1の技術は、画像の色情報を利用して各図形の境界(色境界)を認識し、この境界を走査することにより得られる閉曲線を図形として抽出するものである。特許文献1の技術では、3色が交わる画素(分岐点)に走査点が到達した場合には、現在検出中の図形と同じ色の方向に進むことによって、図形を抽出している。しかし、この抽出方法には、画像に含まれる図形の外枠に図形内部とは別の色が施されている場合、図形内部と、図形の外枠とが別々の図形として抽出されるという問題があった。   The technique of Patent Document 1 recognizes a boundary (color boundary) of each figure using color information of an image, and extracts a closed curve obtained by scanning the boundary as a figure. In the technique of Patent Document 1, when a scanning point reaches a pixel (branch point) where three colors intersect, the figure is extracted by proceeding in the same color direction as the currently detected figure. However, this extraction method has a problem that when the outer frame of the figure included in the image is colored differently from the inside of the figure, the inside of the figure and the outer frame of the figure are extracted as separate figures. was there.

特許文献2の技術では、経路検索を行う前に全画素を調査し、全ての罫線の交点(分岐点)とこれに付随する進路とを保持しておく必要がある。このため、メモリ量が膨大になるという問題があった。加えて、検出に必要な分岐点として罫線の交点を用いるため、たとえば円形の図形などの罫線が無い図形の場合には図形を抽出することができないという問題があった。   In the technique of Patent Document 2, it is necessary to investigate all pixels before performing a route search, and to keep the intersections (branch points) of all ruled lines and the courses associated therewith. For this reason, there has been a problem that the amount of memory becomes enormous. In addition, since the intersection of ruled lines is used as a branching point necessary for detection, there is a problem that a figure cannot be extracted in the case of a figure having no ruled line such as a circular figure.

本発明は、上記課題を解決するためのものであり、その目的は、複数の図形を含む画像からそれぞれの図形を適切に抽出することのできる画像処理装置、画像処理装置の制御方法、および画像処理装置の制御プログラムを提供することである。   The present invention is for solving the above-described problems, and an object of the present invention is to provide an image processing apparatus capable of appropriately extracting each figure from an image including a plurality of figures, a control method for the image processing apparatus, and an image. A control program for a processing apparatus is provided.

本発明の一の局面に従う画像処理装置は、複数の図形を含む画像からそれぞれの図形を抽出する画像処理装置であって、複数の図形の各々の輪郭を画像から抽出する輪郭抽出手段と、輪郭抽出手段にて抽出した輪郭上の任意の点を開始点として、輪郭抽出手段にて抽出した輪郭を走査することにより、輪郭上の分岐点および開始点を検索する第1の走査手段と、第1の走査手段にて分岐点を発見した場合に、発見した分岐点の位置と、発見した分岐点から分岐した複数の経路とを記憶する記憶手段と、第1の走査手段にて分岐点を発見した場合に、発見した分岐点から分岐した複数の経路のうち進行方向に向かって特定の位置に存在する経路を、第1の走査手段にて走査する経路として選択する選択手段と、第1の走査手段にて開始点を発見した場合に、第1の走査手段にて走査した軌跡により構成された図形を抽出する図形抽出手段と、図形抽出手段にて図形を抽出した場合に、第1の走査手段にて発見した分岐点を新たな開始点とし、新たな開始点とした分岐点から分岐した複数の経路のうち、未走査経路を走査する第2の走査手段とを備える。   An image processing apparatus according to one aspect of the present invention is an image processing apparatus that extracts each figure from an image including a plurality of figures, and includes an outline extracting unit that extracts each outline of the plurality of figures from the image, First scanning means for searching for a branch point and a starting point on the contour by scanning the contour extracted by the contour extracting means with an arbitrary point on the contour extracted by the extracting means as a starting point; When a branch point is found by one scanning means, a storage means for storing the position of the found branch point and a plurality of paths branched from the found branch point; and a branch point by the first scanning means A selection unit that selects a path that exists at a specific position in the traveling direction among a plurality of paths branched from the found branch point when it is found, as a path to be scanned by the first scanning unit; Find the starting point with the scanning means The figure extracting means for extracting the figure constituted by the trajectory scanned by the first scanning means, and the branch point found by the first scanning means when the figure extracting means extracts the figure. And a second scanning unit that scans an unscanned path among a plurality of paths branched from a branch point that is a new start point.

上記画像処理装置において好ましくは、抽出する図形が無くなった場合に、輪郭抽出手段にて抽出した輪郭のうち図形として抽出されなかった輪郭を線分として抽出する線分抽出手段をさらに備える。   Preferably, the image processing apparatus further includes a line segment extracting unit that extracts, as a line segment, an outline that has not been extracted as a graphic out of the outlines extracted by the contour extracting unit when there is no graphic to be extracted.

上記画像処理装置において好ましくは、第1の走査手段にて分岐点を発見した後であって開始点を発見する前に、第1の走査手段にて発見した分岐点を再び発見した場合に、第1の走査手段にて走査した軌跡により構成された図形を破棄する破棄手段をさらに備える。   Preferably, in the above image processing apparatus, when the branch point discovered by the first scanning unit is found again after the branch point is discovered by the first scanning unit and before the start point is discovered, The apparatus further includes a discarding unit that discards the figure constituted by the trajectory scanned by the first scanning unit.

上記画像処理装置において好ましくは、第1の走査手段にて分岐点を発見した後であって開始点を発見する前に、第1の走査手段にて発見した分岐点を再び発見した場合に、第1の走査手段にて発見した複数の分岐点のうち、第1の走査手段にて始めに発見した分岐点を新たな開始点とし、新たな開始点とした分岐点から分岐した複数の経路のうち、第1の走査手段にて走査した経路とは異なる経路を走査する第3の走査手段をさらに備える。   Preferably, in the above image processing apparatus, when the branch point discovered by the first scanning unit is found again after the branch point is discovered by the first scanning unit and before the start point is discovered, Among a plurality of branch points found by the first scanning means, a branch point first discovered by the first scanning means is a new start point, and a plurality of paths branch from the branch point that is the new start point. Of these, a third scanning means for scanning a path different from the path scanned by the first scanning means is further provided.

上記画像処理装置において好ましくは、第2の走査手段は、第1の走査手段にて発見した複数の分岐点のうち、第1の走査手段にて始めに発見した分岐点を新たな開始点として走査する。   Preferably, in the image processing apparatus, the second scanning unit uses, as a new start point, a branch point first discovered by the first scanning unit among a plurality of branch points found by the first scanning unit. Scan.

上記画像処理装置において好ましくは、第2の走査手段は、第1の走査手段にて、始めに発見した分岐点が未走査経路を有していない場合に、第1の走査手段にて発見した複数の分岐点の中に、未走査経路を有している分岐点があるか否かを判別する経路判別手段と、経路判別手段にて、第1の走査手段にて発見した複数の分岐点の中に、未走査経路を有している分岐点があると判別した場合に、第1の走査手段にて発見した、未走査経路を有している分岐点のうち、第1の走査手段にて最も早く発見した分岐点を新たな開始点として、未走査経路を走査する第1の未走査経路走査手段とを備える。   Preferably, in the above image processing apparatus, the second scanning means is found by the first scanning means when the first branch point found by the first scanning means has no unscanned path. A path discriminating unit for discriminating whether or not there is a branch point having an unscanned path among the plurality of branch points, and a plurality of branch points found by the first scanning unit by the path discriminating unit The first scanning means among the branch points having the unscanned path discovered by the first scanning means when it is determined that there is a branch point having the unscanned path among them. And a first unscanned path scanning means for scanning the unscanned path with the branch point found earliest as a new start point.

上記画像処理装置において好ましくは、第2の走査手段は、経路判別手段にて、第1の走査手段にて発見した複数の分岐点の中に、未走査経路を有している分岐点が無いと判別した場合に、第1の走査手段による走査よりも前に行った走査のうち、未走査経路を有している分岐点を発見した最新の走査を特定する特定手段と、特定手段にて特定した走査の際に発見した、未走査経路を有している分岐点を新たな開始点として、未走査経路を走査する第2の未走査経路走査手段とを備える。   Preferably, in the image processing apparatus, the second scanning unit has no branch point having an unscanned path among the plurality of branch points found by the first scanning unit by the path determining unit. In the scanning performed before the scanning by the first scanning means, the identifying means for identifying the latest scan that has found a branch point having an unscanned path, and the identifying means And a second unscanned path scanning unit that scans the unscanned path with a branch point having an unscanned path discovered during the specified scan as a new start point.

上記画像処理装置において好ましくは、記憶手段にて記憶した分岐点から分岐した複数の経路のうち、図形抽出手段にて抽出した図形を構成する経路を消去する第1の消去手段と、記憶手段にて記憶した位置のうち、経路が全て消去された分岐点の位置を消去する第2の消去手段とをさらに備える。   Preferably, in the image processing apparatus, a first erasing unit for erasing a path constituting a graphic extracted by the graphic extracting unit among a plurality of paths branched from a branch point stored in the storing unit, and a storage unit And a second erasing unit for erasing the position of the branch point from which all paths are erased.

本発明の他の局面に従う画像処理装置の制御方法は、複数の図形を含む画像からそれぞれの図形を抽出する画像処理装置の制御方法であって、複数の図形の各々の輪郭を画像から抽出する輪郭抽出ステップと、輪郭抽出ステップにて抽出した輪郭上の任意の点を開始点として、輪郭抽出ステップにて抽出した輪郭を走査することにより、輪郭上の分岐点および開始点を検索する第1の走査ステップと、第1の走査ステップにて分岐点を発見した場合に、発見した分岐点の位置と、発見した分岐点から分岐した複数の経路とを記憶する記憶ステップと、第1の走査ステップにて分岐点を発見した場合に、発見した分岐点から分岐した複数の経路のうち進行方向に向かって特定の位置に存在する経路を、第1の走査ステップにて走査する経路として選択する選択ステップと、第1の走査ステップにて開始点を発見した場合に、第1の走査ステップにて走査した軌跡により構成された図形を抽出する図形抽出ステップと、図形抽出ステップにて図形を抽出した場合に、第1の走査ステップにて発見した分岐点を新たな開始点とし、新たな開始点とした分岐点から分岐した複数の経路のうち、未走査経路を走査する第2の走査ステップとを備える。   A control method for an image processing device according to another aspect of the present invention is a control method for an image processing device that extracts each graphic from an image including a plurality of graphics, and extracts each contour of the plurality of graphics from the image. A contour extraction step and a first point for searching for a branch point and a start point on the contour by scanning the contour extracted in the contour extraction step with an arbitrary point on the contour extracted in the contour extraction step as a start point A scanning step, a storage step for storing a position of the found branch point and a plurality of paths branched from the found branch point when a branch point is found in the first scan step, and a first scan When a branch point is found in a step, a route existing at a specific position in the traveling direction among a plurality of routes branched from the found branch point is set as a route scanned in the first scanning step. A selection step for selecting, a graphic extraction step for extracting a graphic constituted by the trajectory scanned in the first scanning step when a starting point is found in the first scanning step, and a graphic in the graphic extraction step Is extracted, the branch point found in the first scanning step is set as a new start point, and a second path that scans an unscanned path among a plurality of paths branched from the branch point set as the new start point A scanning step.

本発明のさらに他の局面に従う画像処理装置の制御プログラムは、複数の図形を含む画像からそれぞれの図形を抽出する画像処理装置の制御プログラムであって、複数の図形の各々の輪郭を画像から抽出する輪郭抽出ステップと、輪郭抽出ステップにて抽出した輪郭上の任意の点を開始点として、輪郭抽出ステップにて抽出した輪郭を走査することにより、輪郭上の分岐点および開始点を検索する第1の走査ステップと、第1の走査ステップにて分岐点を発見した場合に、発見した分岐点の位置と、発見した分岐点から分岐した複数の経路とを記憶する記憶ステップと、第1の走査ステップにて分岐点を発見した場合に、発見した分岐点から分岐した複数の経路のうち進行方向に向かって特定の位置に存在する経路を、第1の走査ステップにて走査する経路として選択する選択ステップと、第1の走査ステップにて開始点を発見した場合に、第1の走査ステップにて走査した軌跡により構成された図形を抽出する図形抽出ステップと、図形抽出ステップにて図形を抽出した場合に、第1の走査ステップにて発見した分岐点を新たな開始点とし、新たな開始点とした分岐点から分岐した複数の経路のうち、未走査経路を走査する第2の走査ステップとをコンピューターに実行させる。   A control program for an image processing apparatus according to still another aspect of the present invention is a control program for an image processing apparatus that extracts each figure from an image including a plurality of figures, and extracts each contour of the plurality of figures from the image. A contour extraction step to search for a branch point and a start point on the contour by scanning the contour extracted in the contour extraction step with an arbitrary point on the contour extracted in the contour extraction step as a starting point. A storage step for storing the position of the detected branch point and a plurality of paths branched from the detected branch point when a branch point is found in the first scan step; When a branch point is found in the scanning step, a route existing at a specific position in the traveling direction among a plurality of routes branched from the found branch point is set as the first scanning step. A selection step for selecting as a path to be scanned, a graphic extraction step for extracting a graphic constituted by the trajectory scanned in the first scanning step when a starting point is found in the first scanning step, and a graphic extraction When a figure is extracted in a step, the branch point found in the first scanning step is set as a new start point, and an unscanned path is scanned among a plurality of paths branched from the branch point set as the new start point. And causing the computer to execute a second scanning step.

本発明によれば、複数の図形を含む画像からそれぞれの図形を適切に抽出することのできる画像処理装置、画像処理装置の制御方法、および画像処理装置の制御プログラムを提供することができる。   According to the present invention, it is possible to provide an image processing apparatus, an image processing apparatus control method, and an image processing apparatus control program capable of appropriately extracting each figure from an image including a plurality of figures.

本発明の第1の実施の形態における画像形成装置の構成を示すブロック図である。1 is a block diagram illustrating a configuration of an image forming apparatus according to a first embodiment of the present invention. 本発明の第1の実施の形態において、画像形成装置が行う図形の抽出方法を説明する第1の図である。FIG. 3 is a first diagram illustrating a graphic extraction method performed by the image forming apparatus according to the first embodiment of the present invention. 本発明の第1の実施の形態において、画像形成装置が行う図形の抽出方法を説明する第1の図である。FIG. 3 is a first diagram illustrating a graphic extraction method performed by the image forming apparatus according to the first embodiment of the present invention. 本発明の第1の実施の形態における画像形成装置の動作を示すフローチャートである。3 is a flowchart showing an operation of the image forming apparatus in the first embodiment of the present invention. 本発明の第2の実施の形態において、画像形成装置が行う図形の抽出方法を説明する第1の図である。FIG. 10 is a first diagram illustrating a graphic extraction method performed by an image forming apparatus according to a second embodiment of the present invention. 本発明の第2の実施の形態において、画像形成装置が行う図形の抽出方法を説明する第1の図である。FIG. 10 is a first diagram illustrating a graphic extraction method performed by an image forming apparatus according to a second embodiment of the present invention. 本発明の第2の実施の形態において、画像形成装置が行う図形の抽出方法を説明する第1の図である。FIG. 10 is a first diagram illustrating a graphic extraction method performed by an image forming apparatus according to a second embodiment of the present invention. 本発明の第2の実施の形態における画像形成装置の動作を示すフローチャートである。6 is a flowchart illustrating an operation of the image forming apparatus according to the second embodiment of the present invention. 本発明の第3の実施の形態において、画像形成装置が行う図形の抽出方法を説明する第1の図である。FIG. 10 is a first diagram illustrating a figure extraction method performed by an image forming apparatus according to a third embodiment of the present invention. 本発明の第3の実施の形態において、画像形成装置が行う図形の抽出方法を説明する第2の図である。FIG. 10 is a second diagram illustrating a graphic extraction method performed by the image forming apparatus according to the third embodiment of the present invention. 本発明の第3の実施の形態における、図4のステップS119の開始点決定処理のサブルーチンである。It is a subroutine of the starting point determination process of step S119 of FIG. 4 in the third embodiment of the present invention. 本発明の第4の実施の形態において、画像形成装置が行う図形の抽出方法を説明する第1の図である。FIG. 10 is a first diagram illustrating a figure extraction method performed by an image forming apparatus in a fourth embodiment of the present invention. 本発明の第4の実施の形態において、画像形成装置が行う図形の抽出方法を説明する第2の図である。In the 4th Embodiment of this invention, it is the 2nd figure explaining the extraction method of the figure which an image forming apparatus performs. 本発明の第4の実施の形態において、画像形成装置が行う図形の抽出方法を説明する第3の図である。FIG. 10 is a third diagram illustrating a figure extracting method performed by the image forming apparatus in the fourth embodiment of the present invention. 本発明の第4の実施の形態において、画像形成装置が行う図形の抽出方法を説明する第4の図である。FIG. 10 is a fourth diagram illustrating a graphic extraction method performed by the image forming apparatus according to the fourth embodiment of the present invention. 本発明の第4の実施の形態における画像形成装置の動作を示すフローチャートである。10 is a flowchart illustrating an operation of an image forming apparatus according to a fourth embodiment of the present invention. 本発明の第1〜第4の実施の形態において抽出される図形を模式的に示す図である。It is a figure which shows typically the figure extracted in the 1st-4th embodiment of this invention.

以下、本発明の実施の形態について、図面に基づいて説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

以下の実施の形態においては、画像処理装置が、スキャナー機能、ファクシミリ機能、複写機能、プリンターとしての機能、データ通信機能、およびサーバー機能を備えたMFP(Multifunction Peripheral)である場合について説明する。画像処理装置は、たとえば電子写真方式や静電記録方式などによって画像形成を行うMFP以外の画像形成装置であってもよく、たとえばファクシミリ装置、複写機、またはプリンターなどであってもよい。画像処理装置は、画像形成装置以外のものであってもよく、たとえばPC(Personal Computer)、携帯電話、またはスキャナー装置などであってもよい。   In the following embodiments, a case will be described in which the image processing apparatus is an MFP (Multifunction Peripheral) having a scanner function, a facsimile function, a copy function, a printer function, a data communication function, and a server function. The image processing apparatus may be an image forming apparatus other than an MFP that forms an image by, for example, an electrophotographic system or an electrostatic recording system, and may be, for example, a facsimile machine, a copier, or a printer. The image processing apparatus may be other than the image forming apparatus, and may be a PC (Personal Computer), a mobile phone, a scanner device, or the like.

[第1の実施の形態]   [First Embodiment]

始めに、本実施の形態における画像形成装置の構成について説明する。   First, the configuration of the image forming apparatus in the present embodiment will be described.

図1は、本発明の第1の実施の形態における画像形成装置の構成を示すブロック図である。   FIG. 1 is a block diagram showing the configuration of the image forming apparatus according to the first embodiment of the present invention.

図1を参照して、本実施の形態における画像形成装置1は、スキャナー機能、ファクシミリ機能、複写機能、プリンターとしての機能、データ通信機能、およびサーバー機能を備えるMFPである。画像形成装置1は、制御部10と、固定記憶部20と、画像読取部30と、画像形成部40と、ネットワークI/F50と、操作パネル60とを含んでいる。   Referring to FIG. 1, image forming apparatus 1 according to the present embodiment is an MFP having a scanner function, a facsimile function, a copying function, a printer function, a data communication function, and a server function. The image forming apparatus 1 includes a control unit 10, a fixed storage unit 20, an image reading unit 30, an image forming unit 40, a network I / F 50, and an operation panel 60.

制御部10は、固定記憶部20、画像読取部30、画像形成部40、ネットワークI/F50、および操作パネル60の各々と接続されている。制御部10は、スキャンジョブ、コピージョブ、メール送信ジョブ、およびプリントジョブなどの各種ジョブについて、画像形成装置1全体の制御を行う。   The control unit 10 is connected to each of the fixed storage unit 20, the image reading unit 30, the image forming unit 40, the network I / F 50, and the operation panel 60. The control unit 10 controls the entire image forming apparatus 1 for various jobs such as a scan job, a copy job, a mail transmission job, and a print job.

固定記憶部20は、たとえばHDD(Hard Disk Drive)であり、画像読取部30で読み取った画像や、ネットワークI/F50を通じて外部機器から受信した画像などの各種情報を記憶する。   The fixed storage unit 20 is, for example, an HDD (Hard Disk Drive), and stores various information such as an image read by the image reading unit 30 and an image received from an external device through the network I / F 50.

画像読取部30は、原稿の画像を読み取ることにより、用紙に画像を形成する。   The image reading unit 30 forms an image on a sheet by reading an image of a document.

画像形成部40は、用紙に画像を形成する。画像形成部40は、おおまかに、トナー像形成部、定着装置、および用紙搬送部などで構成される。画像形成部40は、たとえば電子写真方式で用紙に画像を形成する。トナー像形成部は、いわゆるタンデム方式で4色の画像を合成し、用紙にカラー画像を形成する。トナー像形成部は、C(シアン)、M(マゼンタ)、Y(イエロー)、K(ブラック)の各色について設けられた感光体と、感光体からトナー像が転写(1次転写)される中間転写ベルトと、中間転写ベルトから用紙に画像を転写(2次転写)する転写部などで構成される。定着装置は、加熱ローラーおよび加圧ローラーを有する。定着装置は、加熱ローラーと加圧ローラーとでトナー像が形成された用紙を挟みながら搬送し、その用紙に加熱および加圧を行なう。これにより、定着装置は、用紙に付着したトナーを溶融させて用紙に定着させ、用紙に画像を形成する。用紙搬送部は、給紙ローラー、搬送ローラー、およびそれらを駆動するモーターなどで構成されている。用紙搬送部は、用紙を給紙カセットから給紙して、画像形成装置1の筐体の内部で搬送する。また、用紙搬送部は、画像が形成された用紙を画像形成装置1の筐体から排紙トレイなどに排出する。   The image forming unit 40 forms an image on a sheet. The image forming unit 40 is roughly composed of a toner image forming unit, a fixing device, a paper transport unit, and the like. The image forming unit 40 forms an image on a sheet by, for example, electrophotography. The toner image forming unit combines four color images by a so-called tandem method, and forms a color image on a sheet. The toner image forming unit includes a photoconductor provided for each color of C (cyan), M (magenta), Y (yellow), and K (black), and an intermediate in which a toner image is transferred (primary transfer) from the photoconductor. The image forming apparatus includes a transfer belt and a transfer unit that transfers an image from the intermediate transfer belt to a sheet (secondary transfer). The fixing device has a heating roller and a pressure roller. The fixing device conveys the sheet on which the toner image is formed between the heating roller and the pressure roller, and heats and presses the sheet. As a result, the fixing device melts the toner adhering to the paper and fixes it on the paper to form an image on the paper. The paper transport unit includes a paper feed roller, a transport roller, and a motor that drives them. The paper transport unit feeds the paper from the paper feed cassette and transports it inside the housing of the image forming apparatus 1. The paper transport unit discharges the paper on which the image is formed from the housing of the image forming apparatus 1 to a paper discharge tray or the like.

ネットワークI/F50は、画像形成装置1と、画像形成装置1とネットワークを通じて接続された外部機器との間の通信を行う。   The network I / F 50 performs communication between the image forming apparatus 1 and an external device connected to the image forming apparatus 1 through the network.

操作パネル60は、ユーザーに対して各種情報を表示し、ユーザーからの各種操作を受け付ける。   The operation panel 60 displays various information to the user and accepts various operations from the user.

制御部10は、CPU(Central Processing Unit)、ROM(Read Only Memory)、およびRAM(Random Access Memory)などからなっている。CPUは、ROMに記憶された制御プログラムを実行する。RAMは、CPUのワークエリアとなる。制御部10は、画像記憶部101と、前処理部102と、輪郭走査部103と、分岐点記憶部104と、進路選択部105と、図形判定部106と、図形記憶部107などを含んでいる。   The control unit 10 includes a CPU (Central Processing Unit), a ROM (Read Only Memory), a RAM (Random Access Memory), and the like. The CPU executes a control program stored in the ROM. The RAM is a work area for the CPU. The control unit 10 includes an image storage unit 101, a preprocessing unit 102, a contour scanning unit 103, a branch point storage unit 104, a course selection unit 105, a graphic determination unit 106, a graphic storage unit 107, and the like. Yes.

画像記憶部101は、図形抽出の対象となる画像を固定記憶部に保存する。   The image storage unit 101 stores an image to be subjected to graphic extraction in a fixed storage unit.

前処理部102は、固定記憶部に保存した画像から図形の輪郭を抽出することにより、画像を走査可能な状態に変換する。   The pre-processing unit 102 converts the image into a scannable state by extracting the contour of the figure from the image stored in the fixed storage unit.

輪郭走査部103は、前処理部102で抽出した輪郭を走査することにより、輪郭上の分岐点および開始点を検索する。輪郭走査部103は、連続した画素を追跡するだけであるので、図形形状には依存せずに輪郭を走査可能である。   The contour scanning unit 103 searches for a branch point and a start point on the contour by scanning the contour extracted by the preprocessing unit 102. Since the contour scanning unit 103 only tracks continuous pixels, the contour scanning unit 103 can scan the contour without depending on the figure shape.

分岐点記憶部104は、輪郭走査部103が分岐点を発見した場合に、その分岐点の位置(座標)と、その分岐点から分岐した複数の経路とを固定記憶部20に記憶する。分岐点記憶部104は、輪郭走査部103による走査の際に分岐点を発見した場合に、その分岐点を発見した順番を固定記憶部20に記憶することが好ましい。また分岐点記憶部104は、輪郭走査部103が走査を開始する際の開始点を固定記憶部20に記憶する。   When the contour scanning unit 103 finds a branch point, the branch point storage unit 104 stores the position (coordinates) of the branch point and a plurality of routes branched from the branch point in the fixed storage unit 20. When the branch point storage unit 104 finds a branch point during scanning by the contour scanning unit 103, the branch point storage unit 104 preferably stores the order in which the branch point is found in the fixed storage unit 20. The branch point storage unit 104 also stores in the fixed storage unit 20 a start point when the contour scanning unit 103 starts scanning.

進路選択部105は、輪郭走査部103が分岐点を発見した場合に、その分岐点から分岐した複数の経路(分岐点を構成する複数の経路)のうち、進行方向に向かって特定の位置に存在する経路(一定の方向に存在する経路)を、走査する経路として選択する。また進路選択部105は、輪郭の走査を再開する場合に開始点となる分岐点および走査する経路を選択する。進路選択部105は、進行方向に向かって常に特定の位置に存在する経路を選択するものであればよい。   The course selection unit 105, when the contour scanning unit 103 finds a branch point, out of a plurality of routes branched from the branch point (a plurality of routes constituting the branch point) at a specific position in the traveling direction. An existing path (a path existing in a certain direction) is selected as a path to be scanned. The course selection unit 105 selects a branch point as a starting point and a path to be scanned when the contour scanning is resumed. The route selection unit 105 only needs to select a route that always exists at a specific position in the traveling direction.

図形判定部106は、輪郭走査部103が開始点または分岐点を発見した場合に、分岐点記憶部104が記憶した分岐点の位置に基づいて、輪郭走査部103が走査した軌跡により構成された図形が閉曲線(閉ループ、閉領域)であるか否かを判定する。具体的には、輪郭走査部103が走査の際に開始点を再び発見した場合、図形判定部106は、走査した軌跡により構成された図形が閉曲線であると判定する。一方、輪郭走査部103が走査の際に分岐点を発見した後であって開始点を発見する前に、走査にて既に発見した分岐点を再び発見した場合、図形判定部106は、走査した軌跡により構成された図形が線分(開ループ)と閉曲線との組合せであると判定する。   The graphic determination unit 106 is configured by a trajectory scanned by the contour scanning unit 103 based on the position of the branch point stored in the branch point storage unit 104 when the contour scanning unit 103 finds a start point or a branch point. It is determined whether or not the figure is a closed curve (closed loop, closed region). Specifically, when the contour scanning unit 103 finds the start point again during scanning, the graphic determination unit 106 determines that the graphic formed by the scanned trajectory is a closed curve. On the other hand, when the contour scanning unit 103 finds a branch point at the time of scanning and before the start point is found, when the branch point already found in the scan is found again, the graphic determination unit 106 scans. It is determined that the figure formed by the locus is a combination of a line segment (open loop) and a closed curve.

図形記憶部107は、所定の場合に、走査した軌跡により構成された図形を抽出し、抽出した図形を固定記憶部20に記憶する。   The graphic storage unit 107 extracts a graphic constituted by the scanned trajectory and stores the extracted graphic in the fixed storage unit 20 in a predetermined case.

画像形成装置は、互いに隣接する複数の図形を含む画像からそれぞれの図形を抽出する。次に、本実施の形態において、画像形成装置が行う図形の抽出方法について説明する。   The image forming apparatus extracts each figure from an image including a plurality of figures adjacent to each other. Next, a graphic extraction method performed by the image forming apparatus in the present embodiment will be described.

図2および図3は、本発明の第1の実施の形態において、画像形成装置が行う図形の抽出方法を説明する図である。なお、以降の図においては、画像に含まれる図形の色の違いを太線のハッチングの種類によって示し、画像から抽出された図形を細線のハッチングによって示すことがある。   2 and 3 are diagrams for explaining a graphic extraction method performed by the image forming apparatus according to the first embodiment of the present invention. In the following drawings, the difference in the colors of the figures included in the image may be indicated by the type of bold hatching, and the figure extracted from the image may be indicated by the thin line hatching.

図2(a)を参照して、図形抽出の対象となる画像IMは、互いに隣接した図形FG1およびFG2を含んでいる。図形FG1およびFG2の各々は、正方形の形状を有している。図形FG1の内部はたとえば緑色であり、図形FG2の内部はたとえば青色である。図形FG1およびFG2の外枠はたとえば赤色である。   Referring to FIG. 2A, an image IM to be subjected to graphic extraction includes graphic FG1 and FG2 adjacent to each other. Each of the figures FG1 and FG2 has a square shape. The inside of the figure FG1 is, for example, green, and the inside of the figure FG2 is, for example, blue. The outer frame of the figures FG1 and FG2 is red, for example.

図2(b)を参照して、画像形成装置1は、固定記憶部20などから画像IMを入手すると、前処理部102を用いて画像IMから各図形の輪郭OLを抽出することにより、画像を走査可能な状態に変換する。画像形成装置1は、たとえば隣接する画素同士の明度差や色差などに基づいて図形FG1およびFG2の各々のエッジを抽出し、エッジに対して細線化を施すことにより、各図形の輪郭OLを抽出する。輪郭OLは線状であり、連続した画素で構成される。細線化とは、線幅を1画素にする手法を意味する。   Referring to FIG. 2B, when the image forming apparatus 1 obtains the image IM from the fixed storage unit 20 or the like, the image forming apparatus 1 extracts the contour OL of each figure from the image IM using the pre-processing unit 102. Is converted into a scannable state. For example, the image forming apparatus 1 extracts the edges of the figures FG1 and FG2 based on the brightness difference or color difference between adjacent pixels, and thins the edges to extract the outline OL of each figure. To do. The contour OL is linear and is composed of continuous pixels. Thinning means a technique for reducing the line width to one pixel.

次に画像形成装置1は、進路選択部105を用いて選択した開始点ST1から、図2中右方向に向かって輪郭OLの1回目の走査を開始する。画像形成装置1は、輪郭走査部103を用いて走査を行うことにより、輪郭OL上の分岐点および開始点ST1を検索する。画像形成装置1は、分岐点記憶部104を用いて、開始点ST1を固定記憶部20に記憶する。   Next, the image forming apparatus 1 starts the first scan of the contour OL from the start point ST1 selected using the course selection unit 105 toward the right in FIG. The image forming apparatus 1 searches the branch point and the start point ST1 on the contour OL by performing scanning using the contour scanning unit 103. The image forming apparatus 1 uses the branch point storage unit 104 to store the start point ST1 in the fixed storage unit 20.

1回目の走査の際の開始点の位置および開始点からの進行方向は任意である。1回目の走査の際、開始点の近傍には未走査の画素しか存在しないので、画像読取部30による画像の主走査方向(たとえば主走査方向が図2中左から右へ向かう方向であり、副走査方向が図2中上から下へ向かう方向である場合には、図2中右方向)を、輪郭走査部103による進行方向として選択してもよい。また、走査開始時の進行方向を右方向とした場合には、その後の分岐点において、分岐点から分岐した複数の経路のうち、進行方向に向かって最も右側の位置に存在する経路を常に選択してもよい。走査開始時の進行方向を左方向とした場合には、その後の分岐点において、分岐点から分岐した複数の経路のうち、進行方向に向かって最も左側の位置に存在する経路を常に選択してもよい。   The position of the starting point and the traveling direction from the starting point in the first scanning are arbitrary. At the time of the first scanning, only unscanned pixels exist in the vicinity of the start point. Therefore, the main scanning direction of the image by the image reading unit 30 (for example, the main scanning direction is the direction from the left to the right in FIG. If the sub-scanning direction is a direction from the top to the bottom in FIG. 2, the right direction in FIG. In addition, when the direction of travel at the start of scanning is set to the right, at the subsequent branch point, the route that is present at the rightmost position in the direction of travel is always selected from the multiple routes branched from the branch point. May be. When the advancing direction at the start of scanning is set to the left direction, a path that is present at the leftmost position in the advancing direction is always selected from the plurality of paths branched from the branching point at the subsequent branching point. Also good.

以降の実施の形態では、走査開始時の開始点からの進行方向を右方向とし、その後発見した分岐点において、分岐点から分岐した複数の経路のうち、進行方向に向かって最も右側の位置に存在する経路を常に選択するものとする。この場合には、最小単位の図形が時計回りに走査されることにとなる。   In the following embodiments, the traveling direction from the start point at the start of scanning is set to the right direction, and at the branch point discovered after that, among the plurality of paths branched from the branch point, it is at the rightmost position in the traveling direction. It is assumed that an existing route is always selected. In this case, the minimum unit figure is scanned clockwise.

図2(c)を参照して、画像形成装置1は、輪郭OLの走査の際に分岐点P11を発見する。この場合画像形成装置1は、分岐点記憶部104を用いて、分岐点P11の位置と、分岐点P11から分岐した経路L11AおよびL11Bとを固定記憶部20に記憶する。このとき、画像形成装置1は、分岐点P11から分岐した経路のうち走査済の経路L11Cを、経路L11AおよびL11Bとともに固定記憶部20に記憶してもよいし、経路L11Cを記憶しなくてもよい。   Referring to FIG. 2C, the image forming apparatus 1 finds a branch point P11 when scanning the contour OL. In this case, the image forming apparatus 1 uses the branch point storage unit 104 to store the position of the branch point P11 and the routes L11A and L11B branched from the branch point P11 in the fixed storage unit 20. At this time, the image forming apparatus 1 may store the scanned path L11C among the paths branched from the branch point P11 in the fixed storage unit 20 together with the paths L11A and L11B, or may not store the path L11C. Good.

輪郭OLの走査の際に分岐点P11を発見した場合、画像形成装置1は、進路選択部105を用いて、経路L11AおよびL11Bのうち、進行方向に向かって最も右側の位置に存在する経路である経路L11Aを、走査する経路として選択する。   When the branch point P11 is found during the scanning of the contour OL, the image forming apparatus 1 uses the route selection unit 105 to select a route that exists at the rightmost position in the traveling direction among the routes L11A and L11B. A certain path L11A is selected as a path to be scanned.

図2(d)を参照して、画像形成装置1は、輪郭OLの走査の際に分岐点P12を発見する。この場合画像形成装置1は、分岐点P12の位置と、分岐点P12から分岐した経路L12AおよびL12Bとを固定記憶部20に記憶する。また、画像形成装置1は、経路L12AおよびL12Bのうち、進行方向に向かって最も右側の位置に存在する経路である経路L12Aを、走査する経路として選択する。   Referring to FIG. 2D, the image forming apparatus 1 finds a branch point P12 when scanning the contour OL. In this case, the image forming apparatus 1 stores the position of the branch point P12 and the paths L12A and L12B branched from the branch point P12 in the fixed storage unit 20. In addition, the image forming apparatus 1 selects a path L12A, which is a path located at the rightmost position in the traveling direction, among the paths L12A and L12B as a path to be scanned.

図2(e)を参照して、画像形成装置1は、輪郭OLの走査の際に開始点ST1を発見する。この場合画像形成装置1は、図形判定部106を用いて、輪郭走査部103が走査した軌跡により構成された図形が閉曲線であると判定する。   Referring to FIG. 2E, the image forming apparatus 1 finds the start point ST1 when scanning the contour OL. In this case, the image forming apparatus 1 uses the graphic determination unit 106 to determine that the graphic formed by the locus scanned by the contour scanning unit 103 is a closed curve.

図3(a)を参照して、走査した軌跡により構成された図形が閉曲線である場合、画像形成装置1は、図形記憶部107を用いて、走査した軌跡により構成された図形FG51を抽出し、固定記憶部20に記憶する。これにより、1回目の走査が終了する。   Referring to FIG. 3A, when the figure formed by the scanned locus is a closed curve, the image forming apparatus 1 uses the figure storage unit 107 to extract the figure FG51 formed by the scanned locus. And stored in the fixed storage unit 20. Thereby, the first scan is completed.

図3(b)を参照して、画像形成装置1は、図形を抽出した場合において、固定記憶部20に記憶した経路の中に未走査経路が残っているときは、2回目の走査を行う。画像形成装置1は、1回目の走査において発見した分岐点のうち任意の分岐点を新たな開始点とし、その分岐点から分岐した複数の経路のうち、未走査経路を走査する。ここでは、分岐点P11を新たな開始点ST2として、未走査経路である経路L11Bに沿って(図3中右方向に向かって)輪郭OLの2回目の走査を開始する。   Referring to FIG. 3B, the image forming apparatus 1 performs the second scan when a figure is extracted and an unscanned path remains in the path stored in the fixed storage unit 20. . The image forming apparatus 1 sets an arbitrary branch point among the branch points found in the first scan as a new start point, and scans an unscanned path among a plurality of paths branched from the branch point. Here, the second scan of the contour OL is started along the path L11B that is an unscanned path (toward the right in FIG. 3) with the branch point P11 as a new start point ST2.

図3(c)を参照して、画像形成装置1は、輪郭OLの走査の際に分岐点P12を発見した後(分岐点P12の位置、および分岐点P12から分岐した経路は、固定記憶部20に既に記憶されているので、新たに記憶させない)、画像形成装置1は、輪郭OLの走査の際に開始点ST2を発見する。この場合画像形成装置1は、図形判定部106を用いて、輪郭走査部103が走査した軌跡により構成された図形が閉曲線であると判定する。   Referring to FIG. 3C, after the image forming apparatus 1 finds the branch point P12 during the scanning of the contour OL (the position of the branch point P12 and the path branched from the branch point P12 are fixed storage units). The image forming apparatus 1 finds the start point ST2 when scanning the contour OL. In this case, the image forming apparatus 1 uses the graphic determination unit 106 to determine that the graphic formed by the locus scanned by the contour scanning unit 103 is a closed curve.

図3(d)を参照して、画像形成装置1は、図形記憶部107を用いて、走査した軌跡により構成された図形FG52を抽出し、固定記憶部20に記憶する。これにより、2回目の走査が終了する。   With reference to FIG. 3D, the image forming apparatus 1 uses the graphic storage unit 107 to extract a graphic FG 52 constituted by the scanned locus and stores it in the fixed storage unit 20. Thereby, the second scan is completed.

図形FG52の抽出後、固定記憶部20に記憶した経路の中には図形を抽出できる経路が残っていない。この場合画像形成装置1は、抽出する図形が無くなったと判断し、図形として抽出していない輪郭が存在する場合には、それを線分として抽出する。以上により、図形の抽出が完了する。   After the graphic FG 52 is extracted, there is no route that can extract the graphic among the routes stored in the fixed storage unit 20. In this case, the image forming apparatus 1 determines that there is no figure to be extracted, and if there is an outline that is not extracted as a figure, extracts it as a line segment. The graphic extraction is thus completed.

図4は、本発明の第1の実施の形態における画像形成装置の動作を示すフローチャートである。   FIG. 4 is a flowchart showing the operation of the image forming apparatus according to the first embodiment of the present invention.

図4を参照して、操作パネル60または外部機器などを通じて画像から図形を抽出する指示を受け付けると、制御部10は、画像から各図形の輪郭を抽出し(S101)、開始点を設定する(S103)。続いて制御部10は、開始点から任意の方向に輪郭の走査を開始し(S105)、走査の際に分岐点を発見したか否かを判別する(S107)。   Referring to FIG. 4, upon receiving an instruction to extract a graphic from an image through operation panel 60 or an external device, control unit 10 extracts the contour of each graphic from the image (S101) and sets a start point (S101). S103). Subsequently, the control unit 10 starts scanning the contour in an arbitrary direction from the start point (S105), and determines whether or not a branch point has been found during the scan (S107).

ステップS107において、分岐点を発見したと判別した場合(S107でYES)、制御部10は、発見した分岐点が、固定記憶部20に既に記憶した分岐点であるか否かを判別する(S109)。   If it is determined in step S107 that a branch point has been found (YES in S107), the control unit 10 determines whether the found branch point is a branch point already stored in the fixed storage unit 20 (S109). ).

ステップS109において、固定記憶部20に既に記憶した分岐点であると判別した場合(S109でYES)、制御部10は、発見した分岐点から分岐した複数の経路のうち、進行方向に向かって最も右側(右端)の位置に存在する経路を選択し(S111)、ステップS107の処理へ進む。   If it is determined in step S109 that the branch point has already been stored in the fixed storage unit 20 (YES in S109), the control unit 10 is the most in the traveling direction among a plurality of routes branched from the found branch point. A route existing at the right side (right end) position is selected (S111), and the process proceeds to step S107.

ステップS109において、固定記憶部20に既に記憶した分岐点でないと判別した場合(S109でNO)、制御部10は、発見した分岐点の位置および発見した分岐点から分岐した経路を固定記憶部20に記憶し(S110)、ステップS111の処理へ進む。   If it is determined in step S109 that the branch point is not already stored in the fixed storage unit 20 (NO in S109), the control unit 10 determines the position of the found branch point and the route branched from the found branch point. (S110), and the process proceeds to step S111.

ステップS107において、分岐点を発見しないと判別した場合(S107でNO)、制御部10は、開始点を発見したか否かを判別する(S113)。   If it is determined in step S107 that no branch point is found (NO in S107), the control unit 10 determines whether a start point is found (S113).

ステップS113において、開始点を発見しないと判別した場合(S113でNO)、制御部10はステップS107の処理へ進む。一方、ステップS113において、開始点を発見したと判別した場合(S113でYES)、制御部10は、走査した軌跡により構成された図形が閉曲線であると判定する。この場合制御部10は、走査した軌跡により構成された図形を抽出し、固定記憶部20に記憶し、その回の走査を終了する(S115)。次に制御部10は、固定記憶部20に記憶した経路の中に未走査経路が残っているか否かを判別する(S117)。   If it is determined in step S113 that no starting point is found (NO in S113), the control unit 10 proceeds to the process of step S107. On the other hand, if it is determined in step S113 that a starting point has been found (YES in S113), the control unit 10 determines that the figure formed by the scanned locus is a closed curve. In this case, the control unit 10 extracts a figure constituted by the scanned trajectory, stores it in the fixed storage unit 20, and ends the scanning for that time (S115). Next, the control unit 10 determines whether or not an unscanned path remains in the path stored in the fixed storage unit 20 (S117).

ステップS117において、固定記憶部20に記憶した経路の中に未走査経路が残っていると判別した場合(S117でYES)、制御部10は、開始点を移動する処理である開始点決定処理を行う(S119)。本実施の形態では、開始点決定処理として、制御部10は、直近で終了した走査において発見した任意の分岐点を開始点に決定する。次に制御部10は、決定した開始点から未走査経路に沿って次の走査を開始し(S121)、ステップS107の処理へ進む。   If it is determined in step S117 that an unscanned path remains in the path stored in the fixed storage unit 20 (YES in S117), the control unit 10 performs a start point determination process that is a process of moving the start point. Perform (S119). In the present embodiment, as the start point determination process, the control unit 10 determines an arbitrary branch point found in the most recently completed scan as the start point. Next, the control unit 10 starts the next scan along the unscanned path from the determined start point (S121), and proceeds to the process of step S107.

ステップS117において、固定記憶部20に記憶した経路の中に未走査経路が残っていないと判別した場合(S117でNO)、制御部10は、図形として抽出していない輪郭があれば、それを線分として抽出し(S123)、処理を終了する。   If it is determined in step S117 that no unscanned path remains in the path stored in the fixed storage unit 20 (NO in S117), the control unit 10 determines that there is an outline that has not been extracted as a graphic. A line segment is extracted (S123), and the process ends.

[第2の実施の形態]   [Second Embodiment]

図5〜図7は、本発明の第2の実施の形態において、画像形成装置が行う図形の抽出方法を説明する図である。   5 to 7 are diagrams for explaining a graphic extraction method performed by the image forming apparatus according to the second embodiment of the present invention.

図5(a)を参照して、図形抽出の対象となる画像IMは、互いに隣接した図形FG1、線分FG2、図形FG3、および図形FG4を含んでいる。図形FG1は、正方形の形状を有している。図形FG3およびFG4は、長方形の形状を有している。図形FG1およびFG3の内部はたとえば緑色であり、図形FG4の内部はたとえば青色である。線分FG2はたとえば赤色であり、図形FG1、FG3、およびFG4の外枠はたとえば赤色である。   Referring to FIG. 5 (a), an image IM to be extracted includes a graphic FG1, a line segment FG2, a graphic FG3, and a graphic FG4 that are adjacent to each other. The figure FG1 has a square shape. The figures FG3 and FG4 have a rectangular shape. The inside of figures FG1 and FG3 is, for example, green, and the inside of figure FG4 is, for example, blue. The line segment FG2 is red, for example, and the outer frames of the figures FG1, FG3, and FG4 are red, for example.

図5(b)を参照して、画像形成装置1は、固定記憶部20などから画像IMを入手すると、画像IMから各図形の輪郭OLを抽出することにより、画像を走査可能な状態に変換する。   Referring to FIG. 5B, when the image forming apparatus 1 obtains the image IM from the fixed storage unit 20 or the like, the image forming apparatus 1 extracts the contour OL of each figure from the image IM and converts the image into a scannable state. To do.

図5(c)を参照して、画像形成装置1は、任意の開始点ST1から、図5中右方向に向かって輪郭OLの1回目の走査を開始する。画像形成装置1は、開始点ST1を固定記憶部20に記憶する。   Referring to FIG. 5C, the image forming apparatus 1 starts the first scan of the contour OL from the arbitrary start point ST1 toward the right in FIG. The image forming apparatus 1 stores the start point ST1 in the fixed storage unit 20.

画像形成装置1は、輪郭OLの走査の際に分岐点P11を発見し、分岐点P11の位置と、分岐点P11から分岐した経路L11AおよびL11Bとを固定記憶部20に記憶する。また、画像形成装置1は、経路L11AおよびL11Bのうち、進行方向に向かって最も右側の位置に存在する経路である経路L11Aを、走査する経路として選択する。   The image forming apparatus 1 finds the branch point P11 when scanning the contour OL, and stores the position of the branch point P11 and the paths L11A and L11B branched from the branch point P11 in the fixed storage unit 20. Further, the image forming apparatus 1 selects the path L11A, which is the path located at the rightmost position in the traveling direction, among the paths L11A and L11B as the scanning path.

画像形成装置1は、輪郭OLの走査の際に開始点ST1を発見する。この場合画像形成装置1は、輪郭走査部103が走査した軌跡により構成された図形が閉曲線であると判定する。   The image forming apparatus 1 finds the start point ST1 when scanning the contour OL. In this case, the image forming apparatus 1 determines that the figure formed by the locus scanned by the contour scanning unit 103 is a closed curve.

図5(d)を参照して、画像形成装置1は、走査した軌跡により構成された図形FG51を抽出し、固定記憶部20に記憶する。これにより、1回目の走査が終了する。   With reference to FIG. 5D, the image forming apparatus 1 extracts a graphic FG 51 formed by the scanned locus and stores it in the fixed storage unit 20. Thereby, the first scan is completed.

続いて画像形成装置1は、未走査経路を有する任意の分岐点である分岐点P11を開始点ST2として、未走査経路である経路L11Bに沿って(図5中右方向に向かって)輪郭OLの2回目の走査を開始する。   Subsequently, the image forming apparatus 1 uses the branch point P11, which is an arbitrary branch point having an unscanned path, as a start point ST2, and follows the contour OL along the path L11B, which is the unscanned path (toward the right in FIG. 5). The second scan is started.

図6(a)を参照して、画像形成装置1は、輪郭OLの走査の際に分岐点P21を発見する。この場合画像形成装置1は、分岐点P21の位置と、分岐点P21から分岐した経路L21AおよびL21Bとを固定記憶部20に記憶する。また、画像形成装置1は、経路L21AおよびL21Bのうち、進行方向に向かって最も右側の位置に存在する経路である経路L21Aを、走査する経路として選択する。   Referring to FIG. 6A, the image forming apparatus 1 finds a branch point P21 when scanning the contour OL. In this case, the image forming apparatus 1 stores the position of the branch point P21 and the routes L21A and L21B branched from the branch point P21 in the fixed storage unit 20. Further, the image forming apparatus 1 selects the path L21A, which is the path located at the rightmost position in the traveling direction, among the paths L21A and L21B as the scanning path.

図6(b)を参照して、画像形成装置1は、輪郭OLの走査の際に分岐点P22を発見する。この場合画像形成装置1は、分岐点P22の位置と、分岐点P22から分岐した経路L22AおよびL22Bとを固定記憶部20に記憶する。また、画像形成装置1は、経路L22AおよびL22Bのうち、進行方向に向かって最も右側の位置に存在する経路である経路L22Aを、走査する経路として選択する。   Referring to FIG. 6B, the image forming apparatus 1 finds a branch point P22 when scanning the contour OL. In this case, the image forming apparatus 1 stores the position of the branch point P22 and the paths L22A and L22B branched from the branch point P22 in the fixed storage unit 20. Further, the image forming apparatus 1 selects the path L22A, which is the path located at the rightmost position in the traveling direction, among the paths L22A and L22B as the scanning path.

図6(c)を参照して、画像形成装置1は、輪郭OLの走査の際に分岐点P23を発見する。この場合画像形成装置1は、分岐点P23の位置と、分岐点P23から分岐した経路L23AおよびL23Bとを固定記憶部20に記憶する。また、画像形成装置1は、経路L23AおよびL23Bのうち、進行方向に向かって最も右側の位置に存在する経路である経路L23Aを、走査する経路として選択する。   Referring to FIG. 6C, the image forming apparatus 1 finds a branch point P23 when scanning the contour OL. In this case, the image forming apparatus 1 stores the position of the branch point P23 and the paths L23A and L23B branched from the branch point P23 in the fixed storage unit 20. In addition, the image forming apparatus 1 selects a path L23A, which is a path located at the rightmost position in the traveling direction, among the paths L23A and L23B as a path to be scanned.

図6(d)を参照して、輪郭OLの走査の際に分岐点P21を再び発見する。このように、2回目の走査にて分岐点を発見した後であって開始点を発見する前に、2回目の走査で発見した分岐点を再び発見した場合、2回目の走査の際の図形の走査方向が狙いの方向とは逆方向(反時計回り)になり、最小単位で図形を抽出できていない状態にある。これは、走査の開始点が閉曲線上ではなく線分上に存在していることに起因している。この場合画像形成装置1は、図形判定部106を用いて、2回目に走査した軌跡により構成された図形が線分と閉曲線との組合せであると判定し、2回目の走査を終了し、2回目に走査した軌跡により構成された図形を破棄する。また画像形成装置1は、2回目の走査の際に新たに走査した経路を未走査経路に戻す。   With reference to FIG. 6D, the branch point P21 is found again during the scanning of the contour OL. As described above, when the branch point found in the second scan is found again after the branch point is found in the second scan and before the start point is found, the figure in the second scan The scanning direction is opposite to the target direction (counterclockwise), and the figure cannot be extracted in the minimum unit. This is due to the fact that the start point of the scan is not on the closed curve but on the line segment. In this case, the image forming apparatus 1 uses the graphic determination unit 106 to determine that the graphic formed by the trajectory scanned the second time is a combination of a line segment and a closed curve, and ends the second scanning. The figure formed by the trajectory scanned the second time is discarded. Further, the image forming apparatus 1 returns the newly scanned path to the unscanned path during the second scan.

なお、走査にて分岐点を発見した後であって開始点を発見する前に、2回目の走査の際に発見した分岐点を再び発見した場合、画像形成装置1は、上述以外の特定の処理(たとえばユーザーへの通知や、線分と閉曲線との分離など)を行ってもよい。   When the branch point discovered in the second scan is found again after the branch point is found by scanning and before the start point is discovered, the image forming apparatus 1 determines that a specific point other than the above is specified. Processing (for example, notification to a user or separation of a line segment and a closed curve) may be performed.

図7(a)を参照して、分岐点P21を再び発見した場合、画像形成装置1は、2回目の走査の際に発見した複数の分岐点のうち始めに発見した分岐点である分岐点P21を新たな開始点ST3として、経路L21Bに沿って3回目の走査を開始する。経路L21Bは、分岐点P21の未走査の経路L21AおよびL21Bのうち、2回目の走査の際に走査した経路L21Aとは異なる経路である。   With reference to FIG. 7A, when the branch point P21 is found again, the image forming apparatus 1 is the first branch point found among the plurality of branch points found during the second scan. A third scan is started along the path L21B with P21 as a new start point ST3. The path L21B is a path different from the path L21A scanned during the second scan among the unscanned paths L21A and L21B at the branch point P21.

図7(b)を参照して、画像形成装置1は、輪郭OLの走査の際に分岐点P23およびP22を発見した後(分岐点P23およびP22の位置、ならびに分岐点P23およびP22から分岐した経路は、固定記憶部20に既に記憶されているので、新たに記憶させない)、開始点ST3を発見する。この場合画像形成装置1は、走査した軌跡により構成された図形が閉曲線であると判定する。   Referring to FIG. 7B, image forming apparatus 1 finds branch points P23 and P22 during the scanning of contour OL (the positions of branch points P23 and P22 and the branch points P23 and P22). Since the route is already stored in the fixed storage unit 20, it is not newly stored), and the start point ST3 is found. In this case, the image forming apparatus 1 determines that the figure formed by the scanned locus is a closed curve.

図7(c)を参照して、画像形成装置1は、走査した軌跡により構成された図形FG52を抽出し、固定記憶部20に記憶する。これにより、3回目の走査が終了する。   With reference to FIG. 7C, the image forming apparatus 1 extracts the figure FG52 formed by the scanned trajectory and stores it in the fixed storage unit 20. Thereby, the third scan is completed.

図7(d)を参照して、画像形成装置1は、図形を抽出した場合において、未走査経路を有する任意の分岐点である分岐点P23を新たな開始点ST4として、未走査経路である経路L21Cに沿って(図7中右方向に向かって)輪郭OLの4回目の走査を開始する。   Referring to FIG. 7D, in the case of extracting a figure, the image forming apparatus 1 is an unscanned path with a branch point P23, which is an arbitrary branch point having an unscanned path, as a new start point ST4. A fourth scan of the contour OL is started along the path L21C (toward the right in FIG. 7).

図7(e)を参照して、画像形成装置1は、輪郭OLの走査の際に開始点ST4を発見する。この場合画像形成装置1は、走査した軌跡により構成された図形が閉曲線であると判定する。   Referring to FIG. 7E, the image forming apparatus 1 finds the start point ST4 when scanning the contour OL. In this case, the image forming apparatus 1 determines that the figure formed by the scanned locus is a closed curve.

画像形成装置1は、走査した軌跡により構成された図形FG53を抽出し、固定記憶部20に記憶する。これにより、4回目の走査が終了する。   The image forming apparatus 1 extracts the figure FG53 configured by the scanned locus and stores it in the fixed storage unit 20. This completes the fourth scan.

図形FG53の抽出後、固定記憶部20に記憶した経路の中には図形を抽出できる経路が残っていない。この場合画像形成装置1は、抽出する図形が無くなったと判断し、図形として抽出していない輪郭である分岐点P11と分岐点P21とを結ぶ直線を線分FG54として抽出する。以上により、図形の抽出が完了する。   After the graphic FG 53 is extracted, there is no route that can extract the graphic among the routes stored in the fixed storage unit 20. In this case, the image forming apparatus 1 determines that there is no figure to be extracted, and extracts, as a line segment FG54, a straight line connecting the branch point P11 and the branch point P21, which is an outline not extracted as a figure. The graphic extraction is thus completed.

図8は、本発明の第2の実施の形態における画像形成装置の動作を示すフローチャートである。   FIG. 8 is a flowchart showing the operation of the image forming apparatus according to the second embodiment of the present invention.

図8を参照して、このフローチャートは、ステップS109の処理の後に実行する処理が、図4に示す第1の実施の形態の場合のフローチャートと異なっている。   Referring to FIG. 8, this flowchart is different from the flowchart in the case of the first embodiment shown in FIG. 4 in the process executed after the process of step S109.

ステップS109において、発見した分岐点が、固定記憶部20に既に記憶した分岐点であると判別した場合(S109でYES)、制御部10は、発見した分岐点が、現在の(今回の)走査で既に発見した分岐点であるか否かを判別する(S201)。   If it is determined in step S109 that the found branch point is a branch point already stored in the fixed storage unit 20 (YES in S109), the control unit 10 determines that the found branch point is the current (current) scan. It is determined whether or not the branch point has already been found in step S201.

ステップS201において、現在の走査で既に発見した分岐点であると判別した場合(S201でYES)、制御部10は、今回走査した軌跡により構成された図形が線分と閉曲線との組合せであると判定し、今回走査した軌跡により構成された図形を破棄し、今回の走査を終了する(S203)。続いて制御部10は、直近で終了した走査の際に発見した複数の分岐点のうち始めに発見した分岐点に開始点を移動し(S205)、次の走査を開始し(S207)、ステップS107の処理へ進む。   If it is determined in step S201 that the branch point has already been found in the current scan (YES in S201), the control unit 10 determines that the figure formed by the trajectory scanned this time is a combination of a line segment and a closed curve. The determination is made, the figure constituted by the trajectory scanned this time is discarded, and the current scanning is terminated (S203). Subsequently, the control unit 10 moves the start point to the first branch point found among the plurality of branch points found during the most recently completed scan (S205), and starts the next scan (S207), step The process proceeds to S107.

ステップS201において、現在の走査で既に発見した分岐点でないと判別した場合(S201でNO)、制御部10はステップS111の処理へ進む。   If it is determined in step S201 that the branch point is not already found in the current scan (NO in S201), the control unit 10 proceeds to the process of step S111.

なお、本実施の形態の画像形成装置の構成および上述以外の動作については、第1の実施の形態の場合と同様であるので、その説明は繰り返さない。   Note that the configuration of the image forming apparatus according to the present embodiment and operations other than those described above are the same as those in the first embodiment, and therefore description thereof will not be repeated.

[第3の実施の形態]   [Third Embodiment]

図9および図10は、本発明の第3の実施の形態において、画像形成装置が行う図形の抽出方法を説明する図である。   9 and 10 are diagrams for explaining a graphic extraction method performed by the image forming apparatus according to the third embodiment of the present invention.

図9(a)を参照して、図形抽出の対象となる画像IMは、互いに隣接した図形FG1、FG2、およびFG3を含んでいる。図形FG1、FG2、およびFG3の各々は、正方形の形状を有している。図形FG1の内部はたとえば赤色であり、図形FG2の内部はたとえば緑色であり、図形FG3の内部はたとえば青色である。図形FG1、FG2、およびFG3の外枠はたとえば黒色である。   Referring to FIG. 9A, an image IM to be subjected to graphic extraction includes graphic FG1, FG2, and FG3 adjacent to each other. Each of the figures FG1, FG2, and FG3 has a square shape. The inside of the figure FG1 is, for example, red, the inside of the figure FG2 is, for example, green, and the inside of the figure FG3 is, for example, blue. The outer frames of the figures FG1, FG2, and FG3 are, for example, black.

図9(b)を参照して、画像形成装置1は、固定記憶部20などから画像IMを入手すると、画像IMから各図形の輪郭OLを抽出することにより、画像を走査可能な状態に変換する。   Referring to FIG. 9B, when the image forming apparatus 1 obtains the image IM from the fixed storage unit 20 or the like, the image forming apparatus 1 converts the image into a scannable state by extracting the contour OL of each figure from the image IM. To do.

画像形成装置1は、任意の開始点ST1から、図9中右方向に向かって輪郭OLの1回目の走査を開始する。画像形成装置1は、開始点ST1を固定記憶部20に記憶する。   The image forming apparatus 1 starts the first scan of the contour OL from the arbitrary start point ST1 toward the right in FIG. The image forming apparatus 1 stores the start point ST1 in the fixed storage unit 20.

図9(c)を参照して、画像形成装置1は、輪郭OLの走査の際に分岐点P11、P12、およびP13を発見し、分岐点P11、P12、およびP13の各々の位置と、分岐点P11、P12、およびP13の各々から分岐した経路とを固定記憶部20に記憶する。また、画像形成装置1は、分岐点P11、P12、およびP13の各々において、進行方向に向かって最も右側の位置に存在する経路を走査する経路として選択する。   Referring to FIG. 9C, the image forming apparatus 1 finds branch points P11, P12, and P13 during the scanning of the contour OL, and determines the positions of the branch points P11, P12, and P13 and the branch points. The path branched from each of the points P11, P12, and P13 is stored in the fixed storage unit 20. Further, the image forming apparatus 1 selects the path existing at the rightmost position in the traveling direction at each of the branch points P11, P12, and P13 as a path to be scanned.

画像形成装置1は、輪郭OLの走査の際に開始点ST1を発見する。この場合画像形成装置1は、輪郭走査部103が走査した軌跡により構成された図形が閉曲線であると判定する。   The image forming apparatus 1 finds the start point ST1 when scanning the contour OL. In this case, the image forming apparatus 1 determines that the figure formed by the locus scanned by the contour scanning unit 103 is a closed curve.

図9(d)を参照して、画像形成装置1は、走査した軌跡により構成された図形FG51を抽出し、固定記憶部20に記憶する。これにより、1回目の走査が終了する。   With reference to FIG. 9D, the image forming apparatus 1 extracts the figure FG51 configured by the scanned locus and stores it in the fixed storage unit 20. Thereby, the first scan is completed.

続いて画像形成装置1は、1回目の走査の際に発見した分岐点P11、P12、およびP13のうち、1回目の走査の際に始めに発見した分岐点P11を、2回目の走査の開始点ST2とする。画像形成装置1は、分岐点P11から分岐した経路のうち未走査経路である経路L11Aに沿って、2回目の走査を開始する。   Subsequently, the image forming apparatus 1 starts the second scan of the branch point P11 found first during the first scan among the branch points P11, P12, and P13 found during the first scan. Let it be point ST2. The image forming apparatus 1 starts the second scan along the path L11A that is an unscanned path among the paths branched from the branch point P11.

なお画像形成装置は、1回目の走査の際に始めに発見した分岐点が未走査経路を有していない場合において、1回目の走査の際に発見した分岐点の中に未走査経路を有している分岐点があるときは、1回目の走査の際に発見した未走査経路を有している分岐点のうち、1回目の走査の際に最も早く発見した分岐点を新たな開始点として、2回目の走査を行ってもよい。   Note that the image forming apparatus has an unscanned path in the branch point found in the first scan when the first discovered branch point in the first scan does not have an unscanned path. If there is a branch point that has been detected, among the branch points having an unscanned path that was found during the first scan, the branch point that was found earliest during the first scan is set as the new start point. As a result, the second scan may be performed.

さらに画像形成装置1は、今回の走査(直近で終了した走査)の際に発見した分岐点の中に、未走査経路を有している分岐点が無い場合に、今回の走査よりも前に行った走査の中から、未走査経路を有している分岐点を発見した最新の走査を特定し、特定した走査の際に発見した、未走査経路を有している分岐点を新たな開始点として、次の走査を行ってもよい。   Further, the image forming apparatus 1 determines that the branch point found during the current scan (the most recently completed scan) has no branch point having an unscanned path before the current scan. Identify the latest scan that found a branch point that has an unscanned path from the scans that were performed, and newly start a branch point that has an unscanned path that was found during the identified scan As a point, the next scanning may be performed.

図10(a)を参照して、画像形成装置1は、輪郭OLの走査の際に分岐点P21およびP12を発見し、分岐点P21の位置と、分岐点P21から分岐した経路とを固定記憶部20に記憶する(分岐点P12の位置、および分岐点P12から分岐した経路は、固定記憶部20に既に記憶されているので、新たに記憶させない)。また、画像形成装置1は、分岐点P21およびP12の各々において、進行方向に向かって最も右側の位置に存在する経路を、走査する経路として選択する。   Referring to FIG. 10A, the image forming apparatus 1 finds branch points P21 and P12 when scanning the contour OL, and fixedly stores the position of the branch point P21 and the route branched from the branch point P21. Store in the unit 20 (the position of the branch point P12 and the route branched from the branch point P12 are already stored in the fixed storage unit 20 and are not newly stored). Further, the image forming apparatus 1 selects a path that exists at the rightmost position in the traveling direction at each of the branch points P21 and P12 as a path to be scanned.

画像形成装置1は、輪郭OLの走査の際に開始点ST2を発見する。この場合画像形成装置1は、図形判定部106を用いて、輪郭走査部103が走査した軌跡により構成された図形が閉曲線であると判定する。   The image forming apparatus 1 finds the start point ST2 when scanning the contour OL. In this case, the image forming apparatus 1 uses the graphic determination unit 106 to determine that the graphic formed by the locus scanned by the contour scanning unit 103 is a closed curve.

図10(b)を参照して、画像形成装置1は、走査した軌跡により構成された図形FG52を抽出し、固定記憶部20に記憶する。これにより、2回目の走査が終了する。   With reference to FIG. 10B, the image forming apparatus 1 extracts a graphic FG 52 constituted by the scanned locus and stores it in the fixed storage unit 20. Thereby, the second scan is completed.

続いて画像形成装置1は、2回目の走査の際に発見した分岐点P21およびP12のうち、2回目の走査の際に始めに発見した分岐点P21を、3回目の走査の開始点ST3とする。画像形成装置1は、分岐点P21から分岐した経路のうち未走査経路である経路L21Aに沿って、3回目の走査を開始する。   Subsequently, the image forming apparatus 1 uses the branch point P21 first found during the second scan among the branch points P21 and P12 found during the second scan as the start point ST3 of the third scan. To do. The image forming apparatus 1 starts the third scan along the path L21A that is an unscanned path among the paths branched from the branch point P21.

図10(c)を参照して、画像形成装置1は、輪郭OLの走査の際に分岐点P13およびP12を発見した後(分岐点P13およびP12の位置、ならびに分岐点P13およびP12の各々から分岐した経路は、固定記憶部20に既に記憶されているので、新たに記憶させない)、開始点ST3を発見する。この場合画像形成装置1は、走査した軌跡により構成された図形が閉曲線であると判定する。   Referring to FIG. 10 (c), image forming apparatus 1 finds branch points P13 and P12 during scanning of contour OL (from the positions of branch points P13 and P12, and branch points P13 and P12, respectively). Since the branched route is already stored in the fixed storage unit 20, it is not newly stored), and the start point ST3 is found. In this case, the image forming apparatus 1 determines that the figure formed by the scanned locus is a closed curve.

画像形成装置1は、走査した軌跡により構成された図形FG53を抽出し、固定記憶部20に記憶する。これにより、3回目の走査が終了する。   The image forming apparatus 1 extracts the figure FG53 configured by the scanned locus and stores it in the fixed storage unit 20. Thereby, the third scan is completed.

図形FG53の抽出後、固定記憶部20に記憶した経路の中には図形を抽出できる経路が残っていない。この場合画像形成装置1は、抽出する図形が無くなったと判断し、図形として抽出していない輪郭が存在する場合には、それを線分として抽出する。以上により、図形の抽出が完了する。   After the graphic FG 53 is extracted, there is no route that can extract the graphic among the routes stored in the fixed storage unit 20. In this case, the image forming apparatus 1 determines that there is no figure to be extracted, and if there is an outline that is not extracted as a figure, extracts it as a line segment. The graphic extraction is thus completed.

図11は、本発明の第3の実施の形態における、図4のステップS119の開始点決定処理のサブルーチンである。   FIG. 11 is a subroutine of the start point determination process in step S119 of FIG. 4 in the third embodiment of the present invention.

図11を参照して、本実施の形態では、開始点決定処理として次の処理を行う。制御部10は、今回の走査(直近で終了した走査)の際に始めに発見した分岐点が未走査経路を有しているか否かを判別する(S301)。   Referring to FIG. 11, in the present embodiment, the following process is performed as the start point determination process. The control unit 10 determines whether or not the branch point first discovered during the current scan (the most recently completed scan) has an unscanned path (S301).

ステップS301において、今回の走査の際に始めに発見した分岐点が未走査経路を有していると判別した場合(S301でYES)、制御部10は、今回の走査の際に始めに発見した分岐点を新たな開始点に決定し(S303)、リターンする。   In step S301, when it is determined that the first branch point found during the current scan has an unscanned path (YES in S301), the control unit 10 first discovered during the current scan. The branch point is determined as a new start point (S303), and the process returns.

ステップS301において、今回の走査の際に始めに発見した分岐点が未走査経路を有していないと判別した場合(S301でNO)、制御部10は、今回の走査の際に発見した複数の分岐点の中に、未走査経路を有している分岐点があるか否かを判別する(S305)。   In step S301, when it is determined that the first branch point found at the time of the current scan does not have an unscanned path (NO at S301), the control unit 10 detects a plurality of points found at the time of the current scan. It is determined whether there is a branch point having an unscanned path among the branch points (S305).

ステップS305において、今回の走査の際に発見した複数の分岐点の中に、未走査経路を有している分岐点があると判別した場合(S305でYES)、制御部10は、
今回の走査の際に発見した、未走査経路を有している分岐点のうち、今回の走査の際に最も早く発見した分岐点を新たな開始点に決定し(S307)、リターンする。
In step S305, when it is determined that there is a branch point having an unscanned path among the plurality of branch points found during the current scan (YES in S305), the control unit 10
Among the branch points having an unscanned path discovered during the current scan, the branch point found earliest during the current scan is determined as a new start point (S307), and the process returns.

ステップS305において、今回の走査の際に発見した複数の分岐点の中に、未走査経路を有している分岐点が無いと判別した場合(S305でNO)、制御部10は、今回の走査よりも前に行った走査のうち、未走査経路を有している分岐点を発見した最新の走査を特定する(S309)。続いて制御部10は、特定した走査の際に発見した、未走査経路を有している分岐点を新たな開始点に決定し(S311)、リターンする。   In step S305, when it is determined that there is no branch point having an unscanned path among the plurality of branch points found during the current scan (NO in S305), the control unit 10 performs the current scan. Among the scans performed before the previous scan, the latest scan that has found a branch point having an unscanned path is identified (S309). Subsequently, the control unit 10 determines a branch point having an unscanned path, which is found during the specified scan, as a new start point (S311), and returns.

なお、本実施の形態の画像形成装置の構成および上述以外の動作については、第1の実施の形態の場合と同様であるので、その説明は繰り返さない。   Note that the configuration of the image forming apparatus according to the present embodiment and operations other than those described above are the same as those in the first embodiment, and therefore description thereof will not be repeated.

[第4の実施の形態]   [Fourth Embodiment]

図12〜図15は、本発明の第4の実施の形態において、画像形成装置が行う図形の抽出方法を説明する図である。なお図12(b)および(c)、図13(b)および(c)、図14(b)および(c)、ならびに図15(b)および(c)は、固定記憶部20に記憶されている情報を模式的に示している。   12 to 15 are diagrams for explaining a graphic extraction method performed by the image forming apparatus according to the fourth embodiment of the present invention. 12 (b) and (c), FIGS. 13 (b) and (c), FIGS. 14 (b) and (c), and FIGS. 15 (b) and (c) are stored in the fixed storage unit 20. Information is shown schematically.

図12(a)を参照して、ここでは、画像形成装置1が、互いに隣接した4つの正方形からなる輪郭OLを画像から抽出した場合を想定する。画像形成装置1は、任意の開始点ST1から、図12中右方向に向かって輪郭OLの1回目の走査を開始する。画像形成装置1は、輪郭OLの走査の際に分岐点P11、P12、およびP13を発見し、その後開始点ST1を発見する。   With reference to FIG. 12A, here, it is assumed that the image forming apparatus 1 has extracted an outline OL composed of four adjacent squares from an image. The image forming apparatus 1 starts the first scan of the contour OL from the arbitrary start point ST1 toward the right in FIG. The image forming apparatus 1 finds branch points P11, P12, and P13 when scanning the contour OL, and then finds a start point ST1.

分岐点P13を発見した後であって開始点ST1を発見する前には、固定記憶部20には、図12(b)に示すように、開始点ST1の位置の情報と、分岐点P11、P12、およびP13の各々の位置の情報と、分岐点P11、P12、およびP13の各々から分岐した経路L11A、L11B、L12A、L12B、L13A、およびL13Bの情報とが記憶されている。   After finding the branch point P13 and before finding the start point ST1, the fixed storage unit 20 stores information on the position of the start point ST1, the branch point P11, as shown in FIG. Information on each position of P12 and P13 and information on routes L11A, L11B, L12A, L12B, L13A, and L13B branched from each of branch points P11, P12, and P13 are stored.

画像形成装置1は、開始点ST1を発見すると、走査した軌跡により構成された図形が閉曲線であると判定し、走査した軌跡により構成された図形FG51を抽出し、固定記憶部20に記憶する。これにより、1回目の走査が終了する。画像形成装置1は、図形FG51を抽出した場合に、図12(c)に示すように、固定記憶部20に記憶した経路の情報うち、図形FG51を構成する経路である経路L11A、L12A、およびL13Aの情報を消去する。また画像形成装置1は、図形FG51を抽出した場合に、図形FG51を抽出した走査の開始点ST1の位置の情報を消去してもよい。   When the image forming apparatus 1 finds the start point ST1, the image forming apparatus 1 determines that the figure formed by the scanned locus is a closed curve, extracts the figure FG51 formed by the scanned locus, and stores it in the fixed storage unit 20. Thereby, the first scan is completed. When the figure FG51 is extracted, the image forming apparatus 1 includes paths L11A, L12A, which are paths constituting the figure FG51, among the route information stored in the fixed storage unit 20, as shown in FIG. The information of L13A is deleted. Further, when the graphic FG51 is extracted, the image forming apparatus 1 may delete the information on the position of the scanning start point ST1 from which the graphic FG51 is extracted.

図13(a)を参照して、次に画像形成装置1は、分岐点P11を開始点ST2として、図13中右方向に向かって(経路L11Bに沿って)輪郭OLの2回目の走査を開始する。画像形成装置1は、輪郭OLの走査の際に分岐点P21、P22、およびP12を発見し、その後開始点ST2を発見する。   Referring to FIG. 13A, next, the image forming apparatus 1 performs the second scan of the contour OL in the right direction in FIG. 13 (along the path L11B) with the branch point P11 as the start point ST2. Start. The image forming apparatus 1 finds branch points P21, P22, and P12 when scanning the contour OL, and then finds a start point ST2.

分岐点P22を発見した後であって開始点ST2を発見する前には、固定記憶部20には、図13(b)に示すように、開始点ST2の位置の情報と、分岐点P21およびP22の各々の位置の情報と、分岐点P21およびP22の各々から分岐した経路L21A、L21B、L22A、およびL22Bの情報とが新たに記憶されている(経路L22Aと経路L12Bとは同一の経路である)。   After discovering the branch point P22 and before discovering the start point ST2, as shown in FIG. 13B, the fixed storage unit 20 stores information on the position of the start point ST2, the branch point P21, and Information on each position of P22 and information on routes L21A, L21B, L22A, and L22B branched from each of branch points P21 and P22 are newly stored (route L22A and route L12B are the same route). is there).

画像形成装置1は、走査した軌跡により構成された図形が閉曲線であると判定し、走査した軌跡により構成された図形FG52を抽出し、固定記憶部20に記憶する。これにより、2回目の走査が終了する。画像形成装置1は、図形FG52を抽出した場合に、図13(c)に示すように、固定記憶部20に記憶した経路の情報うち、図形FG52を構成する経路である経路L11B、L21A、L22A、およびL12Bの情報を消去する。また画像形成装置1は、未走査経路を有さなくなった分岐点(経路が全て消去された分岐点)である分岐点P11およびP12の位置の情報を消去してもよい。さらに画像形成装置1は、図形FG52を抽出した場合に、図形FG52を抽出した走査の開始点ST2の位置の情報を消去してもよい。   The image forming apparatus 1 determines that the figure constituted by the scanned locus is a closed curve, extracts the figure FG52 constituted by the scanned locus, and stores it in the fixed storage unit 20. Thereby, the second scan is completed. When the image forming apparatus 1 extracts the graphic FG52, as shown in FIG. 13C, the path L11B, L21A, and L22A, which are paths constituting the graphic FG52, of the path information stored in the fixed storage unit 20, as shown in FIG. , And the information of L12B are deleted. Further, the image forming apparatus 1 may erase the information on the positions of the branch points P11 and P12 that are the branch points that no longer have unscanned paths (the branch points where all the paths are deleted). Further, when the graphic FG52 is extracted, the image forming apparatus 1 may erase the position information of the scanning start point ST2 from which the graphic FG52 is extracted.

図14(a)を参照して、次に画像形成装置1は、分岐点P21を開始点ST3として、図14中右方向に向かって(経路L21Bに沿って)輪郭OLの3回目の走査を開始する。画像形成装置1は、輪郭OLの走査の際に分岐点P31およびP22を発見し、その後開始点ST3を発見する。   Referring to FIG. 14A, next, the image forming apparatus 1 performs the third scan of the contour OL in the right direction in FIG. 14 (along the path L21B) with the branch point P21 as the start point ST3. Start. The image forming apparatus 1 finds branch points P31 and P22 when scanning the contour OL, and then finds a start point ST3.

分岐点P31を発見した後であって開始点ST3を発見する前には、固定記憶部20には、図14(b)に示すように、開始点ST3の位置の情報と、分岐点P31の位置の情報と、分岐点P31から分岐した経路L31AおよびL31Bの情報とが新たに記憶されている(経路L31Aと経路L22Bとは同一の経路である)。   After finding the branch point P31 and before finding the start point ST3, the fixed storage unit 20 stores information on the position of the start point ST3 and the location of the branch point P31 as shown in FIG. Information on the position and information on the routes L31A and L31B branched from the branch point P31 are newly stored (the route L31A and the route L22B are the same route).

画像形成装置1は、走査した軌跡により構成された図形が閉曲線であると判定し、走査した軌跡により構成された図形FG53を抽出し、固定記憶部20に記憶する。これにより、3回目の走査が終了する。画像形成装置1は、図形FG53を抽出した場合に、図14(c)に示すように、固定記憶部20に記憶した経路の情報うち、図形FG53を構成する経路である経路L21B、L31A、およびL22Bの情報を消去する。また画像形成装置1は、未走査経路を有さなくなった分岐点P21およびP22の位置の情報を消去してもよい。さらに画像形成装置1は、図形FG53を抽出した場合に、図形FG53を抽出した走査の開始点ST3の位置の情報を消去してもよい。   The image forming apparatus 1 determines that the figure constituted by the scanned locus is a closed curve, extracts the figure FG53 constituted by the scanned locus, and stores it in the fixed storage unit 20. Thereby, the third scan is completed. When the figure FG53 is extracted, the image forming apparatus 1 includes paths L21B, L31A, which are paths constituting the figure FG53, among the path information stored in the fixed storage unit 20, as shown in FIG. The information of L22B is deleted. Further, the image forming apparatus 1 may delete the information on the positions of the branch points P21 and P22 that no longer have the unscanned path. Further, when the graphic FG53 is extracted, the image forming apparatus 1 may delete the information on the position of the scanning start point ST3 from which the graphic FG53 is extracted.

図15(a)を参照して、次に画像形成装置1は、分岐点P31を開始点ST4として、図15中左方向に向かって(経路L31Bに沿って)輪郭OLの4回目の走査を開始する。画像形成装置1は、輪郭OLの走査の際に分岐点P13、P12、およびP22を発見し、その後開始点ST4を発見する。   Referring to FIG. 15A, the image forming apparatus 1 then performs a fourth scan of the contour OL toward the left in FIG. 15 (along the path L31B) with the branch point P31 as the start point ST4. Start. The image forming apparatus 1 finds branch points P13, P12, and P22 when scanning the contour OL, and then finds a start point ST4.

4回目の走査を開始してから開始点ST4を発見する前には、固定記憶部20には、図15(b)に示すように、開始点ST4の位置の情報が新たに記憶されている。   Before starting the start point ST4 after starting the fourth scan, the fixed storage unit 20 newly stores information on the position of the start point ST4, as shown in FIG. 15B. .

画像形成装置1は、走査した軌跡により構成された図形が閉曲線であると判定し、走査した軌跡により構成された図形FG54を抽出し、固定記憶部20に記憶する。これにより、4回目の走査が終了する。画像形成装置1は、図形FG54を抽出した場合に、図15(c)に示すように、固定記憶部20に記憶した経路の情報うち、図形FG53を構成する経路である経路L31BおよびL13Bの情報を消去する。また画像形成装置1は、未走査経路を有さなくなった分岐点P13およびP31の位置の情報を消去してもよい。さらに画像形成装置1は、図形FG54を抽出した場合に、図形FG54を抽出した走査の開始点ST4の位置の情報を消去してもよい。その結果、固定記憶部20に記憶されている未走査経路の情報は無くなる。以上により、図形の抽出が完了する。   The image forming apparatus 1 determines that the figure constituted by the scanned locus is a closed curve, extracts the figure FG54 constituted by the scanned locus, and stores it in the fixed storage unit 20. This completes the fourth scan. When the image forming apparatus 1 extracts the graphic FG54, as shown in FIG. 15C, the information on the paths L31B and L13B, which are the paths constituting the graphic FG53, among the information on the paths stored in the fixed storage unit 20, as shown in FIG. Erase. Further, the image forming apparatus 1 may delete the information on the positions of the branch points P13 and P31 that no longer have unscanned paths. Further, when the graphic FG 54 is extracted, the image forming apparatus 1 may erase the information on the position of the scanning start point ST4 from which the graphic FG 54 has been extracted. As a result, the information on the unscanned path stored in the fixed storage unit 20 is lost. The graphic extraction is thus completed.

図16は、本発明の第4の実施の形態における画像形成装置の動作を示すフローチャートである。   FIG. 16 is a flowchart showing the operation of the image forming apparatus according to the fourth embodiment of the present invention.

図16を参照して、このフローチャートは、ステップS115の処理の後であってステップS117の処理の前に、ステップS401の処理を実行する点において、図4に示す第1の実施の形態の場合のフローチャートと異なっている。   Referring to FIG. 16, this flowchart is the case of the first embodiment shown in FIG. 4 in that the process of step S401 is executed after the process of step S115 and before the process of step S117. It is different from the flow chart.

ステップS115の処理に続いて、ステップS401において、制御部10は、走査済の経路の情報、および未走査経路を有さなくなった分岐点の位置の情報を消去し(S401)、ステップS117の処理へ進む。   Subsequent to the process of step S115, in step S401, the control unit 10 deletes the information of the scanned path and the information of the position of the branch point that no longer has the unscanned path (S401), and the process of step S117. Proceed to

なお、本実施の形態の画像形成装置の構成および上述以外の動作については、第1の実施の形態の場合と同様であるので、その説明は繰り返さない。   Note that the configuration of the image forming apparatus according to the present embodiment and operations other than those described above are the same as those in the first embodiment, and therefore description thereof will not be repeated.

[実施の形態の効果]   [Effect of the embodiment]

第1〜第4の実施の形態によれば、画像形成装置は、新たな分岐点を発見した場合、その分岐点から分岐した複数の経路のうち進行方向に向かって特定の位置(方向)に存在する経路を常に選択するので、一つの図形の輪郭を時計回り(または反時計回り)に走査することができ、最小単位で図形を抽出することができる。加えて、図形を抽出した場合に、前回発見した分岐点を新たな開始点とし、新たな開始点とした分岐点から分岐した複数の経路のうち、未走査経路を走査するので、別の図形についても最小単位で抽出することができる。その結果、複数の図形を含む画像からそれぞれの図形を適切に抽出することができる。   According to the first to fourth embodiments, when the image forming apparatus finds a new branch point, the image forming apparatus takes a specific position (direction) toward the traveling direction among a plurality of paths branched from the branch point. Since an existing path is always selected, the outline of one figure can be scanned clockwise (or counterclockwise), and the figure can be extracted in the smallest unit. In addition, when a figure is extracted, an unscanned path is scanned among a plurality of paths branched from the branch point that has been found as the new start point and the branch point found last time. Can be extracted in the smallest unit. As a result, each figure can be appropriately extracted from an image including a plurality of figures.

図17は、本発明の第1〜第4の実施の形態において抽出される図形を模式的に示す図である。   FIG. 17 is a diagram schematically showing graphics extracted in the first to fourth embodiments of the present invention.

図17(a)を参照して、画像IMが、互いに隣接する2つの閉曲線の図形FG11およびFG12を含んでいる場合には、画像形成装置1は、図形FG61およびFG62を画像IMから抽出する。   Referring to FIG. 17A, when image IM includes two closed curve graphics FG11 and FG12 adjacent to each other, image forming apparatus 1 extracts graphics FG61 and FG62 from image IM.

図17(b)を参照して、画像IMが2つの閉曲線の図形FG13および図形FG15と、図形FG13およびFG15を接続する線分FG14とを含んでいる場合には、画像形成装置1は、図形FG63、線分FG64、および図形FG65を画像IMから抽出する。   Referring to FIG. 17B, when image IM includes two closed-curved graphics FG13 and FG15, and line segment FG14 connecting graphics FG13 and FG15, image forming apparatus 1 FG63, line segment FG64, and figure FG65 are extracted from the image IM.

図17(c)を参照して、画像IMが閉曲線の図形FG16と、図形FG16に内包された閉曲線の図形FG17とを含んでいる場合には、画像形成装置1は、図形FG66およびFG67を画像IMから抽出する。   Referring to FIG. 17C, when the image IM includes a closed curve figure FG16 and a closed curve figure FG17 included in the figure FG16, the image forming apparatus 1 displays the figures FG66 and FG67 as images. Extract from IM.

また、走査の開始位置が閉曲線上ではなく線分上に存在している場合、図形の走査方向が狙いの方向とは逆方向(反時計回り)になり、最小単位で図形を抽出することができなくなることがある。特に第2の実施の形態では、走査にて分岐点を発見した後であって開始点を発見する前に、今回の走査の際に発見した分岐点を再び発見した場合には、今回走査した軌跡により構成された図形を破棄する。そして、破棄した走査の際に発見した複数の分岐点のうち始めに発見した分岐点である分岐点を新たな開始点として次の走査を開始する。これにより、画像に含まれる図形が、線分と閉曲線との組合せにより構成されている場合であっても、線分と閉曲線とを分離して抽出することができる。   In addition, when the scanning start position is not on the closed curve but on the line segment, the scanning direction of the figure is opposite to the target direction (counterclockwise), and the figure can be extracted in the minimum unit. It may not be possible. In particular, in the second embodiment, when the branch point discovered during the current scan is discovered again after the branch point is discovered by scanning and before the start point is discovered, the current scan is performed. Discard the figure composed of the trajectory. Then, the next scan is started with the branch point that is the first found branch point among the plurality of branch points found during the discarded scan as a new start point. As a result, even if the graphic included in the image is configured by a combination of a line segment and a closed curve, the line segment and the closed curve can be separated and extracted.

また、図形を抽出した後、次の走査を開始する場合には、適切な分岐点を開始点として選択しないと、図形の走査方向が狙いの方向とは逆方向(反時計回り)になり、最小単位で図形を抽出することができなくなることがある。複数の図形が互いに隣接している場合には、複数の図形全体の外輪郭のみを走査し、その結果、互いに分離されていない状態で複数の図形を一度に抽出するおそれもある。特に第3の実施の形態では、今回の走査の際に始めに発見された分岐点を開始点として、次の走査が開始される。今回の走査の際の開始点が複数の図形全体の外輪郭上に存在している場合には、今回の走査の際に始めに発見された分岐点もまた、図形の外輪郭上に存在している。したがって、第3の実施の形態によれば、常に図形の外輪郭上を開始点として走査を開始することができ、図形の走査方向が狙いの方向とは逆方向になるのを抑止することができる。   Also, when starting the next scan after extracting the figure, unless the appropriate branch point is selected as the starting point, the scanning direction of the figure will be the opposite direction (counterclockwise) to the target direction, It may not be possible to extract a figure in the smallest unit. When a plurality of figures are adjacent to each other, only the outer contours of the whole figures are scanned, and as a result, the plurality of figures may be extracted at a time without being separated from each other. In particular, in the third embodiment, the next scan is started with the branch point first found during the current scan as the start point. If the starting point of the current scan is on the outer contour of the entire figure, the first branch point found during the current scan will also be on the outer contour of the figure. ing. Therefore, according to the third embodiment, it is possible to always start scanning on the outer contour of the figure as a starting point, and to prevent the scanning direction of the figure from being opposite to the target direction. it can.

さらに、第4の実施の形態によれば、図形を抽出する度に、走査済(選択済)の経路の情報を削除するので、全ての分岐後の経路を記憶しておく場合に比べて、固定記憶部の記憶領域の空き容量を増やすことができる。その結果、図形の抽出のために事前に確保しておくべき記憶領域の容量を少なくすることができる。   Furthermore, according to the fourth embodiment, every time a graphic is extracted, the information on the scanned (selected) route is deleted. Therefore, as compared with the case where all the routes after branching are stored, The free space in the storage area of the fixed storage unit can be increased. As a result, it is possible to reduce the capacity of the storage area that should be secured in advance for extracting graphics.

[その他]   [Others]

上述の実施の形態は互いに組み合わせられてもよい。たとえば、第2の実施の形態の構成である、走査にて分岐点を発見した後であって開始点を発見する前に、走査の際に発見した分岐点を再び発見した場合に、走査した軌跡により構成された図形を破棄する構成と、第4の実施の形態の構成である、図形を抽出した場合にその図形を構成する経路を削除する構成とを組み合わせてもよい。また、第3の実施の形態の構成である、走査の際に始めに発見された分岐点を開始点として、次の走査を開始する構成と、第4の実施の形態の構成である、図形を抽出した場合にその図形を構成する経路の情報を消去する構成とを組み合わせてもよい。   The above-described embodiments may be combined with each other. For example, in the configuration of the second embodiment, after a branch point is found by scanning and before the start point is found, scanning is performed when the branch point found at the time of scanning is found again. You may combine the structure which discards the figure comprised by the locus | trajectory, and the structure which deletes the path | route which comprises the figure, when the figure is extracted which is a structure of 4th Embodiment. Also, the configuration of the third embodiment, the configuration of starting the next scan starting from the branch point first discovered during the scan, and the configuration of the configuration of the fourth embodiment It may be combined with a configuration that deletes information on a path that configures the figure when the symbol is extracted.

上述の実施の形態における処理は、ソフトウェアにより行なっても、ハードウェア回路を用いて行なってもよい。また、上述の実施の形態における処理を実行するプログラムを提供することもできるし、そのプログラムをCD−ROM、フレキシブルディスク、ハードディスク、ROM、RAM、メモリカードなどの記録媒体に記録してユーザーに提供することにしてもよい。プログラムは、CPUなどのコンピューターにより実行される。また、プログラムはインターネットなどの通信回線を介して、装置にダウンロードするようにしてもよい。   The processing in the above-described embodiment may be performed by software or by using a hardware circuit. It is also possible to provide a program for executing the processing in the above-described embodiment, and record the program on a recording medium such as a CD-ROM, a flexible disk, a hard disk, a ROM, a RAM, or a memory card and provide it to the user. You may decide to do it. The program is executed by a computer such as a CPU. The program may be downloaded to the apparatus via a communication line such as the Internet.

上述の実施の形態は、すべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。   The above-described embodiment is to be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.

1 画像形成装置
10 制御部
20 固定記憶部
30 画像読取部
40 画像形成部
50 ネットワークI/F
60 操作パネル
101 画像記憶部
102 前処理部
103 輪郭走査部
104 分岐点記憶部
105 進路選択部
106 図形判定部
107 図形記憶部
FG1,FG2,FG3,FG4,FG11,FG12,FG13,FG14,FG15,FG16,FG17,FG51,FG52,FG53,FG54,FG61,FG62,FG63,FG64,FG65,FG66,FG67 図形または線分
IM 画像
L11A,L11B,L11C,L12A,L12B,L13A,L13B,L21A,L21B,L21C,L22A,L22B,L23A,L23B,L31A,L31B 経路
OL 輪郭
P11,P12,P13,P21,P22,P23,P31 分岐点
ST1,ST2,ST3,ST4 開始点
DESCRIPTION OF SYMBOLS 1 Image forming apparatus 10 Control part 20 Fixed memory | storage part 30 Image reading part 40 Image forming part 50 Network I / F
60 Operation Panel 101 Image Storage Unit 102 Pre-Processing Unit 103 Contour Scanning Unit 104 Branch Point Storage Unit 105 Course Selection Unit 106 Graphic Determination Unit 107 Graphic Storage Unit FG1, FG2, FG3, FG4, FG11, FG12, FG13, FG14, FG15, FG16, FG17, FG51, FG52, FG53, FG54, FG61, FG62, FG63, FG64, FG65, FG66, FG67 Graphic or line segment IM image L11A, L11B, L11C, L12A, L12B, L13A, L13B, L21A, L21B, L21A, L21B , L22A, L22B, L23A, L23B, L31A, L31B Route OL contour P11, P12, P13, P21, P22, P23, P31 Branch point ST1, ST2, ST3, ST4 Start point

Claims (10)

複数の図形を含む画像からそれぞれの図形を抽出する画像処理装置であって、
前記複数の図形の各々の輪郭を前記画像から抽出する輪郭抽出手段と、
前記輪郭抽出手段にて抽出した輪郭上の任意の点を開始点として、前記輪郭抽出手段にて抽出した輪郭を走査することにより、輪郭上の分岐点および前記開始点を検索する第1の走査手段と、
前記第1の走査手段にて分岐点を発見した場合に、発見した分岐点の位置と、発見した分岐点から分岐した複数の経路とを記憶する記憶手段と、
前記第1の走査手段にて分岐点を発見した場合に、発見した分岐点から分岐した複数の経路のうち進行方向に向かって特定の位置に存在する経路を、前記第1の走査手段にて走査する経路として選択する選択手段と、
前記第1の走査手段にて開始点を発見した場合に、前記第1の走査手段にて走査した軌跡により構成された図形を抽出する図形抽出手段と、
前記図形抽出手段にて図形を抽出した場合に、前記第1の走査手段にて発見した分岐点を新たな開始点とし、前記新たな開始点とした分岐点から分岐した複数の経路のうち、未走査経路を走査する第2の走査手段とを備えた、画像処理装置。
An image processing apparatus for extracting each figure from an image including a plurality of figures,
Contour extracting means for extracting the contour of each of the plurality of figures from the image;
First scanning for searching for a branch point on the contour and the start point by scanning the contour extracted by the contour extraction unit with an arbitrary point on the contour extracted by the contour extraction unit as a start point Means,
Storage means for storing the position of the found branch point and a plurality of paths branched from the found branch point when a branch point is found by the first scanning means;
When a branch point is found by the first scanning unit, a path existing at a specific position in the traveling direction among a plurality of routes branched from the found branch point is detected by the first scanning unit. Selection means for selecting as a path to scan;
A graphic extraction means for extracting a graphic constituted by a trajectory scanned by the first scanning means when the first scanning means finds a starting point;
When a graphic is extracted by the graphic extraction unit, the branch point found by the first scanning unit is set as a new start point, and among the plurality of paths branched from the branch point as the new start point, An image processing apparatus comprising: a second scanning unit that scans an unscanned path.
抽出する図形が無くなった場合に、前記輪郭抽出手段にて抽出した輪郭のうち図形として抽出されなかった輪郭を線分として抽出する線分抽出手段をさらに備えた、請求項1に記載の画像処理装置。   The image processing according to claim 1, further comprising: a line segment extracting unit that extracts, as a line segment, an outline that has not been extracted as a graphic among the contours extracted by the contour extracting unit when there is no graphic to be extracted. apparatus. 前記第1の走査手段にて分岐点を発見した後であって前記開始点を発見する前に、前記第1の走査手段にて発見した分岐点を再び発見した場合に、前記第1の走査手段にて走査した軌跡により構成された図形を破棄する破棄手段をさらに備えた、請求項1または2に記載の画像処理装置。   When the branch point found by the first scanning unit is found again after the branch point is found by the first scanning unit and before the start point is found, the first scan is performed. The image processing apparatus according to claim 1, further comprising a discarding unit that discards a figure formed by the trajectory scanned by the unit. 前記第1の走査手段にて分岐点を発見した後であって前記開始点を発見する前に、前記第1の走査手段にて発見した分岐点を再び発見した場合に、前記第1の走査手段にて発見した複数の分岐点のうち、前記第1の走査手段にて始めに発見した分岐点を新たな開始点とし、前記新たな開始点とした分岐点から分岐した複数の経路のうち、前記第1の走査手段にて走査した経路とは異なる経路を走査する第3の走査手段をさらに備えた、請求項1〜3のいずれかに記載の画像処理装置。   When the branch point found by the first scanning unit is found again after the branch point is found by the first scanning unit and before the start point is found, the first scan is performed. Among the plurality of branch points found by the means, the first branch point found by the first scanning means is set as a new start point, and the plurality of paths branched from the branch point set as the new start point The image processing apparatus according to claim 1, further comprising a third scanning unit that scans a path different from the path scanned by the first scanning unit. 前記第2の走査手段は、前記第1の走査手段にて発見した複数の分岐点のうち、前記第1の走査手段にて始めに発見した分岐点を新たな開始点として走査する、請求項1〜4のいずれかに記載の画像処理装置。   The second scanning unit scans a branch point first discovered by the first scanning unit as a new start point among a plurality of branch points found by the first scanning unit. The image processing apparatus according to any one of 1 to 4. 前記第2の走査手段は、
前記第1の走査手段にて、始めに発見した分岐点が未走査経路を有していない場合に、前記第1の走査手段にて発見した複数の分岐点の中に、未走査経路を有している分岐点があるか否かを判別する経路判別手段と、
前記経路判別手段にて、前記第1の走査手段にて発見した複数の分岐点の中に、未走査経路を有している分岐点があると判別した場合に、前記第1の走査手段にて発見した、未走査経路を有している分岐点のうち、前記第1の走査手段にて最も早く発見した分岐点を新たな開始点として、未走査経路を走査する第1の未走査経路走査手段とを備えた、請求項1〜5のいずれかに記載の画像処理装置。
The second scanning means includes
In the first scanning means, when the first branch point found by the first scanning means does not have an unscanned path, the plurality of branch points found by the first scanning means have an unscanned path. Route discriminating means for discriminating whether or not there is a branching point, and
When the path discriminating unit discriminates that there is a branch point having an unscanned path among the plurality of branch points found by the first scanning unit, the first scanning unit The first unscanned path that scans the unscanned path, with the newest starting point being the first detected branch point in the first scanning means among the branch points having the unscanned path. The image processing apparatus according to claim 1, further comprising a scanning unit.
前記第2の走査手段は、
前記経路判別手段にて、前記第1の走査手段にて発見した複数の分岐点の中に、未走査経路を有している分岐点が無いと判別した場合に、前記第1の走査手段による走査よりも前に行った走査のうち、未走査経路を有している分岐点を発見した最新の走査を特定する特定手段と、
前記特定手段にて特定した走査の際に発見した、未走査経路を有している分岐点を新たな開始点として、未走査経路を走査する第2の未走査経路走査手段とを備えた、請求項6に記載の画像処理装置。
The second scanning means includes
When the path discriminating unit determines that there is no branch point having an unscanned path among the plurality of branch points discovered by the first scanning unit, the first scanning unit A specifying means for specifying a latest scan that has found a branch point having an unscanned path among scans performed before the scan;
A second unscanned path scanning unit that scans the unscanned path with a branch point having an unscanned path, which is found during the scanning specified by the specifying unit, as a new start point; The image processing apparatus according to claim 6.
前記記憶手段にて記憶した分岐点から分岐した複数の経路のうち、前記図形抽出手段にて抽出した図形を構成する経路を消去する第1の消去手段と、
前記記憶手段にて記憶した位置のうち、経路が全て消去された分岐点の位置を消去する第2の消去手段とをさらに備えた、請求項1〜7のいずれかに記載の画像処理装置。
A first erasing unit for erasing a path constituting the graphic extracted by the graphic extracting unit among a plurality of paths branched from the branch point stored in the storage unit;
The image processing apparatus according to claim 1, further comprising: a second erasing unit that erases the position of the branch point from which all paths are erased among the positions stored in the storage unit.
複数の図形を含む画像からそれぞれの図形を抽出する画像処理装置の制御方法であって、
前記複数の図形の各々の輪郭を前記画像から抽出する輪郭抽出ステップと、
前記輪郭抽出ステップにて抽出した輪郭上の任意の点を開始点として、前記輪郭抽出ステップにて抽出した輪郭を走査することにより、輪郭上の分岐点および前記開始点を検索する第1の走査ステップと、
前記第1の走査ステップにて分岐点を発見した場合に、発見した分岐点の位置と、発見した分岐点から分岐した複数の経路とを記憶する記憶ステップと、
前記第1の走査ステップにて分岐点を発見した場合に、発見した分岐点から分岐した複数の経路のうち進行方向に向かって特定の位置に存在する経路を、前記第1の走査ステップにて走査する経路として選択する選択ステップと、
前記第1の走査ステップにて開始点を発見した場合に、前記第1の走査ステップにて走査した軌跡により構成された図形を抽出する図形抽出ステップと、
前記図形抽出ステップにて図形を抽出した場合に、前記第1の走査ステップにて発見した分岐点を新たな開始点とし、前記新たな開始点とした分岐点から分岐した複数の経路のうち、未走査経路を走査する第2の走査ステップとを備えた、画像処理装置の制御方法。
A control method of an image processing apparatus for extracting each figure from an image including a plurality of figures,
A contour extracting step of extracting the contour of each of the plurality of figures from the image;
First scanning for searching for a branch point on the contour and the start point by scanning the contour extracted in the contour extraction step with an arbitrary point on the contour extracted in the contour extraction step as a start point Steps,
A storage step of storing a position of the found branch point and a plurality of paths branched from the found branch point when a branch point is found in the first scanning step;
When a branch point is found in the first scanning step, a route existing at a specific position in the traveling direction among a plurality of routes branched from the found branch point is found in the first scanning step. A selection step to select as a path to scan;
A graphic extraction step for extracting a graphic constituted by a trajectory scanned in the first scanning step when a starting point is found in the first scanning step;
When a graphic is extracted in the graphic extraction step, the branch point found in the first scanning step is a new start point, and a plurality of paths branched from the branch point as the new start point, And a second scanning step for scanning an unscanned path.
複数の図形を含む画像からそれぞれの図形を抽出する画像処理装置の制御プログラムであって、
前記複数の図形の各々の輪郭を前記画像から抽出する輪郭抽出ステップと、
前記輪郭抽出ステップにて抽出した輪郭上の任意の点を開始点として、前記輪郭抽出ステップにて抽出した輪郭を走査することにより、輪郭上の分岐点および前記開始点を検索する第1の走査ステップと、
前記第1の走査ステップにて分岐点を発見した場合に、発見した分岐点の位置と、発見した分岐点から分岐した複数の経路とを記憶する記憶ステップと、
前記第1の走査ステップにて分岐点を発見した場合に、発見した分岐点から分岐した複数の経路のうち進行方向に向かって特定の位置に存在する経路を、前記第1の走査ステップにて走査する経路として選択する選択ステップと、
前記第1の走査ステップにて開始点を発見した場合に、前記第1の走査ステップにて走査した軌跡により構成された図形を抽出する図形抽出ステップと、
前記図形抽出ステップにて図形を抽出した場合に、前記第1の走査ステップにて発見した分岐点を新たな開始点とし、前記新たな開始点とした分岐点から分岐した複数の経路のうち、未走査経路を走査する第2の走査ステップとをコンピューターに実行させる、画像処理装置の制御プログラム。
A control program for an image processing apparatus that extracts each figure from an image including a plurality of figures,
A contour extracting step of extracting the contour of each of the plurality of figures from the image;
First scanning for searching for a branch point on the contour and the start point by scanning the contour extracted in the contour extraction step with an arbitrary point on the contour extracted in the contour extraction step as a start point Steps,
A storage step of storing a position of the found branch point and a plurality of paths branched from the found branch point when a branch point is found in the first scanning step;
When a branch point is found in the first scanning step, a route existing at a specific position in the traveling direction among a plurality of routes branched from the found branch point is found in the first scanning step. A selection step to select as a path to scan;
A graphic extraction step for extracting a graphic constituted by a trajectory scanned in the first scanning step when a starting point is found in the first scanning step;
When a graphic is extracted in the graphic extraction step, the branch point found in the first scanning step is a new start point, and a plurality of paths branched from the branch point as the new start point, A control program for an image processing apparatus that causes a computer to execute a second scanning step of scanning an unscanned path.
JP2013194387A 2013-09-19 2013-09-19 Image processing apparatus, image processing apparatus control method, and image processing apparatus control program Active JP6163998B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013194387A JP6163998B2 (en) 2013-09-19 2013-09-19 Image processing apparatus, image processing apparatus control method, and image processing apparatus control program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013194387A JP6163998B2 (en) 2013-09-19 2013-09-19 Image processing apparatus, image processing apparatus control method, and image processing apparatus control program

Publications (2)

Publication Number Publication Date
JP2015060441A true JP2015060441A (en) 2015-03-30
JP6163998B2 JP6163998B2 (en) 2017-07-19

Family

ID=52817903

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013194387A Active JP6163998B2 (en) 2013-09-19 2013-09-19 Image processing apparatus, image processing apparatus control method, and image processing apparatus control program

Country Status (1)

Country Link
JP (1) JP6163998B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01129368A (en) * 1987-11-16 1989-05-22 Canon Inc Picture recognition device
JP2000076465A (en) * 1998-08-27 2000-03-14 Canon Inc Picture processor and its device
JP2012064098A (en) * 2010-09-17 2012-03-29 Glory Ltd Frame line recognizing method and frame line recognizing device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01129368A (en) * 1987-11-16 1989-05-22 Canon Inc Picture recognition device
JP2000076465A (en) * 1998-08-27 2000-03-14 Canon Inc Picture processor and its device
JP2012064098A (en) * 2010-09-17 2012-03-29 Glory Ltd Frame line recognizing method and frame line recognizing device

Also Published As

Publication number Publication date
JP6163998B2 (en) 2017-07-19

Similar Documents

Publication Publication Date Title
EP2219153B1 (en) Resizing a digital document image via background content removal
US20160050330A1 (en) Image forming apparatus and image data processing method
US20140240786A1 (en) Image forming apparatus and image forming method
US8270717B2 (en) Metadata determination method and image forming apparatus
JP7262993B2 (en) Image processing system, image processing method, image processing apparatus
US8458139B2 (en) Image processing apparatus, control method thereof, program, and storage medium
JP2008186253A (en) Image processor, image processing system, image processing method and computer program
JP2000298702A (en) Image processing device and method therefor, and computer-readable memory
JP2009274419A (en) Printing apparatus, its control method, program, and computer-readable storage medium
JP4483567B2 (en) Image processing apparatus, image processing method, and image processing program
JP6163998B2 (en) Image processing apparatus, image processing apparatus control method, and image processing apparatus control program
JP2006287915A (en) Image processing device and method, image forming device, and program
US8259313B2 (en) Image processing apparatus, method, and computer-readable medium storing the program thereof
JP2021012589A (en) Image processing device, image processing method, and program
JP5101576B2 (en) Image forming apparatus, image processing apparatus, image forming method, control program, and recording medium
JP5096989B2 (en) Document processing apparatus and document processing method
JP5720154B2 (en) Image processing apparatus and image processing program
JP4591552B2 (en) Image forming apparatus, image forming method, and image forming program
US8004712B2 (en) Image processing apparatus and method
JP2017047602A (en) Image processing device, image processing method, and program
JP2006115461A (en) Image forming apparatus, image composite method and program therefor
JP2009301294A (en) Image processor, image processing method, and program
JP2000339402A (en) Picture processor, picture processing method and computer readable memory
JP6399000B2 (en) Image processing apparatus and image creation program
JP2002142070A (en) Image transmission system and image transmitter and method for them

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160623

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170419

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: 20170523

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170605

R150 Certificate of patent or registration of utility model

Ref document number: 6163998

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150