JP6662052B2 - Image processing program, image processing apparatus, and image processing method - Google Patents

Image processing program, image processing apparatus, and image processing method Download PDF

Info

Publication number
JP6662052B2
JP6662052B2 JP2016005514A JP2016005514A JP6662052B2 JP 6662052 B2 JP6662052 B2 JP 6662052B2 JP 2016005514 A JP2016005514 A JP 2016005514A JP 2016005514 A JP2016005514 A JP 2016005514A JP 6662052 B2 JP6662052 B2 JP 6662052B2
Authority
JP
Japan
Prior art keywords
background
area
candidate area
edge
distance
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.)
Active
Application number
JP2016005514A
Other languages
Japanese (ja)
Other versions
JP2017126221A (en
Inventor
悟 牛嶋
悟 牛嶋
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2016005514A priority Critical patent/JP6662052B2/en
Publication of JP2017126221A publication Critical patent/JP2017126221A/en
Application granted granted Critical
Publication of JP6662052B2 publication Critical patent/JP6662052B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、画像処理プログラム、画像処理装置、および画像処理方法に関する。   The present invention relates to an image processing program, an image processing device, and an image processing method.

一般的にチラシやポスター等の印刷物には、宣伝を行う商品の画像が掲載されている。このような印刷物の作成には、画像編集ソフトやDesktop publishing(DTP)ソフト等が用いられる。画像編集ソフト等を用いた印刷物の作成では、例えば、商品のみの画像を文字等がレイアウトされた他の画像に貼り付ける処理が行われる。そのため、画像編集ソフトで貼り付け等の編集する前に、素材画像として商品のみの画像を作成する。   Generally, printed materials such as flyers and posters include images of products to be advertised. In order to create such a printed matter, image editing software, Desktop publishing (DTP) software, or the like is used. In the creation of a printed material using image editing software or the like, for example, a process of pasting an image of a product only to another image on which characters and the like are laid out is performed. Therefore, before editing such as pasting with image editing software, an image of only a product is created as a material image.

素材画像は、商品(所望の被写体)とともに背景が写っている画像(以下「元の画像」ともいう)から商品部分の領域を切り出して作成する。元の画像から商品部分の領域を切り出す方法には、画像処理装置(コンピュータ)のオペレータがマウス等の入力装置を用いて切り出す領域を指定する方法と、コンピュータが元の画像における背景部分を自動的に判定して切り出す方法とがある。   The material image is created by cutting out an area of a product part from an image (hereinafter also referred to as an “original image”) in which the background is shown together with the product (a desired subject). The method of cutting out the area of the product portion from the original image includes a method in which the operator of the image processing apparatus (computer) specifies the area to be cut out using an input device such as a mouse, and a method in which the computer automatically extracts the background portion in the original image. There is a method of judging and cutting out.

画像における背景部分を自動的に判定する方法の1つとして、背景内に被写体が存在する被写体存在画像における周縁部の画素の色情報に基づいて背景部分を特定する方法が知られている(例えば、特許文献1参照)。   As one of the methods for automatically determining a background portion in an image, there is known a method of specifying a background portion based on color information of pixels at a peripheral portion in a subject-existing image in which a subject is present in the background (for example, a known method). And Patent Document 1).

特開2010−211255号公報JP 2010-212255 A 特開平07−334676号公報JP 07-334676 A

商品とともに背景が写っている元画像は、多くの場合、ほぼ一色の背景で撮影される。このため、画像の各画素について近接画素と色が近い場合に同一グループとする領域抽出を全画素に対して行い、抽出した領域の中で画像端に接している画素数が最も多い領域を背景と判断することで、商品の外側の背景を自動で抽出することができる。   The original image with the background together with the product is often taken with a nearly one-color background. For this reason, if the color of each pixel of the image is close to that of the neighboring pixel, the same group is extracted for all the pixels, and the region having the largest number of pixels in contact with the image edge in the extracted region is set as the background. Thus, the background outside the product can be automatically extracted.

しかし、バッグやコップの取っ手の内側の領域のように背景が飛び地になっている場合には、外側の背景を抽出する方法と同じ方法では飛び地の背景を抽出することは困難である。   However, if the background is an enclave, such as the area inside the handle of a bag or cup, it is difficult to extract the background of the enclave by the same method as the method for extracting the outer background.

また、特許文献1記載の方法を用いた場合、飛び地の背景領域を自動で抽出することは可能だが、色と画素数のみからの判断しているため、背景ではない領域を誤って抽出する場合がある。   In addition, when the method described in Patent Document 1 is used, it is possible to automatically extract the background area of the enclave. However, since the judgment is made only from the color and the number of pixels, an area other than the background is erroneously extracted. There is.

一つの側面において、本発明は、背景でない領域を背景として誤抽出することを低減し、飛び地になっている背景を抽出することを目的とする。   In one aspect, an object of the present invention is to reduce erroneous extraction of a non-background area as a background, and to extract a background that is an enclave.

実施の形態に係る画像処理プログラムは、コンピュータに、画像に含まれる被写体領域の外側背景を特定し、前記外側背景の色と類似し且つ所定のサイズ以上の領域である背景候補領域を特定させる。   An image processing program according to an embodiment causes a computer to specify an outer background of a subject area included in an image and to specify a background candidate area that is similar to the color of the outer background and is equal to or larger than a predetermined size.

前記画像処理プログラムは、前記コンピュータに、前記背景候補領域と前記被写体領域との第1の境界線と、前記外側背景と前記被写体領域との第2の境界線との距離に基づいて、前記被写体領域が所定形状であるか否か判定し、前記被写体領域が前記所定形状である場合、前記背景候補領域を背景領域に設定させる。   The image processing program causes the computer to execute the object processing based on a distance between a first boundary between the background candidate area and the object area and a second boundary between the outer background and the object area. It is determined whether or not the region has a predetermined shape. If the subject region has the predetermined shape, the background candidate region is set as a background region.

実施の形態に係る画像処理プログラムによれば、背景で無い領域を背景として誤抽出することを低減し、飛び地になっている背景を抽出することができる。   According to the image processing program according to the embodiment, it is possible to reduce erroneous extraction of an area that is not the background as a background, and to extract a background that is an enclave.

飛び地の背景領域の例を示す図である。It is a figure showing an example of a background area of an enclave. 背景領域の誤抽出の例を示す図である。It is a figure showing an example of erroneous extraction of a background field. 実施の形態に係る画像処理装置の機能的構成を示す図である。FIG. 2 is a diagram illustrating a functional configuration of the image processing apparatus according to the embodiment. 第1の実施の形態に係る画像処理方法のフローチャートである。5 is a flowchart of an image processing method according to the first embodiment. 処理対象の画像の一例を示す図である。It is a figure showing an example of an image for processing. グルーピングされた領域を示す画像である。It is an image which shows the grouped area. 画像端座標リストを示す図である。It is a figure showing an image end coordinate list. カウント結果を示す図である。It is a figure showing a count result. 外側背景領域を示す図である。It is a figure showing an outside background field. 背景候補領域を示す図である。It is a figure showing a background candidate field. 背景候補領域判定処理の詳細なフローチャートである。It is a detailed flowchart of a background candidate area determination process. 背景候補領域の輪郭線を示す図である。It is a figure showing the outline of a background candidate field. 外側背景領域の輪郭線を示す図である。It is a figure showing the outline of an outside background field. 背景候補領域および外側背景領域の輪郭点を示す図である。It is a figure showing the outline point of a background candidate field and an outside background field. 背景候補領域の輪郭点と背景候補領域内を通らずに最短距離で直線を結べる外側背景領域の輪郭点とを線で結んだ図である。FIG. 7 is a diagram in which a contour point of a background candidate area is connected with a contour point of an outer background area that can connect a straight line at the shortest distance without passing through the background candidate area. 第1の輪郭点と第2の輪郭点との間の直線区間の画素の抽出処理のフローチャートである。It is a flowchart of the extraction processing of the pixel of the straight line section between the first contour point and the second contour point. 第1の輪郭点と第2の輪郭点との間の直線区間の画素の抽出処理により算出される画素の例を示す図である。It is a figure showing an example of a pixel calculated by extraction processing of a pixel of a straight section between a 1st outline point and a 2nd outline point. 算出した距離に対する背景候補領域の輪郭点の数を示すヒストグラムを示す図である。It is a figure showing the histogram which shows the number of the contour points of the background candidate field to the calculated distance. 選出された背景候補領域の輪郭点と該背景候補領域の輪郭点に対応する外側背景領域の輪郭点を示す図である。It is a figure which shows the outline point of the selected background candidate area, and the outline point of the outer background area corresponding to the outline point of the said background candidate area. 選出された背景候補輪郭点が最も長く連続する区間、および当該背景候補輪郭点に対応する外側背景輪郭点の区間を説明する図である。It is a figure explaining the area | region where the selected background candidate outline point is the longest continuous, and the area | region of the outer background outline point corresponding to the said background candidate outline point. 背景2値画像を示す図である。It is a figure showing a background binary image. 第2の実施の形態に係る画像処理方法のフローチャートである。9 is a flowchart of an image processing method according to a second embodiment. エッジ検出とグループ化を説明する図である。FIG. 3 is a diagram illustrating edge detection and grouping. エッジの検出方法を説明する図である。FIG. 3 is a diagram illustrating a method of detecting an edge. エッジグループリストを示す図である。It is a figure showing an edge group list. エッジグループによる背景候補領域判定処理の詳細なフローチャートである。It is a detailed flowchart of a background candidate area determination process by an edge group. 背景候補領域の輪郭線を示す図である。It is a figure showing the outline of a background candidate field. エッジグループ番号に対応する投票箱の投票数を示す図である。It is a figure showing the number of votes of a ballot box corresponding to an edge group number. 情報処理装置(コンピュータ)の構成図である。It is a block diagram of an information processing apparatus (computer).

図1は、飛び地の背景領域の例を示す図である。
図1では、左側の入力画像11の商品の外側の背景(外側背景領域)を抽出する場合を説明する。
FIG. 1 is a diagram illustrating an example of a background area of an enclave.
FIG. 1 illustrates a case where a background (outer background region) outside a product in the left input image 11 is extracted.

入力画像11は、背景となるテーブルの上に被写体(商品)であるバッグが置かれた画像を示している。入力画像11の周縁部(バッグの周囲)にはテーブルが写っている。また、バッグの取っ手の内側にもテーブルが写っている。   The input image 11 shows an image in which a bag as a subject (product) is placed on a table serving as a background. A table is shown on the periphery of the input image 11 (around the bag). The table is also visible inside the handle of the bag.

入力画像11の各画素について近接画素と色が近い場合に同一グループとする領域抽出を全画素に対して行い、抽出した領域の中で画像端に接している画素数が最も多い領域を背景と判断することで、商品の外側の背景(外側背景領域)が抽出される。   If the color of each pixel of the input image 11 is close to that of the neighboring pixel, the region extraction is performed for all the pixels, and the region having the largest number of pixels in contact with the image edge in the extracted region is defined as the background. By making the determination, the background outside the product (outside background region) is extracted.

図1の右側に、外側背景領域の抽出結果(外側背景抽出結果)12を示す。外側背景抽出結果12では、背景として抽出された外側背景領域は斜線で示している。外側背景抽出結果12において、バッグの取っ手の内側の背景領域(飛び地背景)は白色で示している。バッグの取っ手の内側の領域のような飛び地背景は、外側の背景を抽出する方法と同じ方法では抽出することは困難である。   The right side of FIG. 1 shows an outer background region extraction result (outer background extraction result) 12. In the outer background extraction result 12, the outer background area extracted as the background is indicated by oblique lines. In the outer background extraction result 12, the background area (enclave background) inside the handle of the bag is shown in white. It is difficult to extract an enclave background, such as the area inside the handle of the bag, using the same method as extracting the outer background.

次に、背景領域を誤抽出した場合の例を説明する。
図2は、背景領域の誤抽出の例を示す図である。
Next, an example in which a background region is erroneously extracted will be described.
FIG. 2 is a diagram illustrating an example of erroneous extraction of a background region.

図2では、左側の入力画像21の背景領域を抽出する場合を説明する。
入力画像21は、背景となるテーブルの上に被写体(商品)である盆、茶椀、茶碗が置かれた皿、菓子、楊枝が入れられた袋、および菓子と楊枝が入れられた袋が置かれた皿が写った画像を示している。入力画像11の周縁部(盆の周囲)にはテーブルが写っている。
FIG. 2 illustrates a case where the background area of the left input image 21 is extracted.
The input image 21 includes a tray (a product) serving as a subject (product), a tea bowl, a dish on which a bowl is placed, a confectionery, a bag containing a toothpick, and a bag containing a confectionery and a toothpick on a table serving as a background. The image shows a dish that has been cut. A table is shown on the periphery of the input image 11 (around the tray).

例えば、特許文献1に記載の方法で、背景領域を抽出した場合、抽出結果は図2の右側に示す背景抽出結果22のようになる。   For example, when a background region is extracted by the method described in Patent Literature 1, the extraction result becomes a background extraction result 22 shown on the right side of FIG.

背景抽出結果22では、背景として抽出された領域は斜線で示している。背景抽出結果22において、本来背景でない茶椀の一部、楊枝が入れられた袋、および盆に描かれた模様の一部が背景領域として抽出されている。このように、特許文献1に記載のような、色と画素数のみに基づいて背景領域を抽出する方法では、誤抽出が発生する場合がある。   In the background extraction result 22, the region extracted as the background is indicated by oblique lines. In the background extraction result 22, a part of a tea bowl that is not originally a background, a bag in which a toothpick is placed, and a part of a pattern drawn on a tray are extracted as background areas. As described above, in the method described in Patent Literature 1 in which the background region is extracted based only on the color and the number of pixels, erroneous extraction may occur.

以下、図面を参照しながら実施の形態について説明する。
図3は、実施の形態に係る画像処理装置の機能的構成を示す図である。
Hereinafter, embodiments will be described with reference to the drawings.
FIG. 3 is a diagram illustrating a functional configuration of the image processing apparatus according to the embodiment.

画像処理装置100は、処理部110および記憶部120を備える。
処理部110は、処理対象の画像の背景領域を抽出し、処理対象の画像における背景領域を表す背景2値画像の生成処理等を行う。背景2値画像は、背景の領域の画素値を1、背景以外(非背景)の領域の画素値を0とする2値画像である。
The image processing device 100 includes a processing unit 110 and a storage unit 120.
The processing unit 110 extracts a background region of the image to be processed and performs a process of generating a background binary image representing the background region in the image to be processed. The background binary image is a binary image in which the pixel value of the background region is 1 and the pixel value of the region other than the background (non-background) is 0.

記憶部120は、デジタルカメラで撮像した画像やスキャナで読み込んだ画像のデータ、背景2値画像のデータ等を記憶する。   The storage unit 120 stores data of an image captured by a digital camera, data of an image read by a scanner, data of a background binary image, and the like.

処理部110は、入力部111、抽出部112、及び出力部113を備える。
入力部111は、記憶部120から画像を読み出し、抽出部112に入力する。
The processing unit 110 includes an input unit 111, an extraction unit 112, and an output unit 113.
The input unit 111 reads an image from the storage unit 120 and inputs the image to the extraction unit 112.

抽出部112は、入力された画像について背景領域を抽出し、背景2値画像を生成する。   The extraction unit 112 extracts a background region from the input image and generates a background binary image.

出力部113は、抽出部112により処理された背景2値画像のデータを記憶部120に出力し、記憶部120に格納する。   The output unit 113 outputs the data of the background binary image processed by the extraction unit 112 to the storage unit 120, and stores the data in the storage unit 120.

図4は、第1の実施の形態に係る画像処理方法のフローチャートである。
尚、第1の実施の形態に係る画像処理方法において、予め記憶部120には、図5に示す画像301等の入力画像が記憶されているものとする。画像301は、背景となるテーブルの上に被写体(商品)である取っ手を含むバッグが置かれた画像である。画像301の周縁部(バッグの周囲)およびバッグの取っ手の内側には、背景であるテーブルが写っている。
FIG. 4 is a flowchart of the image processing method according to the first embodiment.
In the image processing method according to the first embodiment, it is assumed that the storage unit 120 stores an input image such as the image 301 shown in FIG. 5 in advance. An image 301 is an image in which a bag including a handle, which is a subject (product), is placed on a table serving as a background. At the periphery of the image 301 (around the bag) and inside the handle of the bag, a table as a background is shown.

先ず入力部111は、記憶部120から処理対象に指定された入力画像を読み出して、抽出部112に入力する。   First, the input unit 111 reads an input image specified as a processing target from the storage unit 120 and inputs the input image to the extraction unit 112.

ステップS201において、抽出部112は、入力画像から領域を抽出(特定)し、被写体領域の外側の背景領域(外側背景領域)を抽出(特定)する。詳細には、先ず抽出部112は、入力画像の全画素について、各画素と隣接画素の輝度、彩度、色相の差を算出し、算出した差が閾値以下であれば同一のグループとなるようにグルーピングする。グルーピングされた画素のグループがそれぞれ領域となる。隣接画素は、ある画素(着目画素)を中心とし、着目画素の上下左右、右上、左上、右下、及び左下に隣り合っている画素である。すなわち、ある画素に対する隣接画素は8個ある。グルーピングされた各領域を示すと、例えば、図6のようになる。図6では、3つの領域(領域1〜3)にグルーピングされている。   In step S201, the extraction unit 112 extracts (specifies) an area from the input image, and extracts (specifies) a background area (outer background area) outside the subject area. More specifically, first, the extraction unit 112 calculates the differences in luminance, saturation, and hue between each pixel and adjacent pixels for all pixels of the input image, and if the calculated difference is equal to or smaller than a threshold, the extraction unit 112 belongs to the same group. Grouping. Each group of grouped pixels becomes an area. The adjacent pixels are pixels that are adjacent to a certain pixel (target pixel) at the top, bottom, left, right, upper right, upper left, lower right, and lower left of the target pixel. That is, there are eight adjacent pixels to a certain pixel. FIG. 6 shows each grouped area, for example. In FIG. 6, three areas (areas 1 to 3) are grouped.

抽出部112は、図7に示すような画像端座標リストを取得する。画像端座標リストには、入力画像の端(上辺、右辺、下辺、左辺)の座標が記載されている。例えば、入力画像のサイズが横640画素、縦480画素である場合、入力画像における左端上、右端上、左端下、及び右端下の座標はそれぞれ、[0,0]、[639,0]、[0,479]、及び[639,479]である。よって、640×480画素の入力画像の画像端座標リストには、図7に示すような上辺の画素の座標、右辺の画素の座標、下辺の画素の座標、及び左辺の画素の座標の合計2236個の座標が記載されている。尚、画像端座標リストは、入力部111が入力画像を読み出したときに作成して記憶部120に格納しておいてもよいし、ステップS201において、抽出部112が作成してもよい。   The extraction unit 112 acquires an image end coordinate list as shown in FIG. The coordinates of the ends (upper side, right side, lower side, left side) of the input image are described in the image end coordinate list. For example, when the size of the input image is 640 pixels in width and 480 pixels in height, the coordinates of the upper left edge, upper right edge, lower left edge, and lower right edge of the input image are [0,0], [639,0], [0,479] and [639,479]. Therefore, the image edge coordinate list of the input image of 640 × 480 pixels includes a total of 2236 of the coordinates of the upper side pixel, the coordinates of the right side pixel, the coordinates of the lower side pixel, and the coordinates of the left side pixel as shown in FIG. Are described. The image end coordinate list may be created when the input unit 111 reads out the input image and stored in the storage unit 120, or may be created by the extraction unit 112 in step S201.

抽出部112は、画像端座標リストの全座標について、各座標の画素に割り当てられた領域番号を取得し、領域番号毎に画素数をカウントする。例えば、図6に示したグルーピングの結果に対してカウントを行うと、図8に示すようなカウント結果が得られる。図8のカウント結果では、領域番号1の画素数が2236個、領域番号2〜3の画素数が0個となっている。   The extraction unit 112 acquires the region numbers assigned to the pixels at each coordinate for all the coordinates in the image end coordinate list, and counts the number of pixels for each region number. For example, when counting is performed on the grouping result shown in FIG. 6, a count result as shown in FIG. 8 is obtained. In the count result of FIG. 8, the number of pixels of the area number 1 is 2236, and the number of pixels of the area numbers 2 and 3 is 0.

抽出部112は、カウントした数が最も多い領域番号に対応する領域を被写体の外側の背景領域(外側背景領域)として判定(設定)し、抽出する。例えば、図8のカウント結果では領域番号1の画素数が一番多い。そのため、図8のカウント結果に対して、領域番号1に対応する領域1が外側背景領域として抽出される。例えば、図5に示す入力画像301の外側背景領域は、図9に示すようになる。図9において、外側背景領域は黒色で表示され、外側背景領域以外の領域は白色で表示されている。   The extraction unit 112 determines (sets) and extracts a region corresponding to the region number with the largest counted number as a background region outside the subject (outside background region). For example, in the count result of FIG. 8, the number of pixels of the area number 1 is the largest. Therefore, the area 1 corresponding to the area number 1 is extracted as the outer background area from the count result of FIG. For example, the outside background area of the input image 301 shown in FIG. 5 is as shown in FIG. In FIG. 9, the outer background area is displayed in black, and the area other than the outer background area is displayed in white.

ステップS202において、抽出部112は、外側背景領域以外の各領域について、背景候補領域に該当するか判定し、背景候補領域を抽出(特定)する。詳細には、抽出部112は、外側背景領域の色、判定対象の領域の色、および当該領域の面積(画素数)に基づいて、背景候補領域に該当するか判定し、背景候補領域を抽出(特定)する。例えば、抽出部112は、外側背景領域(領域1)の画素値の平均と領域2の画素値の平均値との差分を算出し、差分が第1の所定値以下の場合、領域2の色は外側背景領域の色と近いと判定する。領域2の色が外側背景領域の色と近い場合、抽出部112は、領域2の画素数が第2の所定値以上であるか否か判定し、第2の所定値以上であれば、領域2を背景候補領域であると判定する。第2の所定値は、例えば、入力画像301の画素数のX(例えば5)%である。抽出部112は、領域3について、同様に背景候補領域に該当するか否か判定する。ここでは、入力画像301において、領域2は背景候補領域ではないと判定され、領域3は背景候補領域であると判定される。外側背景領域でも背景候補領域でもない領域2は、被写体領域となる。図10は、背景候補領域を示す図である。図10において、背景候補領域である領域3は、灰色で示されている。   In step S202, the extraction unit 112 determines whether each region other than the outer background region corresponds to a background candidate region, and extracts (identifies) the background candidate region. More specifically, the extraction unit 112 determines whether the image corresponds to the background candidate area based on the color of the outer background area, the color of the area to be determined, and the area (number of pixels) of the area, and extracts the background candidate area. (Identify. For example, the extraction unit 112 calculates a difference between the average of the pixel values of the outer background region (region 1) and the average of the pixel values of the region 2 and, when the difference is equal to or smaller than the first predetermined value, the color of the region 2 Is determined to be close to the color of the outer background area. When the color of the area 2 is close to the color of the outer background area, the extraction unit 112 determines whether the number of pixels of the area 2 is equal to or greater than a second predetermined value. 2 is determined to be a background candidate area. The second predetermined value is, for example, X (for example, 5%) of the number of pixels of the input image 301. The extraction unit 112 similarly determines whether or not the region 3 corresponds to a background candidate region. Here, in the input image 301, it is determined that the area 2 is not a background candidate area and the area 3 is determined to be a background candidate area. Region 2 that is neither the outer background region nor the background candidate region is the subject region. FIG. 10 is a diagram illustrating a background candidate area. In FIG. 10, the area 3 which is the background candidate area is shown in gray.

ステップS203において、抽出部112は、未判定の背景候補領域があるか否か判定する。未判定の背景候補領域がある場合、抽出部112は、未判定の背景候補領域のうちの1つを処理対象の背景候補領域とし、制御はステップS204に進む。未判定の背景候補領域がない場合、制御はステップS208に進む。   In step S203, the extraction unit 112 determines whether there is an undetermined background candidate area. If there is an undetermined background candidate area, the extraction unit 112 sets one of the undetermined background candidate areas as the background candidate area to be processed, and the control proceeds to step S204. If there is no undetermined background candidate area, control proceeds to step S208.

ステップS204において、抽出部112は、処理対象の背景候補領域に対して背景候補領域判定処理を行う。以下、背景候補領域判定処理の詳細について説明する。   In step S204, the extraction unit 112 performs a background candidate area determination process on the background candidate area to be processed. Hereinafter, the details of the background candidate area determination processing will be described.

図11は、背景候補領域判定処理の詳細なフローチャートである。図11は、図4のステップS204に対応する。   FIG. 11 is a detailed flowchart of the background candidate area determination processing. FIG. 11 corresponds to step S204 in FIG.

ここでは、図6に示す領域3を背景候補領域、外側背景領域を領域1とした場合の背景候補領域判定処理の例を説明する。   Here, an example of the background candidate area determination processing when the area 3 shown in FIG. 6 is a background candidate area and the outside background area is an area 1 will be described.

ステップS211において、抽出部112は、背景候補領域および外側背景領域の輪郭線を抽出(検出)する。詳細には、抽出部112は、背景候補領域と被写体領域との境界線と、外側背景領域と被写体領域との境界線との境界線を抽出(検出)する。これにより、図12に示すような背景候補領域(領域3)の輪郭線、図13に示すような外側背景領域(領域1)の輪郭線が抽出される。背景候補領域(領域3)の輪郭線は、背景候補領域(領域3)と被写体領域との境界線に相当する。また、外側背景領域(領域1)の輪郭線は、外側背景領域と被写体領域との境界線に相当する。   In step S211, the extraction unit 112 extracts (detects) the outlines of the background candidate region and the outer background region. Specifically, the extraction unit 112 extracts (detects) a boundary between the background candidate region and the subject region and a boundary between the outer background region and the subject region. Thereby, the outline of the background candidate area (area 3) as shown in FIG. 12 and the outline of the outer background area (area 1) as shown in FIG. 13 are extracted. The outline of the background candidate region (region 3) corresponds to the boundary between the background candidate region (region 3) and the subject region. The outline of the outer background region (region 1) corresponds to the boundary between the outer background region and the subject region.

ステップS212において、抽出部112は、背景候補領域および外側背景領域の輪郭線上に点(以下、輪郭点と表記する)を配置する。図14に、背景候補領域および外側背景領域の輪郭点を示す。輪郭点は、例えば、輪郭線上の全ての画素に配置しても良いし、輪郭線上に1画素おきのように所定の間隔毎に配置しても良い。   In step S212, the extraction unit 112 arranges points (hereinafter, referred to as outline points) on the outlines of the background candidate area and the outer background area. FIG. 14 shows contour points of the background candidate area and the outer background area. For example, the contour points may be arranged at all pixels on the contour line, or may be arranged at predetermined intervals such as every other pixel on the contour line.

ステップS213において、抽出部112は、背景候補領域の輪郭点から背景候補領域内を通らずに最短距離で直線を結べる外側背景領域の輪郭点、および該背景候補領域の輪郭点と該外側背景領域の輪郭点との距離を算出する。尚、抽出部112は、全ての背景候補領域の輪郭点それぞれに対して、背景候補領域内を通らずに最短距離で直線を結べる外側背景領域の輪郭点と該外側背景領域の輪郭点との距離を算出する。図15に背景候補領域の輪郭点と背景候補領域内を通らずに最短距離で直線を結べる外側背景領域の輪郭点とを線で結んだ図を示す。   In step S <b> 213, the extraction unit 112 determines the outline point of the outer background area that can connect a straight line at the shortest distance from the outline point of the background candidate area without passing through the background candidate area, and the outline point of the background candidate area and the outer background area. Is calculated with respect to the contour point. Note that the extraction unit 112 determines, for each of the contour points of all the background candidate areas, a contour point of the outer background area that can connect a straight line at the shortest distance without passing through the background candidate area, and a contour point of the outer background area. Calculate the distance. FIG. 15 shows a diagram in which the outline points of the background candidate area and the outline points of the outer background area that can connect a straight line at the shortest distance without passing through the background candidate area are connected by a line.

背景候補領域の輪郭点から背景候補領域内を通らずに最短距離で直線を結べる外側背景領域の輪郭点、および該背景候補領域の輪郭点と該外側背景領域の輪郭点との距離の算出方法について説明する。   A method for calculating the contour points of the outer background area that can connect a straight line at the shortest distance from the contour points of the background candidate area without passing through the background candidate area, and the distance between the contour points of the background candidate area and the contour points of the outer background area Will be described.

ここで、第1の輪郭点と第2の輪郭点とを直線で結んだ場合の直線区間の画素の算出方法について説明する。例えば、第1の輪郭点は背景候補領域の輪郭点に相当し、第2の輪郭点は外側背景領域の輪郭点に相当する。   Here, a method of calculating pixels in a straight section when the first contour point and the second contour point are connected by a straight line will be described. For example, the first contour point corresponds to the contour point of the background candidate area, and the second contour point corresponds to the contour point of the outer background area.

図16は、第1の輪郭点と第2の輪郭点との間の直線区間の画素の抽出処理のフローチャートである。   FIG. 16 is a flowchart of a process of extracting pixels in a straight section between the first contour point and the second contour point.

図16では、第1の輪郭点のX,Y座標を[X1,Y1]、第2の輪郭点のX,Y座標を[X2,Y2]とする。   In FIG. 16, the X and Y coordinates of the first contour point are [X1, Y1], and the X and Y coordinates of the second contour point are [X2, Y2].

ステップS231において、抽出部112は、X差分=X2-X1、Y差分=Y2-Y1を算出する。   In step S231, the extraction unit 112 calculates X difference = X2-X1, and Y difference = Y2-Y1.

ステップS232において、抽出部112は、X差分の絶対値がY差分の絶対値未満であるか否か判定する。X差分の絶対値がY差分の絶対値未満の場合、制御はステップS233に進み、X差分の絶対値がY差分の絶対値以上の場合、制御はステップS243に進む。   In step S232, the extraction unit 112 determines whether the absolute value of the X difference is less than the absolute value of the Y difference. If the absolute value of the X difference is less than the absolute value of the Y difference, the control proceeds to step S233. If the absolute value of the X difference is equal to or greater than the absolute value of the Y difference, the control proceeds to step S243.

ステップS233において、抽出部112は、X増分=X差分/Y差分の絶対値を算出する。   In step S233, the extraction unit 112 calculates the absolute value of X increment = X difference / Y difference.

ステップS234において、抽出部112は、Y差分が0以上であるか否か判定する。Y差分が0以上の場合、制御はステップS235に進み、Y差分が0未満の場合、制御はステップS236に進む。   In step S234, the extraction unit 112 determines whether the Y difference is equal to or greater than 0. If the Y difference is greater than or equal to 0, control proceeds to step S235, and if the Y difference is less than 0, control proceeds to step S236.

ステップS235において、抽出部112は、Y増分を1に設定する。
ステップS236において、抽出部112は、Y増分を−1に設定する。
In step S235, the extraction unit 112 sets the Y increment to 1.
In step S236, the extraction unit 112 sets the Y increment to -1.

ステップS237において、抽出部112は、Xの値をX1、Yの値をY1,Indexの値を1に設定する。   In step S237, the extraction unit 112 sets the value of X to X1, the value of Y to Y1, and the value of Index to 1.

ステップS238において、抽出部112は、Yの値がY2であるか否か判定する。Yの値がY2の場合、処理は終了し、Yの値がY2でない場合、制御はステップS239に進む。   In step S238, the extraction unit 112 determines whether the value of Y is Y2. If the value of Y is Y2, the process ends. If the value of Y is not Y2, the control proceeds to step S239.

ステップS239において、抽出部112は、第1の輪郭点と第2の輪郭点との間の直線区間の画素のうち、Index番目の画素の座標を[X,Y]とする。   In step S239, the extraction unit 112 sets the coordinates of the Index-th pixel among the pixels in the straight line section between the first contour point and the second contour point to [X, Y].

ステップS240において、抽出部112は、XにX増分加算し、YにY増分加算し、Indexを1インクリメントする。   In step S240, the extraction unit 112 increments X by X, increments Y by Y, and increments Index by one.

ステップS243において、抽出部112は、Y増分=Y差分/X差分の絶対値を算出する。   In step S243, the extraction unit 112 calculates the absolute value of Y increment = Y difference / X difference.

ステップS244において、抽出部112は、X差分が0以上であるか否か判定する。X差分が0以上の場合、制御はステップS245に進み、X差分が0未満の場合、制御はステップS246に進む。   In step S244, the extraction unit 112 determines whether or not the X difference is 0 or more. If the X difference is greater than or equal to 0, control proceeds to step S245, and if the X difference is less than 0, control proceeds to step S246.

ステップS245において、抽出部112は、X増分を1に設定する。
ステップS246において、抽出部112は、X増分を−1に設定する。
In step S245, the extraction unit 112 sets the X increment to 1.
In step S246, the extraction unit 112 sets the X increment to -1.

ステップS247において、抽出部112は、Xの値をX1、Yの値をY1,Indexの値を1に設定する。   In step S247, the extraction unit 112 sets the value of X to X1, the value of Y to Y1, and the value of Index to 1.

ステップS248において、抽出部112は、Xの値がX2であるか否か判定する。Xの値がX2の場合、処理は終了し、Xの値がX2でない場合、制御はステップS249に進む。   In step S248, the extraction unit 112 determines whether the value of X is X2. If the value of X is X2, the process ends. If the value of X is not X2, the control proceeds to step S249.

ステップS249において、抽出部112は、第1の輪郭点と第2の輪郭点との間の直線区間の画素のうち、Index番目の画素の座標を[X,Y]とする。   In step S249, the extraction unit 112 sets the coordinates of the Index-th pixel among the pixels in the straight line section between the first contour point and the second contour point to [X, Y].

ステップS250において、抽出部112は、XにX増分加算し、YにY増分加算し、Indexを1インクリメントする。   In step S250, the extraction unit 112 increments X by X, increments Y by Y, and increments Index by one.

抽出部112は、ステップS239またはS249で算出したIndex番目の画素の座標が背景候補領域の画素である場合、第2の輪郭点は、第1の輪郭点から背景候補領域を通って直線を結べる第2の輪郭点であると判定する。このように、背景候補領域内を通らずに最短距離で直線を結べるか否かは、図16の抽出処理の結果を用いて判定する。   When the coordinates of the Index-th pixel calculated in step S239 or S249 are pixels in the background candidate region, the extraction unit 112 can connect the second contour point to a straight line from the first contour point through the background candidate region. It is determined that the point is the second contour point. In this way, whether or not a straight line can be connected at the shortest distance without passing through the background candidate area is determined using the result of the extraction processing in FIG.

また、第1の輪郭点と第2の輪郭点との間の直線区間の画素の抽出処理の終了時のIndexの値が第1の輪郭点と第2の輪郭点との間の距離(画素数)となる。   Also, the value of Index at the end of the extraction process of the pixel in the straight line section between the first contour point and the second contour point is the distance between the first contour point and the second contour point (pixel Number).

抽出部112は、背景候補領域のある輪郭点から背景候補領域内を通らずに最短距離で直線を結べる外側背景領域の輪郭点を算出する場合、背景候補領域のある輪郭点を第1の輪郭点、外側背景領域の輪郭点のそれぞれを第2の輪郭点として、図16の抽出処理を行う。抽出部112は、算出した背景候補領域のある輪郭点から外側背景領域の輪郭点のそれぞれへの直線区間の各画素において、抽出処理終了時のIndexの値が一番小さく(すなわち最短距離)且つステップS239またはS249で算出したIndex番目の画素の座標が背景候補領域の画素を含んでいない場合に対応する第2の輪郭点を背景候補領域のある輪郭点から背景候補領域内を通らずに最短距離で直線を結べる外側背景領域の輪郭点とする。   When calculating an outline point of an outer background area that can connect a straight line at the shortest distance without passing through the background candidate area from an outline point of the background candidate area, the extraction unit 112 extracts the outline point of the background candidate area as a first outline. The extraction process of FIG. 16 is performed using each of the points and the outline points of the outer background area as second outline points. The extraction unit 112 determines that the value of the Index at the end of the extraction process is the smallest (that is, the shortest distance) in each pixel in a straight line section from the calculated contour point of the background candidate area to each of the contour points of the outer background area, and A second contour point corresponding to the case where the coordinates of the Index-th pixel calculated in step S239 or S249 does not include a pixel of the background candidate area is set to the shortest without passing through the background candidate area from a contour point of the background candidate area. It is the contour point of the outside background area that can connect the straight line with the distance.

図17は、第1の輪郭点と第2の輪郭点との間の直線区間の画素の抽出処理により算出される画素の例を示す図である。   FIG. 17 is a diagram illustrating an example of pixels calculated by a process of extracting pixels in a straight line section between a first contour point and a second contour point.

図17の画像351〜354において、輪郭点A,Bは、背景候補領域の輪郭点であり、輪郭点C,D,Eは、外側背景領域の輪郭点である。また、図17の画像351〜354において、非背景領域の画素は灰色で示されている。画像352の輪郭点AとBの間の矢印、画像353の輪郭点BとCの間の矢印、および画像354の輪郭点BとEの間の矢印は、それぞれ図16の抽出処理で算出される第1の輪郭点と第2の輪郭点との間の直線区間の各画素を示す。   In the images 351 to 354 of FIG. 17, the contour points A and B are contour points of the background candidate area, and the contour points C, D and E are contour points of the outer background area. In addition, in the images 351 to 354 of FIG. 17, the pixels in the non-background area are shown in gray. The arrow between the contour points A and B of the image 352, the arrow between the contour points B and C of the image 353, and the arrow between the contour points B and E of the image 354 are respectively calculated by the extraction processing of FIG. 4 shows each pixel in a straight line section between a first contour point and a second contour point.

画像352において、背景候補領域の輪郭点Aから見ると、外側背景領域の輪郭線Cが元も輪郭点Aに近く且つ輪郭点Aから輪郭点Cへの直線区間が途中で背景候補領域内を通らない。従って、背景候補領域の輪郭点Aから背景候補領域内を通らずに最短距離で直線を結べる外側背景領域の輪郭点は、輪郭点Cとなる。   In the image 352, when viewed from the outline point A of the background candidate area, the outline C of the outer background area is originally close to the outline point A, and a straight line section from the outline point A to the outline point C passes through the background candidate area in the middle. I do not pass. Accordingly, the contour point of the outer background area that can connect a straight line with the shortest distance from the contour point A of the background candidate area without passing through the background candidate area is the contour point C.

画像353において、背景候補領域の輪郭点Bから見ると輪郭点Eより輪郭点Dの方が近いが、図16の抽出処理により算出される輪郭点Bと輪郭点Dを直線で結んだ場合の直線区間の画素は、矢印で示されるような画素となり、途中に背景候補領域を含んでしまう。従って、外側背景領域の輪郭点Dは、背景候補領域の輪郭点Bから背景候補領域内を通らずに最短距離で直線を結べる外側背景領域の輪郭点とはならない。   In the image 353, the contour point D is closer to the contour point E than the contour point E when viewed from the contour point B of the background candidate area, but the contour point B and the contour point D calculated by the extraction processing in FIG. The pixels in the straight section are pixels as indicated by arrows, and include a background candidate area in the middle. Therefore, the contour point D of the outer background area does not become the contour point of the outer background area that can connect a straight line with the shortest distance from the contour point B of the background candidate area without passing through the background candidate area.

一方、画像354において、図16の抽出処理により算出される輪郭点Bと輪郭点Eを直線で結んだ場合の直線区間の画素は、矢印で示されるような画素となり、途中に背景候補領域を含んでいない。   On the other hand, in the image 354, the pixels in the straight line section when the contour point B and the contour point E calculated by the extraction processing in FIG. 16 are connected by a straight line are pixels indicated by arrows, and the background candidate area is set in the middle. Not included.

図11に戻り説明を続ける。
ステップS214において、抽出部112は、算出した距離に対する背景候補領域の輪郭点の数を示すヒストグラムを生成し、輪郭点の数が最大の距離から所定の範囲を有効な距離範囲とする。図18は、算出した距離に対する背景候補領域の輪郭点の数を示すヒストグラムである。図18において、外側背景領域の輪郭点との距離がNである背景候補領域の輪郭点の数が最大となっている。抽出部112は、例えば、背景候補領域の輪郭点の数が距離がNである背景候補領域の輪郭点の数の10分の1以上である距離Nを含む範囲を有効な距離範囲とする。
Returning to FIG. 11, the description will be continued.
In step S214, the extraction unit 112 generates a histogram indicating the number of contour points of the background candidate area with respect to the calculated distance, and sets a predetermined range from the distance with the largest number of contour points as an effective distance range. FIG. 18 is a histogram showing the number of contour points in the background candidate area with respect to the calculated distance. In FIG. 18, the number of contour points in the background candidate area whose distance from the contour points in the outer background area is N is the largest. The extraction unit 112 sets, for example, a range including a distance N in which the number of contour points in the background candidate area is equal to or more than one-tenth of the number of contour points in the background candidate area whose distance is N as an effective distance range.

ステップS215において、抽出部112は、有効な距離範囲に含まれる背景候補領域の輪郭点と該背景候補領域の輪郭点に対応する外側背景領域の輪郭点を選出する。背景候補領域の輪郭点に対応する外側背景領域の輪郭点とは、当該背景候補領域の輪郭点から背景候補領域内を通らずに最短距離で直線を結べる外側背景領域の輪郭点である。図19に
選出された背景候補領域の輪郭点と該背景候補領域の輪郭点に対応する外側背景領域の輪郭点を示す。尚、図19において、選出された背景候補領域の輪郭点と該背景候補領域の輪郭点に対応する外側背景領域の輪郭点は線で結ばれている。尚、背景候補領域の輪郭点を背景候補輪郭点、外側背景領域の輪郭点を外側背景輪郭点と表記する場合がある。
In step S215, the extraction unit 112 selects the contour points of the background candidate area included in the effective distance range and the contour points of the outer background area corresponding to the contour points of the background candidate area. The contour points of the outer background area corresponding to the contour points of the background candidate area are contour points of the outer background area that can connect a straight line at the shortest distance from the contour point of the background candidate area without passing through the background candidate area. FIG. 19 shows the contour points of the selected background candidate area and the contour points of the outer background area corresponding to the contour points of the background candidate area. In FIG. 19, the contour points of the selected background candidate area and the contour points of the outer background area corresponding to the contour points of the background candidate area are connected by a line. The contour points of the background candidate area may be referred to as background candidate contour points, and the contour points of the outer background area may be referred to as outer background contour points.

ステップS216において、抽出部112は、選出された背景候補輪郭点が最も長く連続する区間、および当該背景候補輪郭点に対応する外側背景輪郭線の区間を抽出する。図20は、選出された背景候補輪郭点が最も長く連続する区間、および当該背景候補輪郭点に対応する外側背景輪郭点の区間を説明する図である。図20において、選出された背景候補輪郭点が最も長く連続する区間は、輪郭点1から輪郭点2までの区間である。また、背景候補輪郭点が最も長く連続する区間の背景候補輪郭点に対応する外側背景輪郭線の区間は、輪郭点3から輪郭点4までの区間となる。   In step S216, the extraction unit 112 extracts a section in which the selected background candidate contour point is the longest and a section of the outer background contour corresponding to the background candidate contour point. FIG. 20 is a diagram illustrating a section in which the selected background candidate contour point is the longest continuous section and a section of the outer background contour point corresponding to the background candidate contour point. In FIG. 20, the section in which the selected background candidate contour point is the longest and continuous is a section from contour point 1 to contour point 2. Also, the section of the outer background contour line corresponding to the background candidate contour point of the section where the background candidate contour point is the longest continuous section is a section from contour point 3 to contour point 4.

ステップS217において、抽出部112は、選出された背景候補輪郭点と対応する外側背景輪郭点との距離の平均(以下、平均距離と表記する)を算出する。また、抽出部112は、選出された背景候補輪郭点が最も長く連続する区間の端から端までの輪郭線上の距離(以下、内側距離と表記)を算出する。また、抽出部112は、選出された背景候補輪郭点が最も長く連続する区間に対応する外側背景輪郭点の区間の端から端までの輪郭線上の距離(以下、外側距離と表記)を算出する。抽出部112は、図20において、選出された背景候補輪郭点が最も長く連続する区間の輪郭線上の距離として、輪郭点1から輪郭点2までの輪郭線上の距離を算出する。抽出部112は、図20において、当該背景候補輪郭点に対応する外側背景輪郭点の輪郭線上の距離として、輪郭点3から輪郭点4までの輪郭線上の距離を算出する。   In step S217, the extraction unit 112 calculates the average of the distance between the selected background candidate contour point and the corresponding outer background contour point (hereinafter, referred to as an average distance). In addition, the extraction unit 112 calculates a distance (hereinafter, referred to as an inside distance) on an outline from end to end of a section in which the selected background candidate outline point is the longest and continuous. In addition, the extraction unit 112 calculates a distance (hereinafter, referred to as an outside distance) on an outline from end to end of the section of the outer background contour point corresponding to the section in which the selected background candidate contour point is the longest continuous section. . In FIG. 20, the extraction unit 112 calculates the distance on the contour line from the contour point 1 to the contour point 2 as the distance on the contour line of the section where the selected background candidate contour point is the longest and continuous. In FIG. 20, the extraction unit 112 calculates the distance on the outline from the outline point 3 to the outline point 4 as the distance on the outline of the outer background outline point corresponding to the background candidate outline point.

ステップS218において、抽出部112は、条件A:内側距離が平均距離に対し十分に長い、および条件B:内側距離が外側距離とほぼ同じ長さである、を満たすか否か判定する。例えば、抽出部112は、内側距離が平均距離のn倍(例えば、2倍)以上である場合、内側距離が平均距離に対し十分に長いと判定する。例えば、抽出部112は、内側距離が外側距離のp倍(例えば、0.7倍)以上且つq倍(例えば2倍)以下の場合、内側距離が外側距離とほぼ同じ長さであると判定する。   In step S218, the extraction unit 112 determines whether or not Condition A: the inside distance is sufficiently longer than the average distance, and Condition B: the inside distance is almost the same length as the outside distance. For example, when the inside distance is n times (for example, twice) or more of the average distance, the extraction unit 112 determines that the inside distance is sufficiently longer than the average distance. For example, when the inside distance is p times (for example, 0.7 times) and q times (for example, 2 times) or less of the outside distance, the extraction unit 112 determines that the inside distance is almost the same length as the outside distance. I do.

ステップS219において、条件Aおよび条件Bの両方を満たす場合、制御はステップS220に進み、条件Aおよび条件Bのいずれかを満たさない場合、制御はステップS221に進む。   In step S219, if both the conditions A and B are satisfied, the control proceeds to step S220, and if either of the conditions A and B is not satisfied, the control proceeds to step S221.

ステップS220において、抽出部112は、背景候補領域は背景らしいと判定する。すなわち、抽出部112は、図20において、輪郭点1から輪郭点2までの区間と輪郭点3から輪郭点4までの区間で挟まれる領域の形状は細長く、バッグ等の取っ手(手で持つ部分)らしいと判定する。このように、条件Aおよび条件Bの両方を満たす場合、輪郭点1から輪郭点2までの区間と輪郭点3から輪郭点4までの区間で挟まれる領域の形状は、細長いと考えられ、バッグ等の取っ手に相当すると考えられる。飛び地背景になっている領域は、バッグ等の取っ手のように細長い部分の内側であることが多い。よって、輪郭点1から輪郭点2までの区間と輪郭点3から輪郭点4までの区間で挟まれる領域の形状が細長い場合に、当該領域と接する背景候補領域は背景であると考えられる。   In step S220, the extraction unit 112 determines that the background candidate area looks like a background. That is, in FIG. 20, the extraction unit 112 determines that the shape of the region sandwiched by the section from contour point 1 to contour point 2 and the section from contour point 3 to contour point 4 is elongated, ) Is determined. As described above, when both the condition A and the condition B are satisfied, the shape of the region sandwiched between the section from the contour point 1 to the contour point 2 and the section from the contour point 3 to the contour point 4 is considered to be elongated. It is considered to correspond to a handle such as. The area serving as the enclave background is often inside a slender part like a handle of a bag or the like. Therefore, when the shape of the region sandwiched between the section from the contour point 1 to the contour point 2 and the section from the contour point 3 to the contour point 4 is elongated, the background candidate area in contact with the area is considered to be the background.

ステップS221において、抽出部112は、背景候補領域は背景ではないらしいと判定する。すなわち、抽出部112は、図20において、輪郭点1から輪郭点2までの区間と輪郭点3から輪郭点4までの区間で挟まれる領域の形状は、細長くは無く、バッグ等の取っ手ではないと判定する。   In step S221, the extraction unit 112 determines that the background candidate area does not seem to be the background. That is, in FIG. 20, the shape of the region sandwiched by the section from contour point 1 to contour point 2 and the section from contour point 3 to contour point 4 is not elongated and is not a handle of a bag or the like in FIG. Is determined.

図4に戻り説明を続ける。
ステップS205において、背景候補領域判定処理において背景らしいと判定された場合、制御はステップS206に進み、背景らしいと判定されていない場合、制御はステップS207に進む。
Returning to FIG. 4, the description will be continued.
In step S205, if it is determined in the background candidate area determination process that the image is likely to be a background, the control proceeds to step S206. If it is not determined that the image is likely to be a background, the control proceeds to step S207.

ステップS206において、抽出部112は、処理対象の背景候補領域を背景領域であると判定し、処理対象の背景候補領域を背景領域に設定する。   In step S206, the extraction unit 112 determines that the background candidate region to be processed is the background region, and sets the background candidate region to be processed as the background region.

ステップS207において、抽出部112は、処理対象の背景候補領域を背景領域でないと判定し、処理対象の背景候補領域を非背景領域に設定する。   In step S207, the extraction unit 112 determines that the background candidate region to be processed is not a background region, and sets the background candidate region to be processed to a non-background region.

ステップS208において、抽出部112は、背景2値画像を出力する。背景2値画像は、背景として設定された領域の画素値を1、背景以外(非背景)の領域の画素値を0とする2値画像である。図21は、背景2値画像を示す図である。図21の背景2値画像において、背景領域は斜線、非背景領域は黒色で表示されている。図21に示すように、バッグの周囲だけでなく、バッグの取っ手の内側の飛び地も背景領域として設定されている。抽出部112は、背景2値画像を、出力部113に出力する。また、出力部113は、抽出部112から受け取った背景2値画像を記憶部120に出力し、格納する。   In step S208, the extraction unit 112 outputs a background binary image. The background binary image is a binary image in which the pixel value of an area set as a background is 1 and the pixel value of an area other than the background (non-background) is 0. FIG. 21 is a diagram illustrating a background binary image. In the background binary image of FIG. 21, the background area is displayed in oblique lines, and the non-background area is displayed in black. As shown in FIG. 21, not only the periphery of the bag, but also the enclave inside the handle of the bag is set as the background area. The extraction unit 112 outputs the background binary image to the output unit 113. In addition, the output unit 113 outputs the background binary image received from the extraction unit 112 to the storage unit 120 and stores it.

尚、抽出部112は、ステップS208において背景2値画像を出力する代わりに、背景2値画像のデータを用いて、入力画像から背景領域を除去した画像(被写体の画像)を生成して出力してもよい。   Note that, instead of outputting the background binary image in step S208, the extraction unit 112 generates and outputs an image (subject image) obtained by removing the background region from the input image using the data of the background binary image. You may.

第1の実施の形態に係る画像処理方法によれば、背景でない領域を背景として誤抽出することを低減し、飛び地になっている背景を抽出することができる。   According to the image processing method according to the first embodiment, it is possible to reduce erroneous extraction of a non-background area as a background, and to extract an enclave.

次に、エッジグループによる背景候補領域判定処理をさらに行う第2の実施の形態について説明する。   Next, a description will be given of a second embodiment in which a background candidate area determination process using an edge group is further performed.

第2の実施の形態に係る画像処理方法のフローチャートである。
先ず入力部111は、記憶部120から処理対象に指定された入力画像を読み出して、抽出部112に入力する。
9 is a flowchart of an image processing method according to a second embodiment.
First, the input unit 111 reads an input image specified as a processing target from the storage unit 120 and inputs the input image to the extraction unit 112.

ステップS301において、抽出部112は、入力画像から領域を抽出(特定)し、被写体の外側の背景領域(外側背景領域)を抽出(特定)する。尚、ステップS301の処理は、第1の実施の形態のステップS201の処理と同様なため、詳細な説明は省略する。   In step S301, the extraction unit 112 extracts (specifies) a region from the input image, and extracts (specifies) a background region outside the subject (outer background region). Note that the processing in step S301 is the same as the processing in step S201 of the first embodiment, and a detailed description thereof will be omitted.

ステップS302において、抽出部112は、外側背景領域以外の各領域について、背景候補領域に該当するか判定し、背景候補領域を抽出(特定)する。尚、ステップS302の処理は、第1の実施の形態のステップS202の処理と同様なため、詳細な説明は省略する。   In step S302, the extraction unit 112 determines whether each area other than the outer background area corresponds to a background candidate area, and extracts (identifies) the background candidate area. Note that the processing in step S302 is the same as the processing in step S202 in the first embodiment, and a detailed description thereof will be omitted.

ステップS303において、抽出部112は、入力画像のエッジを検出し、検出したエッジのグループ化を行う。ここで、エッジ検出とグループ化の詳細について図23〜図25を用いて説明する。   In step S303, the extraction unit 112 detects edges of the input image and groups the detected edges. Here, the details of edge detection and grouping will be described with reference to FIGS.

図23は、エッジ検出とグループ化を説明する図である。図24は、エッジの検出方法を説明する図である。図25は、エッジグループリストを示す図である。第2の実施の形態の画像処理方法において、例えば、図23に示す画像401を入力画像として用いる。画像401は、背景となるテーブルの上に被写体(商品)である取っ手を含むバッグが置かれた画像である。画像401の周縁部(バッグの周囲)およびバッグの取っ手の内側には、背景であるテーブルが写っている。   FIG. 23 is a diagram illustrating edge detection and grouping. FIG. 24 is a diagram for explaining an edge detection method. FIG. 25 is a diagram showing an edge group list. In the image processing method according to the second embodiment, for example, an image 401 shown in FIG. 23 is used as an input image. The image 401 is an image in which a bag including a handle, which is a subject (product), is placed on a table serving as a background. A table as a background is shown on the periphery of the image 401 (around the bag) and inside the handle of the bag.

先ず、抽出部112は、入力画像(画像401)をグレースケール化し、グレースケール画像(輝度画像)403を生成する。抽出部112は、グレースケール画像403の全画素について、各画素の横(X)方向勾配fxと縦(Y)方向勾配fyを算出する。ある画素の横(X)方向勾配fxは、以下のように求められる。横(X)方向勾配fxを求める画素とその隣接画素の各画素値に図24に示すような横(X)方向勾配フィルタFLxを乗算し、各画素に対する乗算結果を合計した値を、求める画素の横(X)方向勾配fxとする。同様に、縦(Y)方向勾配fyは、以下のように求められる。縦(Y)方向勾配fyを求める画素とその隣接画素の各画素値に図24に示すような縦(Y)方向勾配フィルタFLyを乗算し、各画素に対する乗算結果を合計した値を、求める画素の縦(Y)方向勾配fyとする。   First, the extraction unit 112 converts the input image (image 401) into grayscale, and generates a grayscale image (luminance image) 403. The extraction unit 112 calculates a horizontal (X) direction gradient fx and a vertical (Y) direction gradient fy of each pixel for all pixels of the grayscale image 403. The horizontal (X) direction gradient fx of a certain pixel is obtained as follows. The pixel for which the horizontal (X) direction gradient fx is to be obtained and each pixel value of its adjacent pixels are multiplied by a horizontal (X) direction gradient filter FLx as shown in FIG. 24, and the sum of the multiplication results for each pixel is calculated. In the horizontal (X) direction. Similarly, the vertical (Y) direction gradient fy is obtained as follows. The vertical (Y) direction gradient filter FLy as shown in FIG. 24 multiplies each pixel value of the pixel for which the vertical (Y) direction gradient fy is obtained and its adjacent pixel, and obtains the sum of the multiplication results for each pixel. In the vertical (Y) direction.

次に、抽出部112は、グレースケール画像403の全画素について、各画素の横(X)方向勾配fxと画素の縦(Y)方向勾配fyとから各画素の勾配の大きさ(エッジ強度)fxyを算出する。勾配の大きさfxyは、fxy=((fx)+(fy)1/2により算出される。 Next, for all the pixels of the grayscale image 403, the extraction unit 112 calculates the gradient magnitude (edge strength) of each pixel from the horizontal (X) gradient fx of each pixel and the vertical (Y) gradient fy of the pixel. Calculate fxy. The magnitude fxy of the gradient is calculated by fxy = ((fx) 2 + (fy) 2 ) 1/2 .

また、抽出部112は、各画素の横(X)方向勾配fxと画素の縦(Y)方向勾配fyとから各画素のエッジ方向(勾配方向)θを算出する。エッジ方向θは、θ=tan−1((fy)/(fx))により算出される。このエッジ方向θは、後述のエッジのグループ化時に用いられる。 The extraction unit 112 calculates the edge direction (gradient direction) θ of each pixel from the horizontal (X) gradient fx of each pixel and the vertical (Y) gradient fy of each pixel. The edge direction θ is calculated by θ = tan −1 ((fy) / (fx)). The edge direction θ is used at the time of edge grouping described later.

次に、抽出部112は、勾配の大きさfxyが閾値以上である画素をエッジとして判定(検出)する。以下、エッジとして判定された画素は、エッジ画素またはエッジと呼ぶ。エッジの検出結果を示すと、例えば、図23のエッジ検出結果404のようになる。エッジ検出結果404では、エッジ画素は白、エッジ画素以外は黒で表示している。   Next, the extraction unit 112 determines (detects) a pixel whose gradient magnitude fxy is equal to or larger than a threshold as an edge. Hereinafter, a pixel determined as an edge is referred to as an edge pixel or an edge. The result of edge detection is, for example, the result of edge detection 404 in FIG. In the edge detection result 404, the edge pixels are displayed in white, and the other pixels are displayed in black.

尚、エッジの検出方法は上述の方法に限られず、任意の方法を用いることができる。
次に、抽出部112は、各エッジ画素の隣接関係及びエッジ方向に基づいて、連接する複数のエッジ画像を1グループとするグループ化を行う。抽出部112は、各エッジ画素について、隣接する2個のエッジ画素のエッジ方向の差が所定の閾値(例えば、30度)以下となる複数のエッジ画素を1つのグループとする。例えば、エッジ画素1とエッジ画素1に隣接するエッジ画素2のエッジ方向の差が閾値以下とすると、エッジ画素1とエッジ画素2は、同じエッジグループとしてグループ化される。さらに、エッジ画素2とエッジ画素2に隣接するエッジ画素3のエッジ方向の差が閾値以下とすると、エッジ画素2とエッジ画素3は、同じエッジグループとする。ここで、エッジ画素1とエッジ画素2は同じエッジグループであるため、エッジ画素1とエッジ画素3も同じエッジグループとなり、連接するエッジ画素1〜3が同じエッジグループとしてグループ化される。この際、エッジ画像1のエッジ方向とエッジ画像3のエッジ方向との差は閾値より大きくても構わない。図23にエッジ画素をグループ化した結果405と、その一部領域を拡大した図を示す。グループ化した結果405の下に示す拡大図では、同一のエッジグループを楕円で囲んで示しており、楕円1405−1、1405−2、1405−3のそれぞれに囲まれたエッジ画素は、同一のエッジグループである。楕円1405−1、1405−2、1405−3のそれぞれに囲まれたエッジ画素のグループには、例えば、グループ番号1,12,22がそれぞれ割り当てられている。
Note that the edge detection method is not limited to the above-described method, and any method can be used.
Next, the extraction unit 112 groups a plurality of connected edge images into one group based on the adjacent relationship and the edge direction of each edge pixel. For each edge pixel, the extraction unit 112 groups a plurality of edge pixels in which a difference in edge direction between two adjacent edge pixels is equal to or smaller than a predetermined threshold (for example, 30 degrees). For example, if the difference in the edge direction between the edge pixel 1 and the edge pixel 2 adjacent to the edge pixel 1 is equal to or smaller than the threshold, the edge pixels 1 and 2 are grouped as the same edge group. Furthermore, if the difference in the edge direction between the edge pixel 2 and the edge pixel 3 adjacent to the edge pixel 2 is equal to or smaller than the threshold value, the edge pixel 2 and the edge pixel 3 belong to the same edge group. Here, since the edge pixel 1 and the edge pixel 2 are in the same edge group, the edge pixel 1 and the edge pixel 3 are also in the same edge group, and the connected edge pixels 1 to 3 are grouped as the same edge group. At this time, the difference between the edge direction of the edge image 1 and the edge direction of the edge image 3 may be larger than the threshold. FIG. 23 shows a result 405 of grouping the edge pixels, and an enlarged view of a partial area thereof. In the enlarged view below the grouping result 405, the same edge group is surrounded by an ellipse, and the edge pixels surrounded by the ellipses 1405-1, 1405-2, and 1405-3 are the same. An edge group. For example, group numbers 1, 12, and 22 are assigned to the edge pixel groups surrounded by the ellipses 1405-1, 1405-2, and 1405-3, respectively.

また、抽出部112は、エッジ画素をグループ化するステップS303の処理において、エッジグループリストを作成する。エッジグループリストは、エッジグループの数と同じ数だけ作成される。すなわち、グループ化処理においてM個のエッジグループが生成された場合、抽出部112は、図25に示すようなM個のエッジグループリスト411−i(i=1〜M)を作成する。エッジグループリスト411−iには、各エッジグループに含まれるエッジ画素の座標が記載されている。例えば、エッジグループリスト411−1は、エッジグループ[1]に含まれるN個のエッジ画素[1]〜[N]の座標が記載されている。エッジグループリスト411−iにおいて、エッジ画素の座標は、隣接するエッジ画素の座標が前後に記載されるようになっている。例えば、エッジグループリスト411−1において、1番目に記載されているエッジ画素[1]の座標の次(すなわち2番目)に、エッジ画素[1]と隣接するエッジ画素[2]の座標が記載されている。   Further, the extraction unit 112 creates an edge group list in the process of step S303 for grouping edge pixels. Edge group lists are created in the same number as the number of edge groups. That is, when M edge groups are generated in the grouping process, the extraction unit 112 creates M edge group lists 411-i (i = 1 to M) as shown in FIG. The edge group list 411-i describes coordinates of edge pixels included in each edge group. For example, the edge group list 411-1 describes the coordinates of N edge pixels [1] to [N] included in the edge group [1]. In the edge group list 411-i, the coordinates of the edge pixels are such that the coordinates of adjacent edge pixels are described before and after. For example, in the edge group list 411-1, the coordinates of the edge pixel [1] and the coordinates of the edge pixel [2] adjacent to the edge pixel [1] are described next to the coordinates of the edge pixel [1] described first. Have been.

ステップS304において、抽出部112は、未判定の背景候補領域があるか判定する。未判定の背景候補領域がある場合、抽出部112は、未判定の背景候補領域のうちの1つを処理対象の背景候補領域とし、制御はステップS305に進む。未判定の背景候補領域がない場合、制御はステップS311に進む。   In step S304, the extraction unit 112 determines whether there is an undetermined background candidate area. If there is an undetermined background candidate area, the extraction unit 112 sets one of the undetermined background candidate areas as a processing target background candidate area, and the control proceeds to step S305. If there is no undetermined background candidate area, control proceeds to step S311.

ステップS305において、抽出部112は、処理対象の背景候補領域に対して背景候補領域判定処理を行う。背景候補領域判定処理の詳細は、図11で述べたとおりであるので、説明は省略する。   In step S305, the extraction unit 112 performs a background candidate area determination process on the background candidate area to be processed. The details of the background candidate area determination processing are as described with reference to FIG.

ステップS306において、背景候補領域判定処理において背景らしいと判定された場合、制御はステップS207に進み、背景らしいと判定されていない場合、制御はステップS310に進む。   In step S306, if it is determined in the background candidate area determination process that the image is likely to be a background, the control proceeds to step S207. If it is not determined that the image is likely to be a background, the control proceeds to step S310.

ステップS307において、抽出部112は、エッジグループによる背景候補領域判定処理を行う。ここで、エッジグループによる背景候補領域判定処理の詳細について説明する。   In step S307, the extraction unit 112 performs a background candidate area determination process based on the edge group. Here, the details of the background candidate area determination processing by the edge group will be described.

図26は、エッジグループによる背景候補領域判定処理の詳細なフローチャートで。図26は、図22のステップS307に対応する。   FIG. 26 is a detailed flowchart of the background candidate area determination processing based on the edge group. FIG. 26 corresponds to step S307 in FIG.

ステップS321において、抽出部112は、変数としてエッジグループ番号それぞれに対応する投票箱を用意し、各投票箱の投票数(投票箱の値)をゼロにセットする。   In step S321, the extraction unit 112 prepares a ballot box corresponding to each edge group number as a variable, and sets the number of votes (the value of the ballot box) of each ballot box to zero.

ステップS322において、抽出部112は、処理対象の背景候補領域の輪郭線を抽出(検出)する。これにより、図27に示すような背景候補領域の輪郭線が抽出される。抽出部112は、輪郭線上の画素に1から順に番号を割り当てる。   In step S322, the extraction unit 112 extracts (detects) the contour of the background candidate area to be processed. As a result, a contour line of the background candidate area as shown in FIG. 27 is extracted. The extraction unit 112 assigns numbers to pixels on the contour in order from 1.

ステップS323において、抽出部112は、変数Indexを1に設定する。
ステップS324において、抽出部112は、Indexの値が輪郭線の背景候補領域の輪郭線の画素数以下であるか否か判定する。Indexの値が輪郭線の背景候補領域の輪郭線の画素数以下である場合、制御はステップS325に進み、Indexの値が輪郭線の背景候補領域の輪郭線の画素数より大きい場合、制御はステップS327に進む。
In step S323, the extraction unit 112 sets the variable Index to 1.
In step S324, the extraction unit 112 determines whether or not the value of Index is equal to or less than the number of pixels of the contour in the contour candidate background area. If the value of Index is equal to or less than the number of pixels of the contour in the background candidate region of the contour, control proceeds to step S325. If the value of Index is greater than the number of pixels of the contour of the background candidate region of the contour, control is performed. Proceed to step S327.

ステップS325において、抽出部112は、輪郭線のIndex番の画素から最も距離が近いエッジ画素を抽出し、そのエッジ画素が属するエッジグループ番号に対応する投票箱の投票数に1加算する。図28は、エッジグループ番号に対応する投票箱の投票数を示す図である。例えば、図28において、エッジグループ番号1に対応する投票箱の投票数は100となっており、エッジグループ番号12、22に対応する投票箱の投票数は0となっている。   In step S325, the extraction unit 112 extracts an edge pixel closest to the pixel of the index number of the contour line and adds 1 to the number of votes in the ballot box corresponding to the edge group number to which the edge pixel belongs. FIG. 28 is a diagram illustrating the number of votes in the ballot box corresponding to the edge group number. For example, in FIG. 28, the number of votes in the ballot box corresponding to the edge group number 1 is 100, and the number of votes in the ballot boxes corresponding to the edge group numbers 12 and 22 is 0.

ステップS326において、抽出部112は、Indexを1インクリメントする。
ステップS327において、抽出部112は、投票数が多い上位N(例えば3)位まで投票箱の投票数の合計を算出する。
In step S326, the extraction unit 112 increments Index by one.
In step S327, the extraction unit 112 calculates the total number of votes in the ballot box up to the top N (for example, third) with the largest number of votes.

ステップS328において、抽出部112は、ステップS327で算出した投票数の合計が背景候補領域の輪郭線の画素数のM(例えば75)%以上であるか否か判定する。投票数の合計が背景候補領域の輪郭線の画素数のM%以上である場合、制御はステップS329に進み、投票数の合計が背景候補領域の輪郭線の画素数のM%未満である場合、制御はステップS330に進む。投票数の合計が背景候補領域の輪郭線の画素数のM%以上である場合、背景候補領域はエッジの連なりに囲まれていると考えられる。   In step S328, the extraction unit 112 determines whether the total number of votes calculated in step S327 is M (for example, 75)% or more of the number of pixels of the contour line of the background candidate area. When the total number of votes is equal to or more than M% of the number of pixels of the contour of the background candidate area, the control proceeds to step S329, and when the total number of votes is less than M% of the number of pixels of the contour of the background candidate area. , Control proceeds to step S330. When the total number of votes is equal to or more than M% of the number of pixels of the outline of the background candidate area, the background candidate area is considered to be surrounded by a series of edges.

ステップS329において、抽出部112は、抽出部112は、背景候補領域は背景らしいと判定する。   In step S329, the extraction unit 112 determines that the background candidate area seems to be a background.

ステップS330において、抽出部112は、背景候補領域は背景ではないらしいと判定する。   In step S330, the extraction unit 112 determines that the background candidate region does not seem to be the background.

図22に戻り説明を続ける。
ステップS308において、エッジグループによる背景候補領域判定処理において背景らしいと判定された場合、制御はステップS309に進み、背景らしいと判定されていない場合、制御はステップS310に進む。
Returning to FIG. 22, the description will be continued.
In step S308, if it is determined in the background candidate area determination processing by the edge group that the image is likely to be a background, the control proceeds to step S309. If it is not determined that the image is likely to be a background, the control proceeds to step S310.

ステップS309において、抽出部112は、処理対象の背景候補領域を背景領域であると判定し、処理対象の背景候補領域を背景領域に設定する。   In step S309, the extraction unit 112 determines that the background candidate region to be processed is a background region, and sets the background candidate region to be processed as a background region.

ステップS310において、抽出部112は、処理対象の背景候補領域を背景領域でないと判定し、処理対象の背景候補領域を非背景領域に設定する。   In step S310, the extraction unit 112 determines that the background candidate region to be processed is not a background region, and sets the background candidate region to be processed to a non-background region.

ステップS311において、抽出部112は、背景2値画像を出力する。尚、抽出部112は、ステップS311において背景2値画像を出力する代わりに、背景2値画像のデータを用いて、入力画像から背景領域を除去した画像(被写体の画像)を生成して出力してもよい。   In step S311, the extraction unit 112 outputs a background binary image. Note that, instead of outputting the background binary image in step S311, the extraction unit 112 generates and outputs an image (subject image) obtained by removing the background region from the input image using the data of the background binary image. You may.

第2の実施の形態に係る画像処理方法によれば、背景でない領域を背景として誤抽出することを低減し、飛び地になっている背景を抽出することができる。   According to the image processing method according to the second embodiment, it is possible to reduce erroneous extraction of a non-background area as a background, and to extract a background that is an enclave.

第2の実施の形態に係る画像処理方法によれば、バッグ等の取っ手にはエッジが表れると考えられるため、エッジグループによる背景候補領域判定処理を行うことで、取っ手であるか否かを正しく判定できる可能性が向上し、飛び地になっている背景を正しく抽出できる可能性が向上する。   According to the image processing method according to the second embodiment, it is considered that an edge appears in a handle such as a bag. Therefore, by performing a background candidate area determination process using an edge group, it is possible to correctly determine whether or not the handle is a handle. The possibility of being able to judge is improved, and the possibility of being able to correctly extract the background at the enclave is improved.

図29は、情報処理装置(コンピュータ)の構成図である。
実施の形態の画像処理装置101は、例えば、図29に示すような情報処理装置1によって実現される。
FIG. 29 is a configuration diagram of the information processing apparatus (computer).
The image processing apparatus 101 according to the embodiment is realized by, for example, the information processing apparatus 1 as shown in FIG.

情報処理装置1は、CPU2、メモリ3、入力部4、出力部5、記憶部6、記録媒体駆動部7、及びネットワーク接続部8を備え、それらはバス9により互いに接続されている。   The information processing device 1 includes a CPU 2, a memory 3, an input unit 4, an output unit 5, a storage unit 6, a recording medium driving unit 7, and a network connection unit 8, which are connected to each other by a bus 9.

CPU2は、情報処理装置1全体を制御する中央処理装置である。CPU2は、処理部110に対応する。   The CPU 2 is a central processing unit that controls the entire information processing device 1. The CPU 2 corresponds to the processing unit 110.

メモリ3は、プログラム実行の際に、記憶部6(あるいは可搬記録媒体10)に記憶されているプログラムあるいはデータを一時的に格納するRead Only Memory(ROM)やRandom Access Memory(RAM)等のメモリである。CPU2は、メモリ3を利用してプログラムを実行することにより、上述した各種処理を実行する。   The memory 3 includes a Read Only Memory (ROM) and a Random Access Memory (RAM) for temporarily storing a program or data stored in the storage unit 6 (or the portable recording medium 10) when executing the program. Memory. The CPU 2 executes the above-described various processes by executing a program using the memory 3.

この場合、可搬記録媒体10等から読み出されたプログラムコード自体が実施の形態の機能を実現する。   In this case, the function of the embodiment is realized by the program code itself read from the portable recording medium 10 or the like.

入力部4は、例えば、キーボード、マウス、タッチパネル等である。
出力部5は、例えば、ディスプレイ、プリンタ等である。
The input unit 4 is, for example, a keyboard, a mouse, a touch panel, or the like.
The output unit 5 is, for example, a display, a printer, or the like.

記憶部6は、例えば、磁気ディスク装置、光ディスク装置、テープ装置等である。情報処理装置1は、記憶部6に、上述のプログラムとデータを保存しておき、必要に応じて、それらをメモリ3に読み出して使用する。
メモリ3及び記憶部6は、記憶部120に対応する。
The storage unit 6 is, for example, a magnetic disk device, an optical disk device, a tape device, or the like. The information processing device 1 stores the above-described program and data in the storage unit 6, and reads and uses them in the memory 3 as needed.
The memory 3 and the storage unit 6 correspond to the storage unit 120.

記録媒体駆動部7は、可搬記録媒体10を駆動し、その記録内容にアクセスする。可搬記録媒体としては、メモリカード、フレキシブルディスク、Compact Disk Read Only Memory(CD−ROM)、光ディスク、光磁気ディスク等、任意のコンピュータ読み取り可能な記録媒体が用いられる。ユーザは、この可搬記録媒体10に上述のプログラムとデータを格納しておき、必要に応じて、それらをメモリ3に読み出して使用する。   The recording medium drive 7 drives the portable recording medium 10 and accesses the recorded contents. As the portable recording medium, any computer-readable recording medium such as a memory card, a flexible disk, a Compact Disk Read Only Memory (CD-ROM), an optical disk, and a magneto-optical disk is used. The user stores the above-described program and data in the portable recording medium 10 and reads them out to the memory 3 for use as necessary.

ネットワーク接続部8は、Local Area Network(LAN)やWide Area Network(WAN)等の任意の通信ネットワークに接続され、通信に伴うデータ変換を行う。   The network connection unit 8 is connected to an arbitrary communication network such as a Local Area Network (LAN) or a Wide Area Network (WAN), and performs data conversion accompanying communication.

以上の実施の形態に関し、さらに以下の付記を開示する。
(付記1)
画像に含まれる被写体領域の外側背景を特定し、
前記外側背景の色と類似し且つ所定のサイズ以上の領域である背景候補領域を特定し、
前記背景候補領域と前記被写体領域との第1の境界線と、前記外側背景と前記被写体領域との第2の境界線との距離に基づいて、前記被写体領域が所定形状であるか否か判定し、
前記被写体領域が前記所定形状である場合、前記背景候補領域を背景領域に設定する
処理をコンピュータに実行させる画像処理プログラム。
(付記2)
前記被写体領域が所定形状であるか否か判定する処理は、
前記背景候補領域の前記第1の境界線上に複数の第1の輪郭点を配置し、前記外側背景の前記第2の境界線上に複数の第2の輪郭点を配置し、
前記複数の第1の輪郭点のそれぞれにおいて、前記背景候補領域を通らずに最短の直線で結べる前記複数の第2の輪郭点との最短距離を算出し、
算出した前記複数の第1の輪郭点のそれぞれの前記複数の第2の輪郭点との前記最短距離の分布に基づいて、前記複数の第1の輪郭点から有効な複数の第1の輪郭点を選出し、前記有効な複数の第1の輪郭点のそれぞれと前記背景候補領域を通らずに最短の直線で結べる前記複数の第2の輪郭点のうちの有効な複数の第2の輪郭点を選出し、
前記有効な複数の第1の輪郭点と前記有効な複数の第2の輪郭点との距離の平均 、前記背景候補領域の前記第1の境界線上の前記有効な複数の第1の輪郭点が存在する区間の一方の端から他方の端までの第1の距離 、および前記外側背景の前記第2の境界線上の前記有効な複数の第2の輪郭点が存在する区間の一方の端から他方の端までの第2の距離を算出し、
前記平均、前記第1の距離、および前記第2の距離に基づいて、前記背景候補領域が背景であるか否か判定することを特徴とする付記1記載の画像処理プログラム。
(付記3)
前記背景候補領域が背景であるか否か判定する処理は、前記第1の距離が前記平均の第1の所定値倍以上であり、且つ前記第2の距離が前記第1の距離の第2の所定値倍以上且つ第3の所定値倍以内である場合、前記背景候補領域が背景であると判定することを特徴とする付記2記載の画像処理プログラム。
(付記4)
前記画像におけるエッジを示すエッジ画素を検出し、前記エッジ画素の勾配方向に基づいて連接する複数の前記エッジ画素を1グループとして複数のエッジグループを生成し、
前記背景候補領域の前記第1の境界線の複数の輪郭画素のそれぞれにおいて、最も距離が近い前記エッジ画素が属するエッジグループを特定し、
前記複数のエッジグループのうち、特定されたエッジグループの回数の多い順に、特定された回数が一番多いエッジグループから所定番目のエッジグループまでの特定された回数の合計を算出し、
前記合計に基づいて、前記背景候補領域が背景であるか否か判定する、
処理をさらに前記コンピュータに実行させることを特徴とする付記2または3記載の画像処理プログラム。
(付記5)
前記合計に基づいて、前記背景候補領域が背景であるか否か判定する処理は、前記合計が前記背景候補領域の前記第1の境界線の前記複数の輪郭画素の数の第4の所定倍以上である場合に、前記背景候補領域が背景であると判定することを特徴とする付記4記載の画像処理プログラム。
(付記6)
画像に含まれる被写体領域の外側背景を特定し、前記外側背景の色と類似し且つ所定のサイズ以上の領域である背景候補領域を特定し、前記背景候補領域と前記被写体領域とのの第1の境界線と、前記外側背景と前記被写体領域との第2の境界線との距離に基づいて、前記被写体領域が所定形状であるか否か判定し、前記被写体領域が前記所定形状である場合、前記背景候補領域を背景領域に設定する処理部
を備える画像処理装置。
(付記7)
前記処理部は、
前記背景候補領域の前記第1の境界線上に複数の第1の輪郭点を配置し、前記外側背景の前記第2の境界線上に複数の第2の輪郭点を配置し、
前記複数の第1の輪郭点のそれぞれにおいて、前記背景候補領域を通らずに最短の直線で結べる前記複数の第2の輪郭点との最短距離を算出し、
算出した前記複数の第1の輪郭点のそれぞれの前記複数の第2の輪郭点との前記最短距離の分布に基づいて、前記複数の第1の輪郭点から有効な複数の第1の輪郭点を選出し、前記有効な複数の第1の輪郭点のそれぞれと前記背景候補領域を通らずに最短の直線で結べる前記複数の第2の輪郭点のうちの有効な複数の第2の輪郭点を選出し、
前記有効な複数の第1の輪郭点と前記有効な複数の第2の輪郭点との距離の平均 、前記背景候補領域の前記第1の境界線上の前記有効な複数の第1の輪郭点が存在する区間の一方の端から他方の端までの第1の距離、および前記外側背景の前記第2の境界線上の前記有効な複数の第2の輪郭点が存在する区間の一方の端から他方の端までの第2の距離を算出し、
前記平均、前記第1の距離、および前記第2の距離に基づいて、前記背景候補領域が背景であるか否か判定することを特徴とする付記6記載の画像処理装置。
(付記8)
前記処理部は、前記第1の距離が前記平均の第1の所定値倍以上であり、且つ前記第2の距離が前記第1の距離の第2の所定値倍以上且つ第3の所定値倍以内である場合、前記背景候補領域が背景であると判定することを特徴とする付記7記載の画像処理装置。
(付記9)
前記処理部は、
前記画像におけるエッジを示すエッジ画素を検出し、前記エッジ画素の勾配方向に基づいて連接する複数の前記エッジ画素を1グループとして複数のエッジグループを生成し、
前記背景候補領域の前記第1の境界線の複数の輪郭画素のそれぞれにおいて、最も距離が近い前記エッジ画素が属するエッジグループを特定し、
前記複数のエッジグループのうち、特定されたエッジグループの回数の多い順に、特定された回数が一番多いエッジグループから所定番目のエッジグループまでの特定された回数の合計を算出し、
前記合計に基づいて、前記背景候補領域が背景であるか否か判定する、
ことを特徴とする付記7または8記載の画像処理装置。
(付記10)
前記処理部は、前記合計が前記背景候補領域の前記第1の境界線の前記複数の輪郭画素の数の第4の所定倍以上である場合に、前記背景候補領域が背景であると判定することを特徴とする付記9記載の画像処理装置。
(付記11)
画像処理装置が実行する画像処理方法であって、
画像に含まれる被写体領域の外側背景を特定し、
前記外側背景の色と類似し且つ所定のサイズ以上の領域である背景候補領域を特定し、
前記背景候補領域と前記被写体領域との第1の境界線と、前記外側背景と前記被写体領域との第2の境界線との距離に基づいて、前記被写体領域が所定形状であるか否か判定し、
前記被写体領域が前記所定形状である場合に、前記背景候補領域を背景領域に設定する
処理を備える画像処理方法。
(付記12)
前記被写体領域が所定形状であるか否か判定する処理は、
前記背景候補領域の前記第1の境界線上に複数の第1の輪郭点を配置し、前記外側背景の前記第2の境界線上に複数の第2の輪郭点を配置し、
前記複数の第1の輪郭点のそれぞれにおいて、前記背景候補領域を通らずに最短の直線で結べる前記複数の第2の輪郭点との最短距離を算出し、
算出した前記複数の第1の輪郭点のそれぞれの前記複数の第2の輪郭点との前記最短距離の分布に基づいて、前記複数の第1の輪郭点から有効な複数の第1の輪郭点を選出し、前記有効な複数の第1の輪郭点のそれぞれと前記背景候補領域を通らずに最短の直線で結べる前記複数の第2の輪郭点のうちの有効な複数の第2の輪郭点を選出し、
前記有効な複数の第1の輪郭点と前記有効な複数の第2の輪郭点との距離の平均、前記背景候補領域の前記第1の境界線上の前記有効な複数の第1の輪郭点が存在する区間の一方の端から他方の端までの第1の距離、および前記外側背景の前記第2の境界線上の前記有効な複数の第2の輪郭点が存在する区間の一方の端から他方の端までの第2の距離を算出し、
前記平均、前記第1の距離、および前記第2の距離に基づいて、前記背景候補領域が背景であるか否か判定することを特徴とする付記11記載の画像処理方法。
(付記13)
前記前記背景候補領域が背景であるか否か判定する処理は、前記第1の距離が前記平均の第1の所定値倍以上であり、且つ前記第2の距離が前記第1の距離の第2の所定値倍以上且つ第3の所定値倍以内である場合、前記背景候補領域が背景であると判定することを特徴とする付記12記載の画像処理方法。
(付記14)
前記画像におけるエッジを示すエッジ画素を検出し、前記エッジ画素の勾配方向に基づいて連接する複数の前記エッジ画素を1グループとして複数のエッジグループを生成し、
前記背景候補領域の前記第1の境界線の複数の輪郭画素のそれぞれにおいて、最も距離が近い前記エッジ画素が属するエッジグループを特定し、
前記複数のエッジグループのうち、特定されたエッジグループの回数の多い順に、特定された回数が一番多いエッジグループから所定番目のエッジグループまでの特定された回数の合計を算出し、
前記合計に基づいて、前記背景候補領域が背景であるか否か判定する、
処理をさらに備えることを特徴とする付記12または13記載の画像処理方法。
(付記15)
前記合計に基づいて、前記背景候補領域が背景であるか否か判定する処理は、前記合計が前記背景候補領域の前記第1の境界線の前記複数の輪郭画素の数の第4の所定倍以上である場合に、前記背景候補領域が背景であると判定することを特徴とする付記14記載の画像処理方法。
Regarding the above embodiment, the following supplementary notes are further disclosed.
(Appendix 1)
Identify the background outside the subject area in the image,
Identify a background candidate area that is similar to the color of the outer background and is equal to or larger than a predetermined size,
It is determined whether or not the subject area has a predetermined shape based on a distance between a first boundary between the background candidate area and the subject area and a second boundary between the outer background and the subject area. And
An image processing program for causing a computer to execute a process of setting the background candidate region as a background region when the subject region has the predetermined shape.
(Appendix 2)
The process of determining whether the subject area has a predetermined shape includes:
Arranging a plurality of first contour points on the first boundary line of the background candidate area, arranging a plurality of second outline points on the second boundary line of the outer background,
In each of the plurality of first contour points, a shortest distance between the plurality of second contour points that can be connected by a shortest straight line without passing through the background candidate area is calculated;
A plurality of first contour points effective from the plurality of first contour points based on the calculated distribution of the shortest distance between each of the plurality of first contour points and each of the plurality of second contour points. And a plurality of valid second contour points among the plurality of valid second contour points that can be connected to each of the valid plurality of first contour points by a shortest straight line without passing through the background candidate area. And select
The average of the distances between the valid plurality of first contour points and the valid plurality of second contour points, wherein the valid plurality of first contour points on the first boundary line of the background candidate area are A first distance from one end to the other end of the existing section, and one end to the other of the section in which the valid plurality of second contour points on the second boundary line of the outer background exist. Calculate a second distance to the end of
The image processing program according to claim 1, wherein whether or not the background candidate area is a background is determined based on the average, the first distance, and the second distance.
(Appendix 3)
The process of determining whether the background candidate region is a background includes the step of determining that the first distance is equal to or more than a first predetermined value of the average and the second distance is a second of the first distance. 3. The image processing program according to claim 2, wherein the background candidate area is determined to be a background when the predetermined value is equal to or more than a predetermined value and is equal to or less than a third predetermined value.
(Appendix 4)
Detecting an edge pixel indicating an edge in the image, generating a plurality of edge groups as a group of the plurality of edge pixels connected based on the gradient direction of the edge pixel,
In each of the plurality of outline pixels of the first boundary line of the background candidate region, an edge group to which the edge pixel closest to the distance belongs is specified,
Among the plurality of edge groups, in the order of the number of identified edge groups, the total number of identified times from the edge group with the most identified times to the predetermined edge group is calculated,
Based on the total, determine whether the background candidate area is a background,
4. The image processing program according to claim 2 or 3, further causing the computer to execute processing.
(Appendix 5)
The process of determining whether the background candidate area is the background based on the sum includes the step of determining that the sum is a fourth predetermined multiple of the number of the plurality of contour pixels of the first boundary line of the background candidate area. The image processing program according to claim 4, wherein in the above case, the background candidate area is determined to be a background.
(Appendix 6)
An outer background of the subject area included in the image is specified, a background candidate area similar to the color of the outer background and equal to or larger than a predetermined size is specified, and a first candidate between the background candidate area and the subject area is identified. It is determined whether or not the subject area has a predetermined shape, based on a distance between the boundary line of and the second boundary line between the outside background and the subject area. If the subject area has the predetermined shape, An image processing apparatus comprising: a processing unit that sets the background candidate area as a background area.
(Appendix 7)
The processing unit includes:
Arranging a plurality of first contour points on the first boundary line of the background candidate area, arranging a plurality of second outline points on the second boundary line of the outer background,
In each of the plurality of first contour points, a shortest distance between the plurality of second contour points that can be connected by a shortest straight line without passing through the background candidate area is calculated;
A plurality of first contour points effective from the plurality of first contour points based on the calculated distribution of the shortest distance between each of the plurality of first contour points and each of the plurality of second contour points. And a plurality of valid second contour points among the plurality of valid second contour points that can be connected to each of the valid plurality of first contour points by a shortest straight line without passing through the background candidate area. And select
The average of the distances between the valid plurality of first contour points and the valid plurality of second contour points, wherein the valid plurality of first contour points on the first boundary line of the background candidate area are A first distance from one end to the other end of the existing section, and one end to the other of the effective plural second contour points on the second boundary line of the outer background. Calculate a second distance to the end of
7. The image processing apparatus according to claim 6, wherein it is determined whether the background candidate area is a background based on the average, the first distance, and the second distance.
(Appendix 8)
The processing unit may be configured such that the first distance is equal to or more than a first predetermined value of the average, and the second distance is equal to or more than a second predetermined value of the first distance and a third predetermined value. 8. The image processing apparatus according to claim 7, wherein the background candidate area is determined to be a background if the number is less than twice.
(Appendix 9)
The processing unit includes:
Detecting an edge pixel indicating an edge in the image, generating a plurality of edge groups as a group of the plurality of edge pixels connected based on the gradient direction of the edge pixel,
In each of the plurality of outline pixels of the first boundary line of the background candidate region, an edge group to which the edge pixel closest to the distance belongs is specified,
Among the plurality of edge groups, in the order of the number of identified edge groups, the total number of identified times from the edge group with the most identified times to the predetermined edge group is calculated,
Based on the total, determine whether the background candidate area is a background,
9. The image processing apparatus according to claim 7 or 8, wherein
(Appendix 10)
The processing unit determines that the background candidate region is a background when the sum is equal to or greater than a fourth predetermined multiple of the number of the plurality of contour pixels of the first boundary line of the background candidate region. The image processing apparatus according to claim 9, wherein
(Appendix 11)
An image processing method executed by the image processing device,
Identify the background outside the subject area in the image,
Identify a background candidate area that is similar to the color of the outer background and is equal to or larger than a predetermined size,
It is determined whether or not the subject area has a predetermined shape based on a distance between a first boundary between the background candidate area and the subject area and a second boundary between the outer background and the subject area. And
An image processing method comprising: setting the background candidate area as a background area when the subject area has the predetermined shape.
(Appendix 12)
The process of determining whether the subject area has a predetermined shape includes:
Arranging a plurality of first contour points on the first boundary line of the background candidate area, arranging a plurality of second outline points on the second boundary line of the outer background,
In each of the plurality of first contour points, a shortest distance between the plurality of second contour points that can be connected by a shortest straight line without passing through the background candidate area is calculated;
A plurality of first contour points effective from the plurality of first contour points based on the calculated distribution of the shortest distance between each of the plurality of first contour points and each of the plurality of second contour points. And a plurality of valid second contour points among the plurality of valid second contour points that can be connected to each of the valid plurality of first contour points by a shortest straight line without passing through the background candidate area. And select
The average of the distances between the valid plurality of first contour points and the valid plurality of second contour points, and the valid plural first contour points on the first boundary line of the background candidate area are A first distance from one end to the other end of the existing section, and one end to the other of the effective plural second contour points on the second boundary line of the outer background. Calculate a second distance to the end of
12. The image processing method according to claim 11, wherein it is determined whether the background candidate area is a background based on the average, the first distance, and the second distance.
(Appendix 13)
The process of determining whether the background candidate region is a background includes the step of determining that the first distance is equal to or more than a first predetermined value of the average and the second distance is equal to or larger than the first distance. 13. The image processing method according to claim 12, wherein the background candidate area is determined to be a background when the value is equal to or more than a predetermined value of 2 and within a third predetermined value.
(Appendix 14)
Detecting an edge pixel indicating an edge in the image, and generating a plurality of edge groups as a plurality of the edge pixels connected based on the gradient direction of the edge pixel;
In each of the plurality of outline pixels of the first boundary line of the background candidate region, an edge group to which the edge pixel closest to the distance belongs is specified;
Among the plurality of edge groups, in the order of the number of times of the specified edge group, the total of the number of times of the specified number of times from the edge group having the highest number of times to the predetermined edge group is calculated,
Based on the total, determine whether the background candidate area is a background,
14. The image processing method according to Supplementary Note 12 or 13, further comprising a process.
(Appendix 15)
The process of determining whether the background candidate area is a background based on the sum includes the step of determining that the sum is a fourth predetermined multiple of the number of the plurality of contour pixels of the first boundary line of the background candidate area. 15. The image processing method according to claim 14, wherein in the case described above, the background candidate area is determined to be a background.

100 画像処理装置
110 処理部
111 入力部
112 抽出部
113 出力部
120 記憶部
Reference Signs List 100 image processing device 110 processing unit 111 input unit 112 extraction unit 113 output unit 120 storage unit

Claims (7)

画像に含まれる被写体領域の外側背景を特定し、
前記外側背景の色と類似し且つ所定のサイズ以上の領域である背景候補領域を特定し、
前記背景候補領域と前記被写体領域との第1の境界線と、前記外側背景と前記被写体領域との第2の境界線との距離に基づいて、前記被写体領域が所定形状であるか否か判定し、
前記被写体領域が前記所定形状である場合、前記背景候補領域を背景領域に設定する
処理をコンピュータに実行させる画像処理プログラム。
Identify the background outside the subject area in the image,
Identify a background candidate area that is similar to the color of the outer background and is equal to or larger than a predetermined size,
It is determined whether or not the subject area has a predetermined shape based on a distance between a first boundary between the background candidate area and the subject area and a second boundary between the outer background and the subject area. And
An image processing program for causing a computer to execute a process of setting the background candidate region as a background region when the subject region has the predetermined shape.
前記被写体領域が所定形状であるか否か判定する処理は、
前記背景候補領域の前記第1の境界線上に複数の第1の輪郭点を配置し、前記外側背景の前記第2の境界線上に複数の第2の輪郭点を配置し、
前記複数の第1の輪郭点のそれぞれにおいて、前記背景候補領域を通らずに最短の直線で結べる前記複数の第2の輪郭点との最短距離を算出し、
算出した前記複数の第1の輪郭点のそれぞれの前記複数の第2の輪郭点との前記最短距離の分布に基づいて、前記複数の第1の輪郭点から有効な複数の第1の輪郭点を選出し、前記有効な複数の第1の輪郭点のそれぞれと前記背景候補領域を通らずに最短の直線で結べる前記複数の第2の輪郭点のうちの有効な複数の第2の輪郭点を選出し、
前記有効な複数の第1の輪郭点と前記有効な複数の第2の輪郭点との距離の平均、前記背景候補領域の前記第1の境界線上の前記有効な複数の第1の輪郭点が存在する区間の一方の端から他方の端までの第1の距離、および前記外側背景の前記第2の境界線上の前記有効な複数の第2の輪郭点が存在する区間の一方の端から他方の端までの第2の距離を算出し、
前記平均、前記第1の距離、および前記第2の距離に基づいて、前記背景候補領域が背景であるか否か判定することを特徴とする請求項1記載の画像処理プログラム。
The process of determining whether the subject area has a predetermined shape includes:
Arranging a plurality of first contour points on the first boundary line of the background candidate area, arranging a plurality of second outline points on the second boundary line of the outer background,
In each of the plurality of first contour points, a shortest distance between the plurality of second contour points that can be connected by a shortest straight line without passing through the background candidate area is calculated;
A plurality of first contour points effective from the plurality of first contour points based on the calculated distribution of the shortest distance between each of the plurality of first contour points and each of the plurality of second contour points. And a plurality of valid second contour points among the plurality of valid second contour points that can be connected to each of the valid plurality of first contour points by a shortest straight line without passing through the background candidate area. And select
The average of the distances between the valid plurality of first contour points and the valid plurality of second contour points, and the valid plural first contour points on the first boundary line of the background candidate area are A first distance from one end to the other end of the existing section, and one end to the other of the effective plural second contour points on the second boundary line of the outer background. Calculate a second distance to the end of
The computer-readable storage medium according to claim 1, wherein it is determined whether the background candidate area is a background based on the average, the first distance, and the second distance.
前記背景候補領域が背景であるか否かの判定では、前記第1の距離が前記平均の第1の所定値倍以上であり、且つ前記第2の距離が前記第1の距離の第2の所定値倍以上且つ第3の所定値倍以内である場合、前記背景候補領域が背景であると判定することを特徴とする請求項2記載の画像処理プログラム。 In the determination as to whether the background candidate region is a background, the first distance is equal to or more than a first predetermined value times the average, and the second distance is a second of the first distance. 3. The image processing program according to claim 2, wherein the background candidate area is determined to be a background when the value is equal to or more than a predetermined value and equal to or less than a third predetermined value. 前記画像におけるエッジを示すエッジ画素を検出し、前記エッジ画素の勾配方向に基づいて連接する複数の前記エッジ画素を1グループとして複数のエッジグループを生成し、
前記背景候補領域の前記第1の境界線の複数の輪郭画素のそれぞれにおいて、最も距離が近い前記エッジ画素が属するエッジグループを特定し、
前記複数のエッジグループのうち、特定されたエッジグループの回数の多い順に、特定された回数が一番多いエッジグループから所定番目のエッジグループまでの特定された回数の合計を算出し、
前記合計に基づいて、前記背景候補領域が背景であるか否か判定する、
処理をさらに前記コンピュータに実行させることを特徴とする請求項2または3記載の画像処理プログラム。
Detecting an edge pixel indicating an edge in the image, generating a plurality of edge groups as a group of the plurality of edge pixels connected based on the gradient direction of the edge pixel,
In each of the plurality of outline pixels of the first boundary line of the background candidate region, an edge group to which the edge pixel closest to the distance belongs is specified,
Among the plurality of edge groups, in the order of the number of identified edge groups, the total number of identified times from the edge group with the most identified times to the predetermined edge group is calculated,
Based on the total, determine whether the background candidate area is a background,
4. The image processing program according to claim 2, further comprising causing the computer to execute a process.
前記合計に基づいて、前記背景候補領域が背景であるか否か判定する処理は、前記合計が前記背景候補領域の前記第1の境界線の前記複数の輪郭画素の数の第4の所定倍以上である場合に、前記背景候補領域が背景であると判定することを特徴とする請求項4記載の画像処理プログラム。   The process of determining whether the background candidate area is a background based on the sum includes the step of determining that the sum is a fourth predetermined multiple of the number of the plurality of contour pixels of the first boundary line of the background candidate area. 5. The image processing program according to claim 4, wherein in the above case, the background candidate area is determined to be a background. 画像に含まれる被写体領域の外側背景を特定し、前記外側背景の色と類似し且つ所定のサイズ以上の領域である背景候補領域を特定し、前記背景候補領域と前記被写体領域との第1の境界線と、前記外側背景と前記被写体領域との第2の境界線との距離に基づいて、前記被写体領域が所定形状であるか否か判定し、前記被写体領域が前記所定形状である場合、前記背景候補領域を背景領域に設定する処理部
を備える画像処理装置。
An outer background of the subject area included in the image is specified, a background candidate area similar to the color of the outer background and equal to or larger than a predetermined size is specified, and a first candidate between the background candidate area and the subject area is identified . A boundary line , based on a distance between a second boundary line between the outer background and the subject region, determines whether the subject region has a predetermined shape, and when the subject region has the predetermined shape, An image processing apparatus comprising: a processing unit configured to set the background candidate area as a background area.
画像処理装置が実行する画像処理方法であって、
画像に含まれる被写体領域の外側背景を特定し、
前記外側背景の色と類似し且つ所定のサイズ以上の領域である背景候補領域を特定し、
前記背景候補領域と前記被写体領域との第1の境界線と、前記外側背景と前記被写体領域との第2の境界線との距離に基づいて、前記被写体領域が所定形状であるか否か判定し、
前記被写体領域が前記所定形状である場合に、前記背景候補領域を背景領域に設定する
処理を備える画像処理方法。
An image processing method executed by the image processing device,
Identify the background outside the subject area in the image,
Identify a background candidate area that is similar to the color of the outer background and is equal to or larger than a predetermined size,
It is determined whether or not the subject area has a predetermined shape based on a distance between a first boundary between the background candidate area and the subject area and a second boundary between the outer background and the subject area. And
An image processing method comprising: setting the background candidate area as a background area when the subject area has the predetermined shape.
JP2016005514A 2016-01-14 2016-01-14 Image processing program, image processing apparatus, and image processing method Active JP6662052B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016005514A JP6662052B2 (en) 2016-01-14 2016-01-14 Image processing program, image processing apparatus, and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016005514A JP6662052B2 (en) 2016-01-14 2016-01-14 Image processing program, image processing apparatus, and image processing method

Publications (2)

Publication Number Publication Date
JP2017126221A JP2017126221A (en) 2017-07-20
JP6662052B2 true JP6662052B2 (en) 2020-03-11

Family

ID=59365000

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016005514A Active JP6662052B2 (en) 2016-01-14 2016-01-14 Image processing program, image processing apparatus, and image processing method

Country Status (1)

Country Link
JP (1) JP6662052B2 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08138051A (en) * 1994-11-15 1996-05-31 Hiroshi Kuyama Analyzing method for shape characteristic of graphic or the like
JPH11194014A (en) * 1998-01-05 1999-07-21 Kubota Corp Measuring device for fruits and vegetables
JP3902887B2 (en) * 1999-06-04 2007-04-11 松下電器産業株式会社 Lip extraction method
US6674883B1 (en) * 2000-08-14 2004-01-06 Siemens Corporate Research, Inc. System and method for the detection of anatomic landmarks for total hip replacement
TWI270824B (en) * 2005-05-02 2007-01-11 Pixart Imaging Inc Method for dynamically recognizing objects in an image based on diversities of object characteristics and system for using the same

Also Published As

Publication number Publication date
JP2017126221A (en) 2017-07-20

Similar Documents

Publication Publication Date Title
JP5274495B2 (en) How to change the document image size
CN107093172B (en) Character detection method and system
JP3950777B2 (en) Image processing method, image processing apparatus, and image processing program
JP5298831B2 (en) Image processing apparatus and program
KR20080006112A (en) Halftoning method and apparatus to improve sharpness in boundary region
JP2018206252A (en) Image processing system, evaluation model construction method, image processing method, and program
CN111738252A (en) Method and device for detecting text lines in image and computer system
US9141854B2 (en) Method and apparatus for generating structure of table included in image
CN108804978B (en) Layout analysis method and device
JP2010074342A (en) Image processing apparatus, image forming apparatus, and program
JP6662052B2 (en) Image processing program, image processing apparatus, and image processing method
JP2017094543A (en) Image processing device, image processing method and program
JP6613625B2 (en) Image processing program, image processing apparatus, and image processing method
JP2002175532A (en) Image processor, method for image processing and storage medium with image processing program recorded thereon
CN111563181A (en) Digital image file query method and device and readable storage medium
JP5233739B2 (en) Image processing apparatus, image reading apparatus, and image forming apparatus
JP4870721B2 (en) Image feature extraction apparatus, image feature extraction method, program, and recording medium
JP6111796B2 (en) Image processing apparatus and computer program
US20120194883A1 (en) Character detection apparatus, character detection method, and computer-readable storage medium
JP5648340B2 (en) Image processing apparatus and program
JP2003271973A (en) Method and program for image processing
JP2006277150A (en) Image separation device, image separation method, and program
JP2014176010A (en) Image processing apparatus, method, and program
JP2019195117A (en) Information processing apparatus, information processing method, and program
JP5560780B2 (en) Image processing apparatus and image processing program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180912

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190723

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190730

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190823

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20190823

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20190823

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200127

R150 Certificate of patent or registration of utility model

Ref document number: 6662052

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150