JP2005266891A - Region extraction method and device - Google Patents

Region extraction method and device Download PDF

Info

Publication number
JP2005266891A
JP2005266891A JP2004074308A JP2004074308A JP2005266891A JP 2005266891 A JP2005266891 A JP 2005266891A JP 2004074308 A JP2004074308 A JP 2004074308A JP 2004074308 A JP2004074308 A JP 2004074308A JP 2005266891 A JP2005266891 A JP 2005266891A
Authority
JP
Japan
Prior art keywords
region
reference point
approximate color
extracted
extracting
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.)
Withdrawn
Application number
JP2004074308A
Other languages
Japanese (ja)
Inventor
Toru Miyamoto
徹 宮本
Hitoshi Yamakado
均 山門
Takashi Tani
宇 谷
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2004074308A priority Critical patent/JP2005266891A/en
Publication of JP2005266891A publication Critical patent/JP2005266891A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a region extraction method capable of automatically extracting a desired region accurately by a simple specifying operation such as a one-click operation. <P>SOLUTION: The present invention is an image processing method that extracts a specific region from an image, and has a first region extraction step S12 that extracts an approximate color region from a specified point, a reference point setting step S13 that sets a reference point used for extracting an approximate color region to be added to the extracted approximate color region, and a second region extraction step S14 that extracts an approximate color region from the reference point and adds it to the already extracted approximate color region. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、画像中から所望の領域を抽出する際に用いて好適な領域抽出方法及び装置に関する。   The present invention relates to a region extraction method and apparatus suitable for use in extracting a desired region from an image.

画像中からユーザーが領域を抽出したい場合には、輪郭情報を元に領域を特定する方法、色情報を基に近似色領域を抽出する方法などが用いられている。輪郭情報を基にする場合は、ユーザーが概領域を指定し、その概領域から近接する輪郭線の検索を行うことで精度良く所望領域を抽出できる。しかし、ユーザーが概領域を指定する必要があり、特に携帯端末などの十字キーなどによる矩形の2点指定などでは、操作が煩雑であった。   When a user wants to extract a region from an image, a method of specifying a region based on contour information, a method of extracting an approximate color region based on color information, or the like is used. When the contour information is used as a basis, the user can extract a desired region with high accuracy by designating a general region and searching for a contour line adjacent to the general region. However, it is necessary for the user to designate an approximate area, and the operation is complicated especially in the case of two-point designation of a rectangle using a cross key of a portable terminal or the like.

一方、以下に一例を示すような色を用いた領域抽出では、例えば光源が屋外の太陽光の場合と、庭内の蛍光灯下の場合とで大きく色領域が異なるため、抽出の精度に問題があることがあった。   On the other hand, in area extraction using colors as shown in the example below, for example, the color area differs greatly depending on whether the light source is outdoor sunlight or under a fluorescent lamp in the garden. There was to be.

近似色の抽出方法としては、多くの手法が提案されている。画像中の1点を指定点とし、設定されたしきい値を基に近似色集合を求めるものや、例えば、特許文献1〜3に記載されているものがある。特許文献1に記載されている近似色領域の抽出方法は、色空間上の色距離とすることで、しきい値を1つにすることを特徴としたものである。特許文献2に記載されている近似色領域の抽出方法は、RGB(Red Green Blue)の各しきい値だけでなく、差分値にも着目し、しきい値を設けることを特徴としたものである。また、特許文献3に記載されている近似色領域の抽出方法は、人間の目に同じ色として認識される色空間が、その位置によって異なることに着目し、指定点の色空間上の位置によってしきい値を人間が同じ色として認識される値に変更することを特徴としたものである。
特開平5−128224号公報 特開平11−110552号公報 特開平5−236289号公報
Many methods have been proposed as an approximate color extraction method. There are ones that use one point in the image as a designated point and obtain an approximate color set based on a set threshold value, and those that are described in Patent Documents 1 to 3, for example. The approximate color region extraction method described in Patent Document 1 is characterized in that the threshold value is set to one by setting the color distance in the color space. The approximate color region extraction method described in Patent Document 2 is characterized in that not only each threshold value of RGB (Red Green Blue) but also a difference value is set and a threshold value is provided. is there. In addition, the method of extracting approximate color regions described in Patent Document 3 pays attention to the fact that the color space recognized as the same color by the human eye differs depending on the position, and depending on the position of the designated point in the color space. The threshold value is changed to a value that allows a human to recognize the same color.
Japanese Patent Laid-Open No. 5-128224 JP-A-11-110552 JP-A-5-236289

これらいずれの手法でも、指定点から等距離のしきい値を近似色の集合として捉えている。このため、顔などの明るい色から暗い色までが存在するような領域で、その中間の色を指定点とした場合には上手く顔領域を抽出できるが、明るい点や暗い点など集合の境界部に近い色を指定点とした場合には上手く抽出できないという課題があった。   In any of these methods, thresholds equidistant from a specified point are regarded as a set of approximate colors. For this reason, it is possible to successfully extract a face area when the designated point is an intermediate color in an area where bright colors such as faces exist from dark colors to dark colors. When a color close to is designated as a designated point, there is a problem that it cannot be extracted well.

また、従来の例ではこのような場合、上手く抽出できなかった領域を再度指定し、領域を追加するなどの操作が必要であり、特に携帯電話等の小型情報機器の入力用操作子にように画像指定精度が限定されるものを用いた場合には複数回の指定操作や数値設定操作が煩雑になるという問題があった。   In addition, in the conventional example, in such a case, it is necessary to specify an area that has not been successfully extracted, and to add an area, such as an input operator for a small information device such as a mobile phone. When an image with limited image designation accuracy is used, there is a problem that a plurality of designation operations and numerical value setting operations become complicated.

本発明は、上記の事情に鑑みてなされたものであり、ワンクリック等の簡単な指定操作によって、しきい値の設定を行う等の煩雑な操作を行わなくとも、自動的且つ正確に所望領域を抽出することができる領域抽出方法及び装置を提供することを目的とする。   The present invention has been made in view of the above circumstances, and the desired region can be automatically and accurately performed by a simple designation operation such as one click without performing a complicated operation such as setting a threshold value. It is an object of the present invention to provide a region extraction method and apparatus capable of extracting a region.

上記課題を解決するため、本発明は、画像から特定領域を抽出する画像処理方法であって、指定点から近似色領域を抽出する第1の領域抽出ステップと、抽出された近似色領域に対して追加する近似色領域を抽出する際に用いる基準点を設定する基準点設定ステップと、その基準点から近似色領域を抽出し、既抽出の近似色領域に加える第2の領域抽出ステップとを持つことを特徴とする。これによれば、近似色領域の抽出が、指定点を用いた第1の領域抽出ステップと、自動的に設定された基準点を用いた第2の領域抽出ステップとに分けて行われるので、近似色領域の抽出処理をよりきめ細やかなものとし易くなる。よって、ユーザーが所望の抽出領域内に指定点を設定する簡単な1回の操作で、従来に比べ精度の高い領域抽出を行うことができるようになる。   In order to solve the above-mentioned problem, the present invention is an image processing method for extracting a specific area from an image, wherein a first area extracting step for extracting an approximate color area from a designated point, and the extracted approximate color area A reference point setting step for setting a reference point used when extracting the approximate color region to be added, and a second region extracting step for extracting the approximate color region from the reference point and adding the approximate color region to the already extracted approximate color region It is characterized by having. According to this, the extraction of the approximate color area is performed separately in the first area extraction step using the designated point and the second area extraction step using the automatically set reference point. This makes it easier to make the approximate color region extraction process more delicate. Therefore, it is possible to extract a region with higher accuracy than in the past by a simple operation in which a user sets a designated point in a desired extraction region.

また、本発明は、前記基準点設定ステップにおける基準点の設定が、前記第1の領域抽出ステップによって抽出された領域の境界画素に対し行われるものであることを特徴とする。これによれば、境界画素以外に基準点を設定する場合と比べて、複数の基準点から近似色領域をそれぞれ抽出したときの各近似色領域の重なりを少なくすることができ、同一画素に対して重複して行われる演算量を低減することができる。   Further, the present invention is characterized in that the setting of the reference point in the reference point setting step is performed on the boundary pixels of the region extracted by the first region extraction step. According to this, compared with the case where the reference point is set other than the boundary pixel, it is possible to reduce the overlap of the approximate color regions when the approximate color regions are respectively extracted from the plurality of reference points. Thus, it is possible to reduce the amount of calculation performed in duplicate.

また、本発明は、前記基準点設定ステップにおける基準点の設定が、前記第1の領域抽出ステップによって抽出された領域の境界画素に対して行われるものであって且つその境界画素のうち所定画素毎離れた複数画素に対して行われるものであることを特徴とする。これによれば、境界画素以外に基準点を設定する場合と比べて、複数の基準点から近似色領域をそれぞれ抽出したときの各近似色領域の重なりを少なくすることができ、さらに基準点を複数画素毎に設定しているので、演算量をより少なくすることができる。   In the present invention, the setting of the reference point in the reference point setting step is performed on a boundary pixel of the region extracted by the first region extraction step, and a predetermined pixel among the boundary pixels The present invention is characterized in that it is performed for a plurality of pixels apart from each other. According to this, compared with the case where the reference point is set other than the boundary pixel, it is possible to reduce the overlap of the approximate color regions when the approximate color regions are extracted from the plurality of reference points, respectively. Since it is set for each of a plurality of pixels, the amount of calculation can be further reduced.

また、本発明は、前記基準点設定ステップにおける基準点の設定が、前記第1の領域抽出ステップによって抽出された領域の外接矩形を求めるステップと、その外接矩形を所定の画素単位で網状に分割するステップと、その網状に分割された領域の境界と前記第1の領域抽出ステップによって抽出された領域の境界との交点を基準点とするステップとを含むものであることを特徴とする。これによれば、近似色領域の境界を追跡せずに、近似色領域の境界と網状領域との交点を求めることで基準点を設定できるので、例えば第1の領域抽出ステップで抽出された領域が複雑な境界形状を有する場合でも、比較的簡単な処理で基準点を設定することができる。   In the present invention, the setting of the reference point in the reference point setting step includes a step of obtaining a circumscribed rectangle of the region extracted by the first region extracting step, and dividing the circumscribed rectangle into a mesh pattern in predetermined pixel units. And a step of using as a reference point the intersection of the boundary of the region divided into the mesh and the boundary of the region extracted by the first region extraction step. According to this, since the reference point can be set by obtaining the intersection between the boundary of the approximate color region and the mesh region without tracking the boundary of the approximate color region, for example, the region extracted in the first region extraction step Even if has a complicated boundary shape, the reference point can be set by a relatively simple process.

また、本発明は、前記基準点設定ステップにおける基準点の設定が、前記第1の領域抽出ステップによって抽出された領域の外接矩形を求めるステップと、その外接矩形から重心を求めるステップと、前記第1の領域抽出ステップによって抽出された領域の境界画素のうちでその重心から所定の角度にある画素を基準点とするステップとを含むものであることを特徴とする。これによれば、近似色領域の境界を追跡せずに、近似色領域の境界画素で重心から所定の角度にある画素を求めることで基準点を設定できるので、例えば第1の領域抽出ステップで抽出された領域が複雑な境界形状を有する場合でも、比較的簡単な処理で基準点を設定することができる。   In the present invention, the reference point setting in the reference point setting step includes a step of obtaining a circumscribed rectangle of the region extracted by the first region extracting step, a step of obtaining a center of gravity from the circumscribed rectangle, And a step of using, as a reference point, a pixel at a predetermined angle from the center of gravity among the boundary pixels of the region extracted by one region extraction step. According to this, since the reference point can be set by obtaining a pixel at a predetermined angle from the center of gravity in the boundary pixel of the approximate color area without tracking the boundary of the approximate color area, for example, in the first area extraction step Even when the extracted region has a complicated boundary shape, the reference point can be set by a relatively simple process.

また、本発明は、前記第1の領域抽出ステップにおける近似色領域の抽出が前記指定点の画素値を基準として所定のしきい値を用いて行われるものであり、前記第2の領域抽出ステップにおける近似色領域の抽出が前記基準点の画素値を基準として所定のしきい値を用いて行われるものであり、前記第2の領域抽出ステップにおける所定のしきい値が、前記第1の領域抽出ステップにおける所定のしきい値より小さいものであることを特徴とする。これによれば、指定点から抽出される第1の領域抽出ステップの近似色領域が、第2の領域抽出ステップで抽出される各近似色領域よりも比較的大きくなるので、指定点との関連性を高め、領域抽出の精度を向上させることを期待できる。   Further, in the present invention, the approximate color region is extracted in the first region extraction step using a predetermined threshold value based on the pixel value of the designated point, and the second region extraction step The approximate color area is extracted using a predetermined threshold value based on the pixel value of the reference point, and the predetermined threshold value in the second area extracting step is the first area. It is smaller than a predetermined threshold value in the extraction step. According to this, since the approximate color area of the first area extraction step extracted from the designated point is relatively larger than each approximate color area extracted in the second area extraction step, Can be expected to improve the accuracy of region extraction.

また、本発明は、前記第2の領域抽出ステップの処理結果に基づいて近似色領域の抽出処理を終了するか否かを判定し、終了しないと判定した場合に前記基準点設定ステップと前記第2の領域抽出ステップとを繰り返し実行することを特徴とする。これによれば、所定の終了条件を満たすまで、基準点設定ステップと第2の領域抽出ステップとが繰り返し実行される。よって、抽出すべき近似色領域が未抽出となる場合を少なくすることができる。この終了条件の判定は、追加領域の面積の大きさ、既存のエッジ検出手法や、指定点からの画素値の差等に基づく比較によって行うことができる。   Further, the present invention determines whether to end the approximate color region extraction process based on the processing result of the second region extraction step, and determines that the reference point setting step and the first step are not performed when it is determined not to end. The second region extraction step is repeatedly executed. According to this, the reference point setting step and the second region extraction step are repeatedly executed until a predetermined end condition is satisfied. Therefore, it is possible to reduce the case where the approximate color region to be extracted is not extracted. The determination of the end condition can be performed by comparison based on the size of the area of the additional region, the existing edge detection method, the difference in pixel value from the designated point, and the like.

また、本発明は、前記基準点から抽出された近似色領域の面積が所定の大きさよりも小さい場合に抽出処理を終了すると判定することを特徴とする。これによれば、終了条件の判定を抽出領域の面積の計算(つまり画素数の計算)という簡単な処理で行うことができる。   Further, the present invention is characterized in that the extraction process is determined to end when the area of the approximate color region extracted from the reference point is smaller than a predetermined size. According to this, the end condition can be determined by a simple process of calculating the area of the extraction region (that is, calculating the number of pixels).

また、本発明は、前記第2の領域抽出ステップにおいて、前記基準点が輪郭をなすか否かを判定し、輪郭をなすと判定した場合にその基準点からの近似色領域の抽出を行わないことを特徴とする。例えば既存のエッジ検出の手法によって各基準点のエッジ強度を検知し、エッジ強度が所定のしきい値を越えた場合に、その基準点が輪郭をなすと判定して近似色領域抽出処理を行わないようにする。これによれば、ユーザーが抽出したい領域が明確な境界線を有しているような場合に、誤抽出を防止し、正確な領域抽出を行うことができる。   According to the present invention, in the second region extraction step, it is determined whether or not the reference point forms an outline, and if it is determined that the reference point forms an outline, the approximate color region is not extracted from the reference point. It is characterized by that. For example, the edge strength of each reference point is detected by an existing edge detection method, and when the edge strength exceeds a predetermined threshold, it is determined that the reference point forms an outline, and approximate color region extraction processing is performed. Do not. According to this, when the region that the user wants to extract has a clear boundary line, erroneous extraction can be prevented and accurate region extraction can be performed.

また、本発明の他の態様は、画像から特定領域を抽出する画像処理装置であって、指定点から近似色領域を抽出する第1の領域抽出手段と、抽出された近似色領域に対して追加する近似色領域を抽出する際に用いる基準点を設定する基準点設定手段と、その基準点から近似色領域を抽出し、既抽出の近似色領域に加える第2の領域抽出手段とを備えることを特徴とする。   According to another aspect of the present invention, there is provided an image processing apparatus that extracts a specific area from an image, the first area extracting unit that extracts an approximate color area from a specified point, and the extracted approximate color area Reference point setting means for setting a reference point used when extracting the approximate color area to be added, and second area extraction means for extracting the approximate color area from the reference point and adding it to the already extracted approximate color area. It is characterized by that.

また、本発明の他の態様は、画像から特定領域を抽出する画像処理方法を実行するためのプログラムであって、指定点から近似色領域を抽出する第1の領域抽出ステップと、抽出された近似色領域に対して追加する近似色領域を抽出する際に用いる基準点を設定する基準点設定ステップと、その基準点から近似色領域を抽出し、既抽出の近似色領域に加える第2の領域抽出ステップをコンピュータを用いて実行するための記述を含むことを特徴とする。   According to another aspect of the present invention, there is provided a program for executing an image processing method for extracting a specific area from an image, the first area extracting step for extracting an approximate color area from a specified point, A reference point setting step for setting a reference point used when extracting an approximate color area to be added to the approximate color area; and a second that extracts an approximate color area from the reference point and adds the approximate color area to the already extracted approximate color area It includes a description for executing the region extraction step using a computer.

以下、図面を参照して本発明の領域抽出装置の実施の形態について説明する。本発明の領域抽出装置は、携帯電話、携帯情報端末、デジタルカメラ、パーソナルコンピュータ等の情報機器を構成するコンピュータおよびその入力装置と、そのコンピュータによって実行されるプログラムとによって実現される。より具体的には、各機器における一画像処理機能として実装される。   Hereinafter, an embodiment of a region extraction device of the present invention will be described with reference to the drawings. The region extraction device of the present invention is realized by a computer constituting an information device such as a mobile phone, a portable information terminal, a digital camera, and a personal computer, its input device, and a program executed by the computer. More specifically, it is implemented as one image processing function in each device.

図1は、本実施の形態の領域抽出装置の構成を示すブロック図である。各ブロックは、ハードウェアとソフトウェアの組み合わせから構成されていて、本実施の形態ではこれら各ブロックの組み合わせによって、ユーザーの操作に応じて指定された画像から特定の領域を抽出する処理を実行する。   FIG. 1 is a block diagram showing the configuration of the region extraction apparatus of the present embodiment. Each block is composed of a combination of hardware and software. In the present embodiment, a process of extracting a specific area from an image designated in accordance with a user operation is executed by a combination of these blocks.

画像入力部1は、処理対象の画像を入力あるいは指定する処理を行うための構成である。
画像入力部1は、本実施形態を実現する情報機器に搭載された操作キーや表示装置と、記憶装置あるいは着脱自在の記録媒体とを用いて、処理対象の画像を入力および選択または選択する機能を提供する。指定点設定部2は、画像入力部1によって入力され、処理対象としてユーザーによって選択された画像を表示装置に表示し、ユーザーの操作に応じてその表示画像中の1点(1画素あるいは複数画素からなる1領域)を指定する機能を有している。
The image input unit 1 is configured to perform processing for inputting or specifying an image to be processed.
The image input unit 1 has a function of inputting and selecting or selecting an image to be processed using an operation key or a display device mounted on an information device realizing the present embodiment and a storage device or a detachable recording medium. I will provide a. The designated point setting unit 2 displays an image input by the image input unit 1 and selected by the user as a processing target on the display device, and displays one point (one pixel or a plurality of pixels) in the display image in accordance with a user operation. 1 area) is designated.

第1の近似色領域抽出部3は、指定点設定部2で設定された指定点を基準として、その指定点と近似色を有し、かつ互いに連続した複数の画素からなる近似色領域を抽出する処理を行う。この第1の近似色領域抽出部3による近似色領域の抽出は、対象となる画素が、指定点の画素値を基準として所定のしきい値の範囲内の画素値を有するか否かを判定しながら行われる。   The first approximate color area extraction unit 3 extracts an approximate color area composed of a plurality of continuous pixels having the specified point and the approximate color with reference to the specified point set by the specified point setting unit 2. Perform the process. The extraction of the approximate color area by the first approximate color area extraction unit 3 determines whether the target pixel has a pixel value within a predetermined threshold range with reference to the pixel value of the designated point. While done.

基準点設定部4は、第1の近似色領域抽出部3または第2の近似色領域抽出部5で抽出された近似色領域に対して、第2の近似色領域抽出部5において新たに追加する近似色領域を抽出する際に用いる基準点を設定する機能を有している。画像入力部1で入力された画像中の1または複数の画素が基準点として設定される。基準点設定部4は、まず第1の近似色領域抽出部3で指定点を基準として抽出された近似色領域に基づいて基準点を設定する。基準点は、例えば抽出された近似色領域の境界画素の全部の画素としたり、境界画素のうちから所定画素毎離れた複数画素を基準点としたりすることで設定される。   The reference point setting unit 4 is newly added in the second approximate color region extraction unit 5 to the approximate color region extracted by the first approximate color region extraction unit 3 or the second approximate color region extraction unit 5. It has a function of setting a reference point used when extracting the approximate color area. One or a plurality of pixels in the image input by the image input unit 1 are set as a reference point. The reference point setting unit 4 first sets a reference point based on the approximate color region extracted with the designated point as a reference by the first approximate color region extraction unit 3. The reference point is set, for example, by setting all of the extracted boundary pixels in the approximate color region or by using a plurality of pixels that are separated from the boundary pixels by a predetermined pixel as the reference point.

第2の近似色領域抽出部5は、基準点設定部4で設定された1または複数の基準点から近似色領域を1または複数抽出し、既に抽出した近似色領域に追加することで新たな近似色領域を決定する機能を有する。第2の近似色領域抽出部5は、基準点設定部4で設定された基準点を基準として、その基準点と近似色を有し、かつ互いに連続した複数の画素からなる近似色領域を抽出する処理を行う。この第2の近似色領域抽出部5による近似色領域の抽出は、判定対象の画素が、基準点の画素値を基準として所定のしきい値の範囲内の画素値を有するか否かを判定しながら行われる。その際、第2の近似色領域抽出部5で用いられるしきい値は、第1の近似色領域抽出部3で用いられるしきい値より小さい値となるように設定されている。   The second approximate color area extraction unit 5 extracts one or a plurality of approximate color areas from one or a plurality of reference points set by the reference point setting unit 4 and adds them to the already extracted approximate color areas. A function of determining an approximate color area; The second approximate color area extraction unit 5 extracts an approximate color area composed of a plurality of continuous pixels having the reference point and the approximate color and using the reference point set by the reference point setting unit 4 as a reference. Perform the process. The extraction of the approximate color region by the second approximate color region extraction unit 5 determines whether or not the pixel to be determined has a pixel value within a predetermined threshold range with reference to the pixel value of the reference point. While done. At this time, the threshold value used in the second approximate color region extraction unit 5 is set to be smaller than the threshold value used in the first approximate color region extraction unit 3.

終了判定部6は、第2の近似色領域抽出部5の処理結果に基づいて近似色領域の抽出処理を終了するか否かを判定し、終了しないと判定した場合に基準点設定部4と第2の近似色領域抽出部5による処理を繰り返し実行するように制御する機能を有している。この終了判定部6における終了するか否かの判定は、例えば第2の近似色領域抽出部5において各基準点から抽出された近似色領域の面積(すなわち画素数)が所定の大きさよりも小さい場合に、終了する条件が満たされたと判定するようにしている。ただし、判定方法は、既存のエッジ検出手法や、指定点からの画素値の差等に基づく所定値との比較によって行うこともできる。   The end determination unit 6 determines whether or not to end the approximate color region extraction process based on the processing result of the second approximate color region extraction unit 5, and determines that the end does not end with the reference point setting unit 4 The second approximate color area extraction unit 5 has a function of controlling to repeatedly execute the process. The end determination unit 6 determines whether or not to end, for example, the area (that is, the number of pixels) of the approximate color region extracted from each reference point in the second approximate color region extraction unit 5 is smaller than a predetermined size. In this case, it is determined that the condition to end is satisfied. However, the determination method can also be performed by comparison with an existing edge detection method or a predetermined value based on a pixel value difference from a designated point.

抽出領域出力部7は、終了判定部6で抽出処理を終了すると判定された場合に、第2の近似色領域抽出部5で抽出された近似色領域を、ユーザーが指定した指定点を基準として抽出した最終的な近似色領域として出力する。例えば、本実施形態の機器の表示装置にその領域を表示したり、抽出した領域に基づく入力画像に対する画像処理を行う他のプログラムに領域を示すデータを引き渡す処理を行ったりする。   The extraction area output unit 7 determines the approximate color area extracted by the second approximate color area extraction unit 5 based on the designated point designated by the user when the end determination unit 6 determines to end the extraction process. Output as the final approximate color area extracted. For example, the area is displayed on the display device of the device of the present embodiment, or the process of handing over data indicating the area to another program that performs image processing on the input image based on the extracted area is performed.

次に図2および図3に示すフローチャートを参照して、図1に示す実施形態の動作例について説明する。この例では、まずユーザーが、情報機器を操作して本領域抽出装置の画像入力部1による画像入力機能を呼び出し、処理対象の画像を入力(あるいは選択)した後、表示装置の画面上にその画像を表示させる。そして、十字カーソル等の操作子を操作して画像中でユーザーが抽出しようとする領域内にカーソルを合わせて、操作子をクリックする。すると、図1の指定点設定部2によって、画像中の1点が指定される(ステップS11)。図10に処理対象の画像10の一例を示した。図10の例では、画像10において、ユーザーが抽出対象領域11を抽出しようとしているものとする。そして、指定点12がユーザーの操作に従って設定されたものとする。   Next, an operation example of the embodiment shown in FIG. 1 will be described with reference to the flowcharts shown in FIGS. In this example, a user first operates an information device to call an image input function by the image input unit 1 of the region extraction apparatus, inputs (or selects) an image to be processed, and then displays the image on the screen of the display device. Display an image. Then, an operator such as a cross cursor is operated to move the cursor to an area to be extracted by the user in the image and click the operator. Then, one point in the image is designated by the designated point setting unit 2 in FIG. 1 (step S11). FIG. 10 shows an example of the image 10 to be processed. In the example of FIG. 10, it is assumed that the user is trying to extract the extraction target area 11 in the image 10. It is assumed that the designated point 12 is set according to the user's operation.

次に第1の近似色領域抽出部3によって、自動的に指定点12(例えばRGB値で、R:235、G:176、B:170)から、近似色領域を抽出する処理が行われる(ステップS12)。例えば、しきい値を「32」などとして、色空間をRGB、Labなどで近似色領域の抽出が行われる。ただし、この例ではRGB色空間を用いることとする。なお、Lab色空間は、黒から白(明度)と、緑から赤の範囲の要素(a)、青から黄の範囲の要素(b)の2つの色彩要素とで色を表現する方式である。   Next, the first approximate color area extraction unit 3 automatically performs a process of extracting an approximate color area from a designated point 12 (for example, RGB values, R: 235, G: 176, B: 170) ( Step S12). For example, the approximate color region is extracted by setting the threshold value to “32” or the like and the color space to be RGB, Lab, or the like. However, in this example, the RGB color space is used. The Lab color space is a method for expressing a color by two color elements, black to white (lightness), an element (a) in the range from green to red, and an element (b) in the range from blue to yellow. .

例えば、指定点12の画素が、R:235、 G:176、B:170を持つ場合、しきい値が32であるとすると、画素値がR:203〜267、G:144〜208、B:138〜202の範囲にあり、かつ指定点12と連続する画素が、近似色領域として抽出される。図4の例では、網掛して示した近似色領域13が抽出されたものとする。   For example, if the pixel at the designated point 12 has R: 235, G: 176, and B: 170, and the threshold value is 32, the pixel values are R: 203 to 267, G: 144 to 208, B A pixel in the range of 138 to 202 and continuous with the designated point 12 is extracted as an approximate color region. In the example of FIG. 4, it is assumed that the approximate color region 13 shown by shading is extracted.

上記の場合、例えば画素値がR:202、G:176、B:170の画素は、指定点12からしきい値「32」で決まる近似色範囲(R:203〜267、G:144〜208、B:138〜202)外となるため抽出されない。しかし、指定点12はユーザーの操作によって複数の画素から任意に設定されるものであり、しきい値を予め定めた固定値とする場合、所望の抽出対象領域11中には、このようにわずかに近似色範囲外となる画素値を持つ画素が多く含まれていることが考えられる。例えば、近似領域の抽出を1回の処理で行おうとした場合、このような画素を含めて領域抽出を行うには、しきい値を例えば「33」に変更する必要がある。しかし、所望領域毎に適切なしきい値を設定する必要があり、面倒な作業である。そこで本実施の形態では、このような画素であっても、しきい値を変更することなく抽出することができるように次のような処理を自動的に行うようにしている。   In the above case, for example, pixels having pixel values R: 202, G: 176, and B: 170 are approximate color ranges (R: 203 to 267, G: 144 to 208) determined by the threshold value “32” from the designated point 12. , B: 138-202), so it is not extracted. However, the designated point 12 is arbitrarily set from a plurality of pixels by the user's operation, and when the threshold value is set to a predetermined fixed value, the desired extraction target region 11 has a slight amount like this. It is conceivable that many pixels having pixel values outside the approximate color range are included. For example, when an approximate region is to be extracted in a single process, it is necessary to change the threshold value to, for example, “33” in order to extract the region including such pixels. However, it is necessary to set an appropriate threshold value for each desired region, which is a troublesome operation. Therefore, in the present embodiment, the following processing is automatically performed so that even such a pixel can be extracted without changing the threshold value.

上述したように近似色領域抽出部3によって、指定点12から、近似色領域13を抽出する処理が行われれた後(ステップS12)、次の手順で、基準点設定部4によって基準点15(図4)を設定する処理が行われる(ステップS13)。   As described above, after the approximate color region extraction unit 3 performs the process of extracting the approximate color region 13 from the designated point 12 (step S12), the reference point setting unit 4 performs the reference point 15 ( The process for setting (FIG. 4) is performed (step S13).

基準点15を設定するために、まず、抽出領域(近似色領域13)の境界画素をマークする。すなわち、図4に示す抽出された近似色領域13の境界となる境界画素14を抽出する。境界画素14であるかどうかの判定は、図5(a)または(b)に示すように、例えば隣接4画素(または8画素)内に、抽出された近似色領域13ではない画素16を含むかどうかに応じて、画素16を含む場合を境界画素14としてマークしている。   In order to set the reference point 15, first, the boundary pixel of the extraction region (approximate color region 13) is marked. That is, the boundary pixel 14 that is the boundary of the extracted approximate color region 13 shown in FIG. 4 is extracted. The determination of whether or not the pixel is the boundary pixel 14 includes, for example, a pixel 16 that is not the extracted approximate color region 13 in four adjacent pixels (or eight pixels) as shown in FIG. 5A or 5B. Depending on whether or not the pixel 16 is included, the boundary pixel 14 is marked.

図5(a)の例は、隣接4画素を基準として境界画素14を決定する場合を示している。例えば、近似色領域13の画素17aについては、画素17aとその上下左右各1画素の4画素を含む範囲18aに領域外の画素16が含まれているので、画素17aは境界画素14であると判定される。一方、近似色領域13の画素17bについては、画素17bとその上下左右各1画素の4画素を含む範囲18bに領域外の画素16が含まれていないので、画素17bは境界画素14ではないと判定される。   The example of FIG. 5A shows a case where the boundary pixel 14 is determined with reference to four adjacent pixels. For example, regarding the pixel 17a in the approximate color region 13, the pixel 17a is the boundary pixel 14 because the pixel 16 outside the region is included in the range 18a including the pixel 17a and four pixels of the upper, lower, left, and right pixels. Determined. On the other hand, for the pixel 17b in the approximate color area 13, the pixel 17b is not the boundary pixel 14 because the pixel 16 outside the area is not included in the range 18b including the pixel 17b and the four pixels of the upper, lower, left, and right pixels. Determined.

他方、図5(b)の例は、隣接8画素を基準として境界画素14を決定する場合を示している。例えば、近似色領域13の画素17aについては、画素17aとその上下左右および斜め上下左右各1画素の8画素を含む範囲19aに領域外の画素16が含まれているので、画素17aは境界画素14であると判定される。また、近似色領域13の画素17bについては、画素17bとその上下左右および斜め上下左右各1画素の8画素を含む範囲19bに領域外の画素16が含まれているので、画素17bも境界画素14であると判定される。   On the other hand, the example of FIG. 5B shows a case where the boundary pixel 14 is determined based on the adjacent eight pixels. For example, for the pixel 17a in the approximate color area 13, since the pixel 16 outside the area is included in the range 19a that includes the pixel 17a and eight pixels of each of the upper, lower, left, and right and diagonal upper, lower, left, and right pixels, the pixel 17a is a boundary pixel. 14 is determined. For the pixel 17b in the approximate color area 13, the pixel 17b is also a boundary pixel because the pixel 16 outside the area is included in the range 19b that includes the pixel 17b and eight pixels of each of the upper, lower, left, and right and diagonal up, down, left, and right pixels. 14 is determined.

基準点15は、抽出した境界画素14のすべてを基準点としてもよいし、あるいは所定の条件によって選択した限定された数の画素を基準点としてもよい。図5(a)および(b)に示す例では、境界画素14の5画素毎に基準点15を設定している。   The reference point 15 may be all of the extracted boundary pixels 14 as reference points, or may be a limited number of pixels selected according to a predetermined condition. In the example shown in FIGS. 5A and 5B, the reference point 15 is set for every five pixels of the boundary pixel 14.

次に第2の近似色領域抽出部5によって、基準点15から第2の近似色領域を抽出する処理が行われる(ステップS14)。ここで図3を参照して、図2のステップS14の第2の近似色領域を抽出する処理について説明する。   Next, the second approximate color area extraction unit 5 performs a process of extracting the second approximate color area from the reference point 15 (step S14). Here, with reference to FIG. 3, the process of extracting the second approximate color area in step S14 of FIG. 2 will be described.

第2の近似色領域を抽出する処理(図2のステップS14)は、図2のステップS12で設定された1または複数の基準点から近似色領域を順次抽出して行き、それをすでに抽出された近似色領域に順次追加して行く処理を行うものである。ステップS13で設定された基準点は、画素値を考慮せず形状上の一定の条件に基づいて自動的に設定されたものであるため、例えばある基準点で抽出した近似色領域と他の基準点から抽出した近似色領域とが重なる場合が発生する。本実施の形態では、このような場合に、他の基準点からの近似色領域に含まれた基準点については、その基準点からの近似色領域の抽出処理を省略するようにしている。そこで、まず近似色領域の抽出処理の前に、その基準点が他の基準点からの近似色領域に含まれていないかどうかを判定している(ステップS21)。次に、その基準点が他の基準点からの近似色領域に含まれていない場合にのみ(すなわち近似色領域の境界にある場合にのみ)(ステップS21で「境界である」)、図2のステップS12と同様に(ただし基準点を用いて)、近似色領域の抽出処理を行う(ステップS22〜S24)。そして、抽出した近似色領域を既に抽出した近似色領域に追加する処理を行う(ステップS25)。これらの処理をすべての基準点に対して繰り返し実行する(ステップS26で「あり」からステップS21以降(またはステップS26で「なし」))。   In the process of extracting the second approximate color area (step S14 in FIG. 2), the approximate color area is sequentially extracted from one or a plurality of reference points set in step S12 in FIG. The process of sequentially adding to the approximate color area is performed. Since the reference point set in step S13 is automatically set based on a certain shape condition without considering the pixel value, for example, the approximate color region extracted at a certain reference point and other reference points The approximate color region extracted from the point may overlap. In this embodiment, in such a case, with respect to a reference point included in an approximate color area from another reference point, the process of extracting the approximate color area from the reference point is omitted. Therefore, first, before the approximate color region extraction process, it is determined whether or not the reference point is not included in the approximate color regions from other reference points (step S21). Next, only when the reference point is not included in the approximate color area from another reference point (that is, only when the reference point is at the boundary of the approximate color area) ("is a boundary" in step S21), FIG. Similar to step S12 (however, using a reference point), an approximate color region extraction process is performed (steps S22 to S24). And the process which adds the extracted approximate color area | region to the already extracted approximate color area | region is performed (step S25). These processes are repeatedly executed for all the reference points (“Yes” in step S26 to step S21 and subsequent steps (or “No” in step S26)).

図6は、第2の近似色領域を抽出する処理を説明するための説明図である。図6において、図4および図5(a)、(b)と同一の構成には同一の符号を用いている。この例では、第1の基準点を、画像上最も上(複数ある場合はその中の最も左)に位置する画素として、その基準点15aにおいて、第2の近似色領域21aの抽出を行っている。基準点15aの画素値を取得し(ステップS22)、取得した画素値から色範囲を設定する(ステップS23)。このとき、第1の領域抽出ステップ(図1のステップS12)より小さなしきい値(「16」など)を用いて色範囲を設定する。次に設定した色範囲で基準点15aから連続する近似色領域21aを抽出する(ステップS24)。そして、抽出した近似色領域21aを既に抽出された近似色領域(この場合は1番目の基準点なので近似色領域13)に追加する(ステップS25)。   FIG. 6 is an explanatory diagram for explaining the process of extracting the second approximate color region. In FIG. 6, the same reference numerals are used for the same components as those in FIGS. 4 and 5A and 5B. In this example, the second reference color region 21a is extracted at the reference point 15a by using the first reference point as the pixel located at the top of the image (the leftmost of the pixels when there are multiple images). Yes. The pixel value of the reference point 15a is acquired (step S22), and a color range is set from the acquired pixel value (step S23). At this time, the color range is set by using a threshold (such as “16”) smaller than the first region extraction step (step S12 in FIG. 1). Next, the approximate color region 21a continuous from the reference point 15a in the set color range is extracted (step S24). Then, the extracted approximate color area 21a is added to the already extracted approximate color area (in this case, the approximate color area 13 because it is the first reference point) (step S25).

本実施の形態では第1の基準点からはじめて時計回りに基準点を選択するものとすると、基準点15aの次に処理対象となる基準点は基準点15bである。ただし、基準点15bは、基準点15aからの近似色領域21aに含まれているため、境界判定(ステップS21)で境界ではないと判定されるため、近似色領域の抽出は行われない。次に基準点15cは、境界なので(他の近似色領域に含まれていないので)(ステップS21で「境界である」)、基準点15cから近似色領域21bが抽出され(ステップS22〜S24)、既に抽出されている近似色領域(この場合、近似色領域13に近似色領域21aを追加した領域)に、近似色領域21bが追加される(ステップS25)。   In the present embodiment, if a reference point is selected clockwise from the first reference point, the reference point to be processed next to the reference point 15a is the reference point 15b. However, since the reference point 15b is included in the approximate color region 21a from the reference point 15a, it is determined that it is not a boundary in the boundary determination (step S21), and therefore the approximate color region is not extracted. Next, since the reference point 15c is a boundary (because it is not included in other approximate color regions) (“is a boundary” in step S21), the approximate color region 21b is extracted from the reference point 15c (steps S22 to S24). The approximate color region 21b is added to the already extracted approximate color region (in this case, the region where the approximate color region 21a is added to the approximate color region 13) (step S25).

以後同様に基準点15d、15e、…から近似色領域を抽出する処理が行われ、抽出された近似色領域21c等が既に抽出されている近似色領域に追加される。そして、すべての基準点に対する処理が終了したところで(ステップS26で「なし」)、第2の近似色領域の抽出処理が終了する。図6はすべての基準点に対する処理が終了した状態を示している。   Thereafter, similarly, the process of extracting the approximate color area from the reference points 15d, 15e,... Is performed, and the extracted approximate color area 21c and the like are added to the already extracted approximate color area. When the processes for all the reference points are completed (“None” in step S26), the second approximate color area extraction process is completed. FIG. 6 shows a state in which the processing for all the reference points has been completed.

次に終了判定部6によって、図2のステップS14の第2の近似色領域抽出部5による処理結果に基づいて、近似色領域の抽出処理を終了するか否かを判定する処理が行われる(ステップS15)。終了すると判定した場合には結果を出力して処理を終了する(ステップS15で「終了」)。一方、終了しないと判定した場合には(ステップS15で「繰り返し」)、基準点設定部4において基準点を再設定した後、第2の近似色領域抽出部5で新たな基準点を用いて近似色領域の抽出を繰り返し実行して近似色領域にさらに追加して行く(ステップ13〜)。この終了判定部6における終了するか否かの判定は、例えばステップS14の第2の近似色領域抽出処理において、領域抽出された各基準点(図4の基準点15a、15c、15e等)から抽出された近似色領域(近似色領域21a、21b、21c等)の面積(すなわち画素数)が所定の大きさよりも小さい場合に、終了する条件が満たされたとする判定によって行う。面積の判定は、各近似色領域21a、21b、21c、…に対して行って、すべての面積が所定値より小さい場合に終了条件が満たされると判定するようにしたり、各近似色領域21a、21b、21c、…の合計の面積が所定値より小さい場合に終了条件が満たされると判定したりするようにすることができる。面積の所定値は、画素数(10画素等)のほか、既抽出の近似色領域に対する割合(1%等)で設定することができる。   Next, the end determination unit 6 performs processing to determine whether or not to end the approximate color region extraction process based on the processing result by the second approximate color region extraction unit 5 in step S14 of FIG. Step S15). If it is determined to end, the result is output and the process ends (“END” in step S15). On the other hand, if it is determined not to end (“repeat” in step S15), the reference point setting unit 4 resets the reference point, and then the second approximate color region extraction unit 5 uses the new reference point. The approximate color area is repeatedly extracted and further added to the approximate color area (steps 13 to 13). The end determination unit 6 determines whether or not to end, for example, from each reference point (reference points 15a, 15c, 15e, etc. in FIG. 4) extracted in the second approximate color region extraction process in step S14. When the area (namely, the number of pixels) of the extracted approximate color regions (approximate color regions 21a, 21b, 21c, etc.) is smaller than a predetermined size, the determination is made that the condition for termination is satisfied. The area is determined for each of the approximate color regions 21a, 21b, 21c,... So that the end condition is satisfied when all the areas are smaller than a predetermined value, It can be determined that the end condition is satisfied when the total area of 21b, 21c,... Is smaller than a predetermined value. The predetermined value of the area can be set by the ratio (1% or the like) to the already extracted approximate color region in addition to the number of pixels (10 pixels or the like).

なお、終了判定の方法としては、第2の領域抽出ステップS14で用いた各基準点が所望領域の輪郭付近であるかどうかを判定することで行うようにしてもよい。例えば、各基準点で輪郭値を計算(ソーベル、ラブラシアンなど)し、各輪郭値が所定のしきい値以上であれば終了条件が満足されるというようにすることができる。   Note that the end determination method may be performed by determining whether or not each reference point used in the second region extraction step S14 is near the contour of the desired region. For example, the contour value is calculated at each reference point (Sobel, Labrador, etc.), and if each contour value is equal to or greater than a predetermined threshold value, the end condition can be satisfied.

また、ステップS14の第2の領域抽出ステップでは、基準点からの近似色領域領域の抽出処理を行う際に、指定点の画素値から所定のしきい値以上離れた画素値を有する画素を近似色領域から除外する処理を追加することもできる。   Further, in the second region extraction step of step S14, when the approximate color region region extraction process from the reference point is performed, pixels having pixel values that are separated from the pixel value of the specified point by a predetermined threshold or more are approximated. Processing to be excluded from the color area can also be added.

本実施の形態では、基準点の画素値が、前述の例で言えば、R:203、G:176、B:170などの近似色範囲ぎりぎりのものと、R:35、G:25、B:75などの全く異なる画素を隣にもつ輪郭付近の画素に大別できる。輪郭付近の画素は、初期近似色領域(近似色領域13)の範囲中央付近にあることもある。本実施の形態では、輪郭付近の画素が基準点となった場合、しきい値が「16」などの第1の領域抽出で用いたもの(「32」)よりは小さな値に設定されるため、R:35、G:25、B:75などの画素が新たに加わることは通常無い。   In the present embodiment, the pixel value of the reference point is, for the above example, just the approximate color range such as R: 203, G: 176, B: 170, and R: 35, G: 25, B. Can be roughly divided into pixels in the vicinity of an outline having a completely different pixel such as 75. The pixel near the contour may be near the center of the initial approximate color region (approximate color region 13). In the present embodiment, when the pixel near the contour becomes the reference point, the threshold value is set to a value smaller than that used in the first region extraction (“32”) such as “16”. , R: 35, G: 25, B: 75 and the like are not newly added.

一方、基準点の画素値がR:203、G:176、B:170などの指定点12からの近似色範囲ぎりぎりの画素の場合、その画素の隣接画素は、R:202、G:176、B:170など、色がなだらかに変化している部分である場合が多い。こうした部分は人間にとっては同一の領域と捉えられるが、こうした領域を自動で抽出して追加できることが、本実施形態による効果である。この場合、境界画素が、R:203、G:176、B:170であるため、基準点を基準とした第2の近似色範囲は、しきい値16であるとすると、R:187〜219、G:160〜192、B:154〜186となる。このように、指定点を基準とした第1の近似色範囲(R:203〜267、G:144〜206、B:138〜202)からわずかに異なる近似色領域を抽出することができるため、精度の高い所望領域の抽出が可能となる。   On the other hand, in the case where the pixel value of the reference point is a pixel near the approximate color range from the designated point 12 such as R: 203, G: 176, B: 170, the adjacent pixels of the pixel are R: 202, G: 176, There are many cases where the color changes smoothly, such as B: 170. Although such a part is considered as the same area for human beings, it is an effect of the present embodiment that such an area can be automatically extracted and added. In this case, since the boundary pixels are R: 203, G: 176, and B: 170, if the second approximate color range based on the reference point is the threshold value 16, R: 187 to 219 , G: 160 to 192, and B: 154 to 186. Thus, since a slightly different approximate color region can be extracted from the first approximate color range (R: 203 to 267, G: 144 to 206, B: 138 to 202) based on the designated point, It is possible to extract a desired region with high accuracy.

次に、図1の基準点設定部2の他の構成例について説明する。この構成例では、基準点設定ステップS13における基準点の設定が、第1の領域抽出ステップS12によって抽出された近似色領域の外接矩形を求めるステップと、その外接矩形から重心を求めるステップと、第1の領域抽出ステップS12によって抽出された領域の境界画素のうちでその重心から所定の角度にある画素を基準点とするステップとから構成されている。図7を参照して、この構成を用いる場合の基準点の設定例について説明する。図7に示す例では、近似色領域13に対して求められた外接矩形31の重心32から、45°毎にある8個の画素を基準点15a〜15hとしている。なお、図7において図4に示すものと同一の構成には同一の符号を用いている。この構成例では、図5(a)、(b)を参照して説明した上記の構成と比べ境界画素を追跡していく必要が無いため処理速度の面で有利である。   Next, another configuration example of the reference point setting unit 2 in FIG. 1 will be described. In this configuration example, the reference point setting in the reference point setting step S13 includes a step of obtaining a circumscribed rectangle of the approximate color region extracted in the first region extracting step S12, a step of obtaining a center of gravity from the circumscribed rectangle, And a step of setting a pixel at a predetermined angle from the center of gravity among the boundary pixels of the region extracted in one region extraction step S12 as a reference point. With reference to FIG. 7, an example of setting a reference point when this configuration is used will be described. In the example illustrated in FIG. 7, eight pixels at every 45 ° are set as reference points 15 a to 15 h from the center of gravity 32 of the circumscribed rectangle 31 obtained for the approximate color region 13. In FIG. 7, the same components as those shown in FIG. This configuration example is advantageous in terms of processing speed because it is not necessary to track boundary pixels as compared with the above configuration described with reference to FIGS. 5 (a) and 5 (b).

次に、図1の基準点設定部2のさらに他の構成例について説明する。この構成例では、基準点設定ステップS13における基準点の設定が、第1の領域抽出ステップS12で抽出された近似色領域の外接矩形を求めるステップと、その外接矩形を所定の画素単位で網状に分割するステップと、その網状に分割された領域の境界と第1の領域抽出ステップS12によって抽出された領域の境界との交点を基準点とするステップとから構成されている。図8を参照して、この構成を用いる場合の基準点の設定例について説明する。図8に示す例では、近似色領域13に対して求められた外接矩形31を所定画素長で網状に区切り、その分割形状の各辺と境界画素14との交点を基準点15a、15b、…としている。なお、図8において図4に示すものと同一の構成には同一の符号を用いている。この構成例では、図7を参照して説明した上記の構成と比べ、角度を計算する必要が無いため、さらに高速な処理が期待できる。   Next, still another configuration example of the reference point setting unit 2 in FIG. 1 will be described. In this configuration example, the setting of the reference point in the reference point setting step S13 is a step of obtaining a circumscribed rectangle of the approximate color area extracted in the first area extracting step S12, and the circumscribed rectangle is reticulated in predetermined pixel units. The dividing step includes a step of using the intersection of the boundary of the region divided into the mesh and the boundary of the region extracted in the first region extraction step S12 as a reference point. With reference to FIG. 8, a setting example of a reference point when this configuration is used will be described. In the example shown in FIG. 8, the circumscribed rectangle 31 obtained for the approximate color region 13 is divided into a mesh pattern with a predetermined pixel length, and the intersection points of the sides of the divided shape and the boundary pixels 14 are the reference points 15a, 15b,. It is said. In FIG. 8, the same reference numerals are used for the same components as those shown in FIG. In this configuration example, it is not necessary to calculate the angle as compared with the above configuration described with reference to FIG.

なお、本発明の実施の形態は上記のものに限定されず、各ブロックあるいは各ステップを分割したり、統合したりする変更が可能である。また、本発明を構成するプログラムは、コンピュータ読み取り可能な記録媒体や通信回線を介して頒布することが可能である。   The embodiment of the present invention is not limited to the above-described embodiment, and can be changed by dividing or integrating each block or each step. The program constituting the present invention can be distributed via a computer-readable recording medium or a communication line.

本発明による領域抽出装置の実施の形態の構成を示すブロック図。The block diagram which shows the structure of embodiment of the area | region extraction apparatus by this invention. 図1の実施の形態の動作例を説明するためのフローチャート。The flowchart for demonstrating the operation example of embodiment of FIG. 図2のステップS14の内容を説明するためのフローチャート。The flowchart for demonstrating the content of step S14 of FIG. 図1の構成の動作例を説明するための画像10を示す説明図。Explanatory drawing which shows the image 10 for demonstrating the operation example of a structure of FIG. 図4の基準点15の設定例を説明するための説明図。Explanatory drawing for demonstrating the example of a setting of the reference point 15 of FIG. 図2に示す処理内容を説明するための画像10を示す説明図。Explanatory drawing which shows the image 10 for demonstrating the processing content shown in FIG. 図1の基準点設定部4の他の構成を説明するための画像10を示す説明図。Explanatory drawing which shows the image 10 for demonstrating the other structure of the reference point setting part 4 of FIG. 図1の基準点設定部4のさらに他の構成を説明するための画像10を示す説明図。Explanatory drawing which shows the image 10 for demonstrating another structure of the reference point setting part 4 of FIG.

符号の説明Explanation of symbols

1 画像入力部、2 指定点設定部、3 第1の近似色領域抽出部、4 基準点設定部、5 第2の近似色領域抽出部、6 終了判定部、7 抽出領域出力部、12 指定点、15、15a〜15h 基準点

DESCRIPTION OF SYMBOLS 1 Image input part, 2 Specified point setting part, 3 1st approximate color area extraction part, 4 Reference point setting part, 5 2nd approximate color area extraction part, 6 End determination part, 7 Extraction area output part, 12 designation | designated Point, 15, 15a-15h Reference point

Claims (11)

画像から特定領域を抽出する画像処理方法であって、
指定点から近似色領域を抽出する第1の領域抽出ステップと、
抽出された近似色領域に対して追加する近似色領域を抽出する際に用いる基準点を設定する基準点設定ステップと、
その基準点から近似色領域を抽出し、既抽出の近似色領域に加える第2の領域抽出ステップと
を持つことを特徴とする領域抽出方法。
An image processing method for extracting a specific area from an image,
A first region extraction step for extracting an approximate color region from a designated point;
A reference point setting step for setting a reference point used when extracting an approximate color area to be added to the extracted approximate color area;
A region extraction method comprising: a second region extraction step of extracting an approximate color region from the reference point and adding the approximate color region to an already extracted approximate color region.
前記基準点設定ステップにおける基準点の設定が、前記第1の領域抽出ステップによって抽出された領域の境界画素に対し行われるものであることを特徴とする請求項1記載の領域抽出方法。   2. The region extraction method according to claim 1, wherein the reference point setting in the reference point setting step is performed for a boundary pixel of the region extracted by the first region extraction step. 前記基準点設定ステップにおける基準点の設定が、前記第1の領域抽出ステップによって抽出された領域の境界画素に対して行われるものであって且つその境界画素のうち所定画素毎離れた複数画素に対して行われるものであることを特徴とする請求項1又は2記載の領域抽出方法。   The setting of the reference point in the reference point setting step is performed on the boundary pixels of the region extracted by the first region extraction step, and a plurality of pixels separated by a predetermined pixel among the boundary pixels are set. The region extraction method according to claim 1, wherein the region extraction method is performed for the region. 前記基準点設定ステップにおける基準点の設定が、前記第1の領域抽出ステップによって抽出された領域の外接矩形を求めるステップと、その外接矩形を所定の画素単位で網状に分割するステップと、その網状に分割された領域の境界と前記第1の領域抽出ステップによって抽出された領域の境界との交点を基準点とするステップと
を含むものであることを特徴とする請求項1記載の領域抽出方法。
The setting of the reference point in the reference point setting step includes a step of obtaining a circumscribed rectangle of the region extracted by the first region extracting step, a step of dividing the circumscribed rectangle into a mesh shape in units of predetermined pixels, and the mesh shape The region extraction method according to claim 1, further comprising a step of using an intersection of the boundary of the region divided into two and the boundary of the region extracted by the first region extraction step as a reference point.
前記基準点設定ステップにおける基準点の設定が、前記第1の領域抽出ステップによって抽出された領域の外接矩形を求めるステップと、その外接矩形から重心を求めるステップと、前記第1の領域抽出ステップによって抽出された領域の境界画素のうちでその重心から所定の角度にある画素を基準点とするステップと
を含むものであることを特徴とする請求項1記載の領域抽出方法。
The setting of the reference point in the reference point setting step includes the steps of obtaining a circumscribed rectangle of the region extracted by the first region extracting step, obtaining a centroid from the circumscribed rectangle, and the first region extracting step. The region extraction method according to claim 1, further comprising the step of using a pixel at a predetermined angle from the center of gravity of the boundary pixels of the extracted region as a reference point.
前記第1の領域抽出ステップにおける近似色領域の抽出が前記指定点の画素値を基準として所定のしきい値を用いて行われるものであり、
前記第2の領域抽出ステップにおける近似色領域の抽出が前記基準点の画素値を基準として所定のしきい値を用いて行われるものであり、
前記第2の領域抽出ステップにおける所定のしきい値が、前記第1の領域抽出ステップにおける所定のしきい値より小さいものである
ことを特徴とする請求項1から5のいずれか1項に記載の領域抽出方法。
The approximate color region extraction in the first region extraction step is performed using a predetermined threshold value based on the pixel value of the designated point;
Extraction of the approximate color area in the second area extraction step is performed using a predetermined threshold value based on the pixel value of the reference point;
The predetermined threshold value in the second region extraction step is smaller than the predetermined threshold value in the first region extraction step. 6. Region extraction method.
前記第2の領域抽出ステップの処理結果に基づいて近似色領域の抽出処理を終了するか否かを判定し、終了しないと判定した場合に前記基準点設定ステップと前記第2の領域抽出ステップとを繰り返し実行する
ことを特徴とする請求項1から6のいずれか1項に記載の領域抽出方法。
Based on the processing result of the second region extraction step, it is determined whether or not the approximate color region extraction processing is to be ended, and when it is determined not to end, the reference point setting step and the second region extraction step are The region extraction method according to claim 1, wherein the region extraction method is repeatedly executed.
前記基準点から抽出された近似色領域の面積が所定の大きさよりも小さい場合に抽出処理を終了すると判定することを特徴とする請求項7記載の領域抽出方法。   The region extraction method according to claim 7, wherein the extraction process is determined to be terminated when the area of the approximate color region extracted from the reference point is smaller than a predetermined size. 前記第2の領域抽出ステップにおいて、前記基準点が輪郭をなすか否かを判定し、輪郭をなすと判定した場合にその基準点からの近似色領域の抽出を行わない
ことを特徴とする請求項1から8のいずれか1項に記載の領域抽出方法。
In the second region extraction step, it is determined whether or not the reference point forms an outline, and when it is determined that the reference point forms an outline, the approximate color region is not extracted from the reference point. Item 9. The region extraction method according to any one of Items 1 to 8.
画像から特定領域を抽出する画像処理装置であって、
指定点から近似色領域を抽出する第1の領域抽出手段と、
抽出された近似色領域に対して追加する近似色領域を抽出する際に用いる基準点を設定する基準点設定手段と、
その基準点から近似色領域を抽出し、既抽出の近似色領域に加える第2の領域抽出手段と
を備えることを特徴とする領域抽出装置。
An image processing apparatus for extracting a specific area from an image,
First area extracting means for extracting an approximate color area from a designated point;
A reference point setting means for setting a reference point used when extracting an approximate color region to be added to the extracted approximate color region;
A region extracting apparatus comprising: a second region extracting unit that extracts an approximate color region from the reference point and adds the approximate color region to the already extracted approximate color region.
画像から特定領域を抽出する画像処理方法を実行するためのプログラムであって、
指定点から近似色領域を抽出する第1の領域抽出ステップと、
抽出された近似色領域に対して追加する近似色領域を抽出する際に用いる基準点を設定する基準点設定ステップと、
その基準点から近似色領域を抽出し、既抽出の近似色領域に加える第2の領域抽出ステップと
をコンピュータを用いて実行するための記述を含むことを特徴とする領域抽出プログラム。

A program for executing an image processing method for extracting a specific area from an image,
A first region extraction step for extracting an approximate color region from a designated point;
A reference point setting step for setting a reference point used when extracting an approximate color area to be added to the extracted approximate color area;
A region extraction program comprising: a description for executing, using a computer, a second region extraction step of extracting an approximate color region from the reference point and adding the approximate color region to an already extracted approximate color region.

JP2004074308A 2004-03-16 2004-03-16 Region extraction method and device Withdrawn JP2005266891A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004074308A JP2005266891A (en) 2004-03-16 2004-03-16 Region extraction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004074308A JP2005266891A (en) 2004-03-16 2004-03-16 Region extraction method and device

Publications (1)

Publication Number Publication Date
JP2005266891A true JP2005266891A (en) 2005-09-29

Family

ID=35091417

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004074308A Withdrawn JP2005266891A (en) 2004-03-16 2004-03-16 Region extraction method and device

Country Status (1)

Country Link
JP (1) JP2005266891A (en)

Similar Documents

Publication Publication Date Title
US10304408B2 (en) Method and apparatus for changing background color of toolbar with dominant color of picture
WO2018032783A1 (en) Image processing method and apparatus
US9491366B2 (en) Electronic device and image composition method thereof
US8094935B2 (en) Representative color extracting method and apparatus based on human color sense and data histogram distributions
CN104076928B (en) A kind of method for adjusting text importing image
US10332262B2 (en) Removal of background information from digital images
US9792695B2 (en) Image processing apparatus, image processing method, image processing system, and non-transitory computer readable medium
AU2013277005A1 (en) Method for running camera and electronic device thereof
JP5811416B2 (en) Image processing apparatus, image processing method, and program
EP3254283B1 (en) User sliders for simplified adjustment of images
JP2008015706A (en) Image processor
JP5880767B2 (en) Region determination apparatus, region determination method, and program
JP2017126304A (en) Image processing apparatus, image processing method, image processing system, and program
CN112037160A (en) Image processing method, device and equipment
JPH10302061A (en) Digital processing method combining color cast removal and contrast emphasis of digital color image
CN111079637A (en) Method, device and equipment for segmenting rape flowers in field image and storage medium
US8462171B2 (en) Saturation contrast image enhancement
US9886767B2 (en) Method, apparatus and computer program product for segmentation of objects in images
KR20180108799A (en) Method and apparatus for editing a facial model
JP2005266891A (en) Region extraction method and device
JP2005293367A (en) Image processing method and device
KR102215607B1 (en) Electronic device capable of correction to improve the brightness of dark images and operating method thereof
JP2003016444A (en) Device, method, and program for pattern recognition
CN114792283A (en) Image processing method, device and equipment and computer readable storage medium
JP2005128774A (en) Image area extracting device and method

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20070605