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

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

Info

Publication number
JP5811416B2
JP5811416B2 JP2013211726A JP2013211726A JP5811416B2 JP 5811416 B2 JP5811416 B2 JP 5811416B2 JP 2013211726 A JP2013211726 A JP 2013211726A JP 2013211726 A JP2013211726 A JP 2013211726A JP 5811416 B2 JP5811416 B2 JP 5811416B2
Authority
JP
Japan
Prior art keywords
pixel
background
image
foreground
pixels
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2013211726A
Other languages
Japanese (ja)
Other versions
JP2015075920A (en
JP2015075920A5 (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.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co 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 Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP2013211726A priority Critical patent/JP5811416B2/en
Priority to CN201410667836.7A priority patent/CN104580883B/en
Priority to US14/509,779 priority patent/US9679386B2/en
Publication of JP2015075920A publication Critical patent/JP2015075920A/en
Publication of JP2015075920A5 publication Critical patent/JP2015075920A5/ja
Application granted granted Critical
Publication of JP5811416B2 publication Critical patent/JP5811416B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/162Segmentation; Edge detection involving graph-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)

Description

本発明は、所定の画像分割処理を実行する画像処理装置、画像処理方法及びプログラムに関する。   The present invention relates to an image processing apparatus, an image processing method, and a program that execute predetermined image division processing.

一般に、画像内からユーザの所望する領域(例えば、被写体領域)を抽出する場合に、例えば、紙などに手描きで描いた絵を撮影した画像からその絵の部分を抽出する場合に、大津の二値化(非特許文献1参照)などで領域を区画する技術が知られているが、画像の全体の輝度のバラつき、明るさのむら、反射などにより、領域を適切に区画することができない場合があった。また、領域を抽出する技術として、画像セグメンテーションと呼ばれる技術としては、Grab Cut(非特許文献2参照)などの種々のセグメンテーション処理の方法があるが、抽出したい領域を指定することを前提としているために、領域を正確に指定することが困難となり、その指定の仕方がセグメンテーション処理にも悪影響を及ぼしてしまう。   In general, when an area desired by a user (for example, a subject area) is extracted from an image, for example, when a part of a picture is extracted from an image of a hand-drawn picture on paper or the like, Otsu There is known a technique for partitioning an area by value conversion (see Non-Patent Document 1) or the like. However, there may be a case where the area cannot be partitioned appropriately due to variations in brightness of the entire image, uneven brightness, reflection, and the like. there were. In addition, as a technique for extracting an area, a technique called image segmentation includes various segmentation processing methods such as Grab Cut (see Non-Patent Document 2). However, it is assumed that an area to be extracted is designated. In addition, it is difficult to specify the region accurately, and the method of specifying the region also adversely affects the segmentation process.

大津展之氏の論文、判別および最小2乗基準に基づく自動しきい値選定法」、電子通信学会論文誌、Vol.J63−D、No.4、pp.349−356(1980)Noriyuki Otsu's paper, Automatic threshold selection method based on discrimination and least squares criterion ", IEICE Transactions, Vol. J63-D, no. 4, pp. 349-356 (1980) C. Rother, V. Kolmogorov, and A. Blake, GrabCut: Interactiveforeground extraction using iterated graph cuts, ACM Trans. Graph., vol. 23,pp. 309−314, 2004C. Rother, V. Kolmogorov, and A. Blake, GrabCut: Interactiveforeground extraction using iterated graph cuts, ACM Trans.Graph., Vol. 23, pp. 309-314, 2004

そこで、従来では、表示中の画像上で抽出対象の領域(被写体)内の一点がタップ(ユーザ指定)されると、そのタップ位置に対応する座標点を含む所定の形状(例えば、円形)の領域をその画像内に形成すると共に、この形成した領域を前景の初期領域としてグラフカット(Grab Cut)などのプログラムを利用してセグメンテーション処理を行うことにより画像内を背景画素と前景画素に分割して前景部分を抽出する処理を行うようにした技術が知られている(特許文献1参照)。   Therefore, conventionally, when a point in the extraction target area (subject) is tapped (specified by the user) on the image being displayed, it has a predetermined shape (for example, a circle) including the coordinate point corresponding to the tap position. An area is formed in the image, and the formed area is divided into background pixels and foreground pixels by performing segmentation processing using a program such as a graph cut (Grab Cut) as an initial foreground area. For example, a technique for performing a process of extracting a foreground portion is known (see Patent Document 1).

特開2013−29930号公報JP 2013-29930 A

しかしながら、上述した特許文献の技術にあっては、抽出対象の一点をタップ指定するだけで、セグメンテーション処理が実行可能となるためにユーザの負担を大幅に軽減することが可能となるが、例えば、抽出対象が複雑な形状であれば、その抽出対象の全体を所定の形状(例えば、円形)の領域内に収めることができない場合があり、画像内を背景画素と前景画素に分割する処理に悪影響を及ぼしてしまうおそれがあった。   However, in the technique of the above-described patent document, it is possible to significantly reduce the burden on the user because the segmentation process can be executed by simply specifying one point of the extraction target. If the extraction target is a complicated shape, it may not be possible to fit the entire extraction target within an area of a predetermined shape (for example, a circle), which adversely affects the process of dividing the image into background and foreground pixels. There was a risk of affecting.

本発明の課題は、ユーザによる領域指定のための補助操作を必要とせずに、画像内からその一部の領域を精度良く切り抜くことができるようにすることである。   An object of the present invention is to make it possible to accurately cut out a part of an area from an image without requiring an auxiliary operation for specifying the area by a user.

上述した課題を解決するために本発明の画像処理装置は、
前景と背景とに分割すべき対象画像における一部の背景画素の画素値を特定する画素値特定手段と、
前記一部の背景画素の画素値に対応する画素値を有する前記対象画像内の画素を一部の背景画素として特定する第1特定手段と、
前記対象画像内の各画素の画素値および前記一部の背景画素の位置情報を用いて、前記対象画像内の他の背景画素および前景画素を特定する第2特定手段と、
前記第2特定手段により背景画素と前景画素が特定された結果、前景画素の領域に囲まれるように背景画素の領域が存在する場合には、前景画素の領域における最も外側の輪郭に沿った領域を前記対象画像内の切り抜き領域として設定する切り抜き領域設定手段と、
を備えたことを特徴とする。
In order to solve the above-described problems, the image processing apparatus of the present invention provides:
Pixel value specifying means for specifying pixel values of some background pixels in the target image to be divided into foreground and background;
First specifying means for specifying pixels in the target image having pixel values corresponding to pixel values of the some background pixels as some background pixels;
Second specifying means for specifying other background pixels and foreground pixels in the target image using pixel values of each pixel in the target image and position information of the part of the background pixels;
As a result of specifying the background pixel and the foreground pixel by the second specifying means, if a background pixel area exists so as to be surrounded by the foreground pixel area, the area along the outermost contour in the foreground pixel area Cutting area setting means for setting as a cutting area in the target image;
It is provided with.

本発明によれば、ユーザによる領域指定のための補助操作を必要とせずに、画像内からその一部の領域を精度良く切り抜くことができる。   According to the present invention, it is possible to accurately cut out a part of an area from an image without requiring an auxiliary operation for specifying the area by the user.

画像処理装置として適用したタブレット端末装置の基本的な構成要素を示したブロック図。The block diagram which showed the basic component of the tablet terminal device applied as an image processing apparatus. (1)は、画像メモリ3cから処理対象として読み出した画像データ(元画像)を例示した図、(2)は、元画像を複数の領域(16個の領域)に区画した状態を示した図。(1) is a diagram illustrating image data (original image) read out as a processing target from the image memory 3c, and (2) is a diagram illustrating a state in which the original image is partitioned into a plurality of regions (16 regions). . 白色の紙に手描きで描いた絵を撮影した画像の中からその絵を切り抜くための処理を示したフローチャート。The flowchart which showed the process for cutting out the picture out of the image which image | photographed the picture drawn by hand drawing on white paper. 図3の動作に続くフローチャート。The flowchart following the operation | movement of FIG. (1)、(2)は、輝度値ヒストグラムをそれぞれ例示した図。(1), (2) is the figure which illustrated the luminance value histogram, respectively. (1)、(2)は、図5とは異なる輝度値ヒストグラムをそれぞれ例示した図。(1), (2) is the figure which illustrated the luminance value histogram different from FIG. 5, respectively. 輝度値をグループに分け、各グループに所属する輝度値の数をカウントした一覧表を示した図。The figure which showed the list which divided the luminance value into the group and counted the number of the luminance values which belong to each group. (1)は、輝度分布のピーク付近の輝度値を背景画素として指定する処理を実行した後の画像イメージを例示した図、(2)は、画像分割処理によって得られた切り抜きマスク(抜型)画像を示した図。(1) is a diagram exemplifying an image image after executing a process of designating a luminance value near the peak of the luminance distribution as a background pixel, and (2) is a cut-out mask (cut-out) image obtained by the image dividing process. FIG. (1)、(2)は、一番外側の領域(輪郭)を特定する仕方を説明するための図。(1), (2) is a figure for demonstrating how to specify the outermost area | region (contour). (1)は、一番外側の領域(輪郭)のみを切り抜きマスク画像として採用した場合を例示した図、(2)は、その切り抜きマスク画像によって切り抜かれた画像を示した図。(1) is a diagram illustrating a case where only the outermost region (contour) is adopted as a cutout mask image, and (2) is a diagram illustrating an image cut out by the cutout mask image.

以下、図1〜図10を参照して本発明の実施形態を説明する。
本実施形態は、画像処理装置としてタブレット端末装置に適用した場合を例示したもので、図1は、このタブレット端末装置の基本的な構成要素を示したブロック図である。
タブレット端末装置は、その筐体全体が、例えば、A5サイズの携帯型情報端末装置であり、タッチ入力機能、無線通信機能、インターネット接続機能などを備えている。このタブレット端末装置の中核となる制御部1は、電源部(二次電池)2からの電力供給によって動作し、記憶部3内の各種のプログラムに応じてこのタブレット端末装置の全体動作を制御する中央演算処理装置やメモリなどを有している。
Hereinafter, embodiments of the present invention will be described with reference to FIGS.
This embodiment illustrates a case where the present invention is applied to a tablet terminal device as an image processing device, and FIG. 1 is a block diagram showing basic components of the tablet terminal device.
The entire case of the tablet terminal device is, for example, a portable information terminal device of A5 size, and includes a touch input function, a wireless communication function, an Internet connection function, and the like. The control unit 1 which is the core of the tablet terminal device operates by supplying power from the power source unit (secondary battery) 2 and controls the overall operation of the tablet terminal device according to various programs in the storage unit 3. It has a central processing unit and memory.

記憶部3は、例えば、ROM、フラッシュメモリなどを有する構成で、図3及び図4に示した動作手順に応じて本実施形態を実現するためのプログラムを記憶するプログラムメモリ3aと、このタブレット端末装置で必要とされる各種のデータやフラグなどを一時記憶するワークメモリ3bと、カメラ撮影された動画などの各種の画像データを記憶する画像メモリ3cを有している。なお、記憶部3は、例えば、SDカード、ICカードなど、着脱自在な可搬型メモリ(記録メディア)を含む構成であってもよく、図示しないが、通信機能を介してネットワークに接続されている状態においては所定のサーバ装置側の記憶領域を含むものであってもよい。画像メモリ3cは、内蔵メモリに限らず、SDカードなどの着脱自在な可搬型メモリであってもよく、例えば、インターネットを介して受信取得した画像データを記憶したり、カメラ装置(図示省略)で撮影された画像データを記憶したりする。   The storage unit 3 includes, for example, a ROM, a flash memory, etc., and a program memory 3a that stores a program for realizing the present embodiment in accordance with the operation procedure shown in FIGS. 3 and 4, and this tablet terminal It has a work memory 3b that temporarily stores various data and flags required by the apparatus, and an image memory 3c that stores various image data such as moving images taken by the camera. The storage unit 3 may include a removable portable memory (recording medium) such as an SD card or an IC card, and is connected to a network via a communication function (not shown). The state may include a storage area on a predetermined server device side. The image memory 3c is not limited to the built-in memory, and may be a removable portable memory such as an SD card. For example, the image memory 3c stores image data received and acquired via the Internet, or a camera device (not shown). For example, the photographed image data is stored.

操作部4は、押しボタン式のキーとして、図示省略したが、電源をオン/オフさせる電源キー、処理対象の動画を選択する選択キーなどを備えている。無線LAN(Local Area Network)通信部5は、高速大容量の通信が可能な無線通信モジュールで、最寄りの無線LANルータ(図示省略)を介してインターネットなどに接続可能となっている。タッチ表示部6は、表示パネル6aにタッチパネル6bを積層配設した構成で、ソフトウェアキー(ソフトキー)としての機能名を表示したり、各種のアイコンなどを表示したり、画像データを表示したりする。このタッチ表示部6のタッチパネル6bは、指など(ペンなどの操作子を含む)でタッチ操作された位置を検知してその座標データを入力するタッチスクリーンを構成するもので、例えば、静電容量方式あるいは抵抗皮膜方式を採用するようにしているが、光センサ方式など、その他の方式であってもよい。   Although not shown in the figure, the operation unit 4 includes a power key for turning on / off the power, a selection key for selecting a moving image to be processed, and the like as push-button keys. A wireless LAN (Local Area Network) communication unit 5 is a wireless communication module capable of high-speed and large-capacity communication, and can be connected to the Internet or the like via a nearby wireless LAN router (not shown). The touch display unit 6 has a configuration in which a touch panel 6b is stacked on a display panel 6a, displays function names as software keys (soft keys), displays various icons, and displays image data. To do. The touch panel 6b of the touch display unit 6 constitutes a touch screen that detects a position touched with a finger or the like (including an operator such as a pen) and inputs coordinate data thereof. The method or the resistance film method is adopted, but other methods such as an optical sensor method may be used.

図2(1)は、画像メモリ3cの中から処理対象として読み出した画像データ(元画像)を例示した図である。
図示の元画像は、例えば、白紙やホワイトボードの略中央部に黒インクのペンなどを使用して手描きで描いた絵(黒線で描いた鬼の顔)Pを撮影した画像(グレイスケール画像)を示したもので、撮影時に反射などの影響を受けてその画像全体に輝度のバラつき、明るさのむらが起き、更に画像の右側中央部に天井の蛍光灯が写り込んでしまい、画像の下半分が暗く、上半分が明るくなっている画像を例示した場合である。
FIG. 2A is a diagram illustrating image data (original image) read out as a processing target from the image memory 3c.
The illustrated original image is, for example, an image (grayscale image) obtained by photographing a picture (demon face drawn with black lines) P drawn by hand using a black ink pen or the like in the approximate center of a white paper or whiteboard ), The brightness of the entire image varies due to reflections during shooting, uneven brightness, and the ceiling fluorescent light appears in the center of the right side of the image. This is an example of an image in which half is dark and the upper half is bright.

図中、L1、L2は、蛍光灯の反射部分を示し、特に明るく写っている。本実施形態では、この元画像の中から白紙やホワイトボードに描いた絵Pを切り抜くためにその画像全体の中から輝度の高い部分を背景として特定するようにしている。すなわち、第1の色(白)を有する描画媒体に第2の色(黒)で描かれた絵(線画)Pを撮影した画像において、この絵(線画部分)Pを前景とする場合には、第1の色に近い部分を背景として特定するようにしている。この場合、元画像から絵Pを切り抜くための画像処理を実行するのに先だって、その画像内の各画素の輝度値(明るさの度合い)の分布をグラフ化した輝度値ヒストグラムを生成し、その輝度分布(明るさの分布)のうち、最も輝度の高い部分(明る過ぎる光沢反射部分)ではなく、ピーク付近の輝度値(最も分布の多い輝度)を背景画素の輝度として特定して所定の画像分割処理(例えば、Grab Cutのセグメンテーション処理)を実行することによりその画像内から所望する絵Pの領域(線画部分の領域)を切り抜くようにしている。   In the figure, L1 and L2 indicate reflection portions of the fluorescent lamp, and are particularly bright. In the present embodiment, in order to cut out a picture P drawn on a white paper or a whiteboard from the original image, a portion having high luminance is specified as the background from the entire image. That is, in a case where an image obtained by photographing a picture (line drawing) P drawn in the second color (black) on a drawing medium having the first color (white) is used as the foreground. The portion close to the first color is specified as the background. In this case, before executing the image processing for cutting out the picture P from the original image, a luminance value histogram is generated in which the distribution of the luminance value (degree of brightness) of each pixel in the image is graphed. In the luminance distribution (brightness distribution), specify a luminance value near the peak (the luminance with the highest distribution) as the luminance of the background pixels instead of the highest luminance portion (the glossy reflection portion that is too bright). By executing a division process (for example, Grab Cut segmentation process), a desired picture P area (line drawing part area) is cut out from the image.

この画像分割処理は、画像内で指定された一部の背景画素の位置情報に基づいて画像全体を前景画素と背景画素に分割する処理であり、Grab Cutの呼ばれるセグメンテーション処理である。なお、元画像は、グレイスケール画像に限らず、勿論、カラー画像であってもよい。この場合、カラー画像のR(赤)、G(緑)、B(青)から輝度情報を生成して、輝度値ヒストグラムを得るようにしてもよい。また、本実施形態では描画媒体として白紙やホワイトボードを例示したが、これに限らず、色紙や黒板などを描画媒体としてもよい。   This image dividing process is a process of dividing the entire image into foreground pixels and background pixels based on position information of some background pixels specified in the image, and is a segmentation process called Grab Cut. Note that the original image is not limited to a grayscale image, but may be a color image. In this case, luminance information may be generated from R (red), G (green), and B (blue) of the color image to obtain a luminance value histogram. In the present embodiment, a blank paper or a whiteboard is exemplified as the drawing medium. However, the drawing medium is not limited thereto, and a colored paper, a blackboard, or the like may be used.

図2(2)は、元画像を複数の領域に、つまり、マトリックス状に4×4の16個の領域に等分に区画した状態を示した図である。
本実施形態においては元画像の全体における輝度のバラつき、明るさのむらなどに対応可能するために、この元画像の全体を16個の領域(1)〜(16)に等分に区画した後に、領域(1)〜(16)毎に輝度ヒストグラムを算出生成し、その輝度分布のピーク付近の輝度値を背景画素として指定してセグメンテーション処理を実行するようにしている。なお、元画像を16等分する場合に限らず、8等分、32等分など、その区画数や区画の仕方は任意である。
FIG. 2B is a diagram showing a state in which the original image is equally divided into a plurality of regions, that is, 16 × 4 × 4 regions in a matrix.
In this embodiment, in order to deal with variations in brightness, uneven brightness, and the like in the entire original image, the entire original image is divided into 16 regions (1) to (16) equally. A luminance histogram is calculated and generated for each of the regions (1) to (16), and a segmentation process is executed by designating a luminance value near the peak of the luminance distribution as a background pixel. It should be noted that the number of sections and the way of partitioning are not limited to the case where the original image is divided into 16 equal parts, such as 8 equal parts and 32 equal parts.

このように本実施形態において画像処理装置(タブレット端末装置)は、画像(例えば、紙に描いた絵を撮影した画像)内で指定された一部の背景画素の位置情報に基づいて画像全体を前景画素と背景画素に分割する所定の画像分割処理を実行する分割処理手段(制御部1、プログラムメモリ3a)と、前記画像の輝度分布に基づいて背景画素の輝度を特定する特定手段(制御部1、プログラムメモリ3a)と、前記特定手段によって特定された輝度に対応する輝度を有する画素を背景画素として指定して前記所定の画像分割処理(Grab Cutのセグメンテーション処理)を実行させる制御手段(制御部1、プログラムメモリ3a)と、を備える構成となっている。   As described above, in this embodiment, the image processing apparatus (tablet terminal apparatus) processes the entire image based on the position information of some background pixels specified in the image (for example, an image obtained by photographing a picture drawn on paper). Division processing means (control unit 1, program memory 3a) for executing predetermined image division processing to divide into foreground pixels and background pixels, and identification means (control unit) for specifying the luminance of the background pixels based on the luminance distribution of the image 1. Program memory 3a) and control means (control for executing the predetermined image dividing process (Grab Cut segmentation process) by designating a pixel having luminance corresponding to the luminance specified by the specifying means as a background pixel Unit 1 and program memory 3a).

次に、本実施形態における画像処理装置(タブレット端末装置)の動作概念を図3及び図4に示すフローチャートを参照して説明する。ここで、これらのフローチャートに記述されている各機能は、読み取り可能なプログラムコードの形態で格納されており、このプログラムコードにしたがった動作が逐次実行される。また、ネットワークなどの伝送媒体を介して伝送されてきた上述のプログラムコードに従った動作を逐次実行することもできる。すなわち、記録媒体のほかに、伝送媒体を介して外部供給されたプログラム/データを利用して本実施形態特有の動作を実行することもできる。なお、図3及び図4は、画像処理装置(タブレット端末装置)の全体動作のうち、本実施形態の特徴部分の動作概要を示したフローチャートであり、この図3及び図4のフローから抜けた際には、全体動作のメインフロー(図示省略)に戻る。   Next, the operation concept of the image processing apparatus (tablet terminal apparatus) in the present embodiment will be described with reference to the flowcharts shown in FIGS. Here, each function described in these flowcharts is stored in the form of a readable program code, and operations according to the program code are sequentially executed. Further, it is possible to sequentially execute the operation according to the above-described program code transmitted via a transmission medium such as a network. In other words, in addition to the recording medium, an operation unique to the present embodiment can be executed using a program / data supplied externally via a transmission medium. 3 and 4 are flowcharts showing an outline of the operation of the characteristic part of the present embodiment in the overall operation of the image processing apparatus (tablet terminal device), and the flow of FIG. 3 and FIG. 4 is omitted. At that time, the process returns to the main flow (not shown) of the overall operation.

図3及び図4は、白色の紙に手描きで描いた絵を撮影した画像の中からその絵の部分を切り抜くための処理を示したフローチャートで、例えば、メニュー画面の中から切り抜き処理がユーザ操作で選択された際に実行開始されたり、切り抜き画像を別の画像に合成する際にその画像加工処理の一部として実行開始されたりする。
先ず、制御部1は、処理対象として選択された画像データ(例えば、静止画データ)を元画像として、画像メモリ3cから取り込む(図3のステップS1)。そして、この画像の全体領域をN等分、例えば、図2(2)に示すように16個の領域に等分に区画すると共に(ステップS2)、区画した個々の領域に対して輝度値ヒストグラムを算出生成する(ステップS3)。そして、この元画像の全体をROI(Region Of Interest)として指定すると共に(ステップS4)、その輝度分布のピーク付近の輝度値を背景画素として特定する(ステップS5)。
FIG. 3 and FIG. 4 are flowcharts showing a process for cutting out a part of a picture drawn by hand drawing on white paper. For example, the cut-out process is performed by a user operation from a menu screen. Execution is started when the image is selected, or when the clipped image is combined with another image, the execution is started as part of the image processing.
First, the control unit 1 takes in image data (for example, still image data) selected as a processing target from the image memory 3c as an original image (step S1 in FIG. 3). Then, the entire area of this image is divided into N equal parts, for example, equally divided into 16 areas as shown in FIG. 2 (2) (step S2), and a luminance value histogram for each divided area. Is calculated and generated (step S3). Then, the entire original image is designated as ROI (Region Of Interest) (step S4), and the luminance value near the peak of the luminance distribution is specified as the background pixel (step S5).

図4は、輝度分布のピーク付近の輝度値を背景画素として指定するための処理(図3のステップS5)を詳述するためのフローチャートである。
先ず、元画像を16等分した各領域(1)〜(16)をその先頭から順次指定するために各領域の個々に割り当てられているブロック番号を“0”にリセットする(ステップS51)。そして、ブロック番号の値は“16”か、つまり、最後の16番目の領域(16)を指定し終わったかを調べるが(ステップS52)、最初は、ブロック番号が“0”で、1番目の領域(1)を指定している場合であるから、該当ブロック(領域)のヒストグラムデータを取得する(ステップS53)。そして、以下、後述するステップS52〜S57の処理をブロック番号が“16”に達するまで繰り返し実行する。
FIG. 4 is a flowchart for explaining in detail the process (step S5 in FIG. 3) for designating the luminance value near the peak of the luminance distribution as the background pixel.
First, the block number assigned to each area is reset to “0” in order to sequentially designate the areas (1) to (16) obtained by dividing the original image into 16 parts from the head (step S51). Then, it is checked whether the value of the block number is “16”, that is, whether or not the last 16th area (16) has been designated (step S52). Initially, the block number is “0” and the first Since the region (1) is designated, histogram data of the corresponding block (region) is acquired (step S53). Thereafter, the processes of steps S52 to S57 described later are repeatedly executed until the block number reaches “16”.

図5及び図6は、輝度値ヒストグラムを例示した図である。
図2(2)に示すように、元画像を16等分した各領域(1)〜(16)のうち、図5(1)は、領域(1)のヒストグラムを示し、図5(2)は、領域(7)のヒストグラムを示している。また、図6(1)は、領域(10)のヒストグラムを示し、図6(2)は、領域(16)のヒストグラムを示している。なお、図中、横軸は輝度値、縦軸は画素数を示し、また、図中、左側が暗い(黒い)ピクセルを示し、右側が明るい(白い)ピクセルを示している。
5 and 6 are diagrams exemplifying luminance value histograms.
As shown in FIG. 2 (2), among the regions (1) to (16) obtained by dividing the original image into 16 equal parts, FIG. 5 (1) shows a histogram of the region (1), and FIG. Indicates a histogram of region (7). FIG. 6 (1) shows a histogram of the region (10), and FIG. 6 (2) shows a histogram of the region (16). In the figure, the horizontal axis indicates the luminance value, the vertical axis indicates the number of pixels, and in the figure, the left side indicates dark (black) pixels, and the right side indicates bright (white) pixels.

ここで、図2に示すように、領域(1)は、左上隅部の領域で、白紙やホワイトボードのみの領域であるために、輝度のピークがはっきりと表れている。領域(7)は、右寄り上寄りの領域で、絵Pが描かれた部分の領域であり、近くに蛍光灯の反射部分L1、L2が存在しているためにその影響を受けて輝度の分布は、そのピーク値よりも高い輝度を有している。領域(10)は、左寄り下寄りの領域で、絵Pが描かれた部分の領域であり、領域(7)に比べて蛍光灯の反射部分L1、L2より離れているために輝度の分布は領域(7)よりも狭く、また、絵Pの内部の黒の線による影響を受けてピーク値よりも低い輝度を有している。領域(16)は、右下隅部の領域で、蛍光灯の反射部分L2が多く含まれているために複数の輝度のピークを有している。   Here, as shown in FIG. 2, the region (1) is a region in the upper left corner, and is a region of only white paper or a whiteboard, and therefore, a luminance peak clearly appears. The region (7) is a region on the upper right side where the picture P is drawn. Since there are reflection portions L1 and L2 of the fluorescent lamp nearby, the luminance distribution is affected by the reflection. Has a higher brightness than its peak value. The area (10) is an area on the lower left side and is a part where the picture P is drawn. Since the area (10) is farther from the reflection parts L1 and L2 of the fluorescent lamp than the area (7), the luminance distribution is It is narrower than the region (7) and has a luminance lower than the peak value due to the influence of the black line inside the picture P. The region (16) is a region in the lower right corner and has a plurality of luminance peaks because it includes a large number of fluorescent lamp reflection portions L2.

図7は、輝度値をグループに分けて、各グループに所属する輝度値の数をカウントした一覧表を示し、図示の例では32グループに分けた場合で、「グループ番号」“0”〜“31”に「輝度値の範囲」の「範囲最小」と「範囲最大」を対応付けた構成となっている。いま、図6(1)に示した領域(10)のヒストグラムを例に挙げて、以下のステップS53〜S57を説明するものとすると、先ず、この領域(10)のヒストグラムの中から一番分布数の多い輝度範囲を取得する(ステップS54)。この場合、図6(1)のヒストグラムにおいて輝度のピークは、輝度値“16”であるために「グループ番号」“16”の輝度範囲を一番分布数の多い輝度範囲として取得する。   FIG. 7 shows a list in which the luminance values are divided into groups and the number of luminance values belonging to each group is counted. In the example shown in the figure, “group numbers” “0” to “0” are divided into 32 groups. In this configuration, “minimum range” and “maximum range” of “luminance value range” are associated with 31 ″. Now, taking the histogram of the region (10) shown in FIG. 6 (1) as an example, the following steps S53 to S57 will be described. First, the most distribution among the histograms of this region (10). A large luminance range is acquired (step S54). In this case, since the luminance peak in the histogram of FIG. 6A is the luminance value “16”, the luminance range of “group number” “16” is acquired as the luminance range with the largest distribution number.

そして、この一番分布数の多い輝度グループ及びその二つ上のグループまでを輝度のピーク付近として特定する(ステップS55)。この場合、一番分布数の多い輝度グループとしてグループ番号“16”及びその二つ上のグループとしてグループ番号“17”、“18”までを輝度のピーク付近として特定する。これによって特定したピーク付近のグループの「輝度値の範囲」を背景画素の輝度として指定する(ステップS56)。この場合、特定したグループ番号“16”〜“18”の「輝度値の範囲」“128”〜“151”が背景画素の輝度として指定される。そして、ブロック番号に“1”を加算してその値を更新(ステップS57)した後、上述のステップS52に戻り、ブロック番号が“16”に達するまでステップS52〜S57の処理を繰り返す。   Then, the luminance group having the largest number of distributions and the group two higher than that are specified as the vicinity of the luminance peak (step S55). In this case, the group number “16” is specified as the luminance group having the largest distribution number, and the group numbers “17” and “18” are specified as the two higher groups as the vicinity of the luminance peak. The “brightness value range” of the group near the peak specified in this way is designated as the luminance of the background pixel (step S56). In this case, “brightness value ranges” “128” to “151” of the specified group numbers “16” to “18” are designated as the luminance of the background pixel. Then, after adding “1” to the block number and updating the value (step S57), the process returns to the above-described step S52, and the processes of steps S52 to S57 are repeated until the block number reaches “16”.

図8(1)は、図2(1)に示した元画像に対してその輝度分布のピーク付近の輝度値を背景画素として指定する処理(図3のステップS5)を実行した後の画像イメージを例示した図である。
この画像は、背景箇所を“黒”で表現した場合を示したもので、黒色部分以外の他の箇所(白色部分及び灰色部分)は、背景指定されていない箇所(線画の可能性がある箇所)を示している。
FIG. 8 (1) shows an image image after executing processing (step S5 in FIG. 3) for designating a luminance value near the peak of the luminance distribution as a background pixel for the original image shown in FIG. 2 (1). FIG.
This image shows the case where the background part is expressed in “black”. Other parts (white part and gray part) other than the black part are places where the background is not specified (parts where there is a possibility of line drawing) ).

このようにして領域毎にその背景画素の輝度値を特定した後は、図3のステップS6に移り、領域毎に画像分割処理(Grab Cutのセグメンテーション処理)を実行する。この画像分割処理は、最初に指定された背景画素を背景であることが確定された確定画素とし、前景か背景かが未確定の対象画素については、隣接する画素における輝度の差を画像内の複数部分について所定の観点で集計した集計値がより小さくなるように前景か背景かを決定する処理である。このような画像分割処理を実行した結果、図8(2)に示したような切り抜きマスク(抜型)画像が得られる。この場合、絵(線画部分)である前景画素の領域に囲まれるように背景画素の領域が存在し、絵に描いた絵の内部も切り抜いてしまうために、次のステップS7では、一番外側の領域(輪郭)のみを切り抜きマスク画像として採用するようにしている。つまり、前景画素の領域における最も外側の輪郭に沿った領域を画像内の切り抜き領域として設定するようにしている。   After specifying the luminance value of the background pixel for each region in this way, the process proceeds to step S6 in FIG. 3, and image division processing (Grab Cut segmentation processing) is performed for each region. In this image segmentation process, the first designated background pixel is a confirmed pixel that is confirmed to be the background, and for a target pixel whose foreground or background is undetermined, the luminance difference between adjacent pixels is determined in the image. This is a process for determining whether the foreground or the background is such that the total value obtained from a predetermined viewpoint for a plurality of portions becomes smaller. As a result of executing such image division processing, a cutout mask (cutting die) image as shown in FIG. 8B is obtained. In this case, the background pixel area exists so as to be surrounded by the foreground pixel area which is a picture (line drawing portion), and the inside of the picture drawn in the picture is also cut out. Only the region (outline) is adopted as a cut-out mask image. That is, an area along the outermost contour in the foreground pixel area is set as a cutout area in the image.

図9は、一番外側の領域(輪郭)を特定する仕方を説明するための図である。
領域(輪郭)の数え方としては、「openCv(商標名)のcvFindContours」を使用している。すなわち、図9(1)は、下地が黒色で白色の線画が四角形とその中の円形を示した画像で、図示の例では、白黒の境界線(輪郭線)が4本、つまり、四角形の外側と内側の境界線(輪郭線)、円形の外側と内側の境界線(輪郭線)の場合を示している。すなわち、一番外側に白の輪郭があり、その内側に黒の輪郭、その内側に白の輪郭、その内側に黒の輪郭がある輪郭構造となっている。図9(2)は、輪郭の数え方を図示したもので、一番目が四角形の外側の輪郭線(白の輪郭)、二番目が四角形の内側の輪郭線(黒の輪郭)、三番目が円形の外側の輪郭線(白の輪郭)、四番目が円角の内側の輪郭線(黒の輪郭)となり、この一番目が四角形の外側の輪郭線を一番外側の領域(輪郭)として特定するために、この外側の輪郭線のみを残すようにしている。
FIG. 9 is a diagram for explaining how to specify the outermost region (outline).
As a method of counting regions (contours), “openCv (trade name) cvFindContours” is used. That is, FIG. 9 (1) is an image in which the background is black and the white line drawing shows a quadrangle and a circle therein, and in the illustrated example, there are four black and white border lines (contour lines), that is, a quadrilateral shape. The case of the outer and inner boundary lines (contour lines) and the outer and inner boundary lines (contour lines) of a circle are shown. That is, the contour structure has a white contour on the outermost side, a black contour on the inner side, a white contour on the inner side, and a black contour on the inner side. FIG. 9 (2) illustrates how to count the contours. The first is the outer contour of the quadrangle (white contour), the second is the inner contour of the quadrangle (black contour), and the third is The outer outline of the circle (white outline), the fourth is the inner outline of the circle (black outline), and the first is the outer outline of the rectangle as the outermost area (contour) Therefore, only the outer contour line is left.

図10(1)は、一番外側の領域(輪郭)のみを切り抜きマスク画像として採用した場合を例示した図である。
上述のようにして作成した切り抜きマスク画像を使用して、画像の切り抜き処理(図3のステップS8)を実行すると、図10(2)に示すような切り抜き画像(線画部分の画像)が得られる。なお、図示の市松模様は、切り抜き画像以外の透明部分を概念的に示したもので、実際には市松模様は存在しない。このようにして得られた切り抜き画像(線画部分の画像)は、絵Pのみの画像であり、内部の線画も含まれたものとなる。なお、この切り抜き画像をどのように利用するかは任意であるが、別の画像内にその切り抜き画像を合成するようにしてもよい。
FIG. 10A is a diagram illustrating a case where only the outermost region (contour) is adopted as a cut-out mask image.
When the image cut-out process (step S8 in FIG. 3) is executed using the cut-out mask image created as described above, a cut-out image (image of a line drawing portion) as shown in FIG. 10 (2) is obtained. . The illustrated checkerboard pattern conceptually shows a transparent portion other than the cut-out image, and actually there is no checkerboard pattern. The cut-out image (line drawing portion image) obtained in this way is an image of only the picture P and includes an internal line drawing. Note that how to use the clipped image is arbitrary, but the clipped image may be combined in another image.

以上のように、本実施形態において制御部1は、画像内で指定された一部の背景画素の位置情報に基づいて画像全体を前景画素と背景画素に分割する所定の画像分割処理を実行するに先立って、画像の輝度分布に基づいて背景画素の輝度を特定し、この輝度に対応する輝度を有する画素を背景画素として指定して画像分割処理を実行するようにしたので、ユーザによる領域指定のための補助操作を必要とせずに、画像内からその一部の領域を精度良く切り抜くことができる。その結果、例えば、白紙やホワイトボードに黒のペンなどを使用して手描きで描いた絵を撮影した画像に、撮影時に反射などの影響を受けて画像全体に輝度のバラつき、明るさのむらが起きていても、その絵の領域を精度良く特定して適切に切り抜くことが可能となる。   As described above, in the present embodiment, the control unit 1 executes predetermined image division processing for dividing the entire image into foreground pixels and background pixels based on position information of some background pixels specified in the image. Prior to this, the luminance of the background pixel is specified based on the luminance distribution of the image, and the pixel having the luminance corresponding to this luminance is designated as the background pixel and the image division process is executed. Therefore, it is possible to accurately cut out a part of the area from the image without requiring an auxiliary operation. As a result, for example, an image obtained by shooting a hand-drawn picture using a black pen on a white paper or white board is affected by reflections during shooting, resulting in uneven brightness and uneven brightness. Even if this is the case, it is possible to accurately identify and accurately cut out the area of the picture.

制御部1は、画像を複数の領域に区画し、この区画した領域毎の輝度分布に基づいて領域毎に背景画素の輝度を特定すると共に、領域毎に特定した輝度に対応する輝度を有する画素を領域毎の背景画素として指定して画像分割処理を実行させるようにしたので、全体的に緩やかな輝度の差があっても、絵の領域を精度良く特定して適切に切り抜くことが可能となる。   The control unit 1 divides the image into a plurality of regions, specifies the luminance of the background pixel for each region based on the luminance distribution for each of the divided regions, and has a luminance corresponding to the luminance specified for each region Is specified as the background pixel for each area and the image segmentation process is executed, so that even if there is a gradual difference in luminance overall, it is possible to accurately identify and properly cut out the picture area Become.

制御部1は、輝度値ヒストグラムのうち、最も輝度の高い部分(明る過ぎる光沢反射部分)ではなく、ピーク付近の輝度値(最も分布の多い輝度)を背景画素の輝度として特定するようにしたので、最初から明る過ぎる光沢反射部分を背景として確定せずに、前景か背景かが未確定の画素として画像分割処理を実行させることができ、絵の領域をより精度良く切り抜くことが可能となる。   Since the control unit 1 specifies the luminance value near the peak (the luminance with the highest distribution) as the luminance of the background pixel, not the highest luminance portion (the glossy reflection portion that is too bright) in the luminance value histogram. The image division process can be executed as a pixel whose foreground or background is undetermined without determining a glossy reflection portion that is too bright from the beginning as a background, and a picture area can be cut out more accurately.

処理対象となる元画像は、第1の色を有する描画媒体に第2の色で描かれた線画を撮影した画像で、制御部1は、この線画部分を前景とする場合に、第1の色に近い部分を背景として特定するようにしたので、第1の色(白)を有する描画媒体に第2の色(黒)で描かれた絵(線画)を撮影した画像において、この絵(線画部分)を前景とする場合には、第1の色に近い部分を背景とすることができ、絵の領域をより精度良く切り抜くことが可能となる。   The original image to be processed is an image obtained by photographing a line drawing drawn in the second color on the drawing medium having the first color. When the line drawing portion is set as the foreground, the control unit 1 uses the first image. Since the portion close to the color is specified as the background, in the image obtained by photographing the picture (line drawing) drawn in the second color (black) on the drawing medium having the first color (white), this picture ( When the line drawing part) is used as the foreground, the part close to the first color can be used as the background, and the picture area can be cut out with higher accuracy.

制御部1は、画像分割処理が実行された結果、線画部分である前景画素の領域に囲まれるように背景画素の領域が存在する場合には、前景画素の領域における最も外側の輪郭に沿った領域を画像内の切り抜き領域として設定するようにしたので、絵の内部に描いた部分を切り抜かないようにすることができる。   When the background pixel region is present so as to be surrounded by the foreground pixel region that is the line drawing part as a result of the image division processing, the control unit 1 follows the outermost contour in the foreground pixel region. Since the region is set as the cutout region in the image, it is possible to prevent the portion drawn in the picture from being cut out.

画像分割処理は、最初に指定された背景画素を背景であることが確定された確定画素とし、前景か背景かが未確定の対象画素については、隣接する画素における輝度の差を画像内の複数部分について所定の観点で集計した集計値がより小さくなるように前景か背景かを決定する処理であるから、未確定の対象画素に対して隣接する画素の輝度差から前景か背景かを決定することができ、絵の領域をより精度良く切り抜くことが可能となる。   In the image division processing, the first designated background pixel is a confirmed pixel that is confirmed to be the background, and for a target pixel whose foreground or background is undetermined, a difference in luminance between adjacent pixels is determined in the image. Since it is a process for determining whether the foreground or the background is such that the total value aggregated from a predetermined point of view for the portion becomes smaller, the foreground or the background is determined from the luminance difference between adjacent pixels with respect to the uncertain target pixel This makes it possible to cut out a picture area with higher accuracy.

なお、上述した実施形態においては、元画像が静止画の場合を例示したが、動画であっても同様に適用可能である。この場合、各フレーム毎に領域の切り抜き処理を行ったり、所定のフレーム間隔毎に領域の切り抜き処理を行ったりしてもよい。   In the above-described embodiment, the case where the original image is a still image is illustrated, but the present invention can be similarly applied to a moving image. In this case, a region cutout process may be performed for each frame, or a region cutout process may be performed at predetermined frame intervals.

また、上述した実施形態においては、元画像の全体を16個の領域に等分に区画するようにしたが、元画像の内容に基づいてその区画数を自動決定したり、ユーザ操作により任意に設定したりするようにしてもよい。   In the above-described embodiment, the entire original image is equally divided into 16 areas. However, the number of sections is automatically determined based on the contents of the original image, or can be arbitrarily determined by a user operation. You may make it set.

また、上述した実施形態においては、画像内のうち、白紙やホワイトボードに相当する領域を背景とし、絵に相当する領域を前景として説明したが、この背景と前景との表現は便宜的なものであり、例えば、絵Aの領域と絵Bの領域とに分割するような場合には、その一方の絵を「背景画素」、他方の絵を「前景画素」と見なしてもよい。また、切り抜く画像は、絵(線画部分)に限らず、被写体であってもよい。   In the above-described embodiment, the area corresponding to the blank paper or the whiteboard in the image is used as the background, and the area corresponding to the picture is used as the foreground. However, the expression of the background and the foreground is convenient. For example, when the picture A area and the picture B area are divided, one picture may be regarded as a “background pixel” and the other picture as a “foreground pixel”. Further, the image to be cut out is not limited to a picture (line drawing part) but may be a subject.

上述した実施形態においては、所定の画像分割処理としてGrab Cutと呼ばれるセグメンテーション手法を使用するようにしたが、その他のセグメンテーション手法であってもよい。   In the above-described embodiment, the segmentation method called Grab Cut is used as the predetermined image division processing, but other segmentation methods may be used.

上述した実施形態においては、画像処理装置としてタブレット端末装置に適用した場合を示したが、これに限らず、パーソナルコンピュータ、PDA(個人向け携帯型情報通信機器)、スマートフォンなどの携帯電話機、電子ゲーム、音楽プレイヤーであってもよく、勿論、デジタルカメラ自体であってもよい。   In the above-described embodiment, the case where the image processing apparatus is applied to a tablet terminal device has been described. However, the present invention is not limited to this, and a personal computer, a PDA (personal portable information communication device), a mobile phone such as a smartphone, and an electronic game It may be a music player or, of course, a digital camera itself.

また、上述した実施形態において示した“装置”や“部”とは、機能別に複数の筐体に分離されていてもよく、単一の筐体に限らない。また、上述したフローチャートに記述した各ステップは、時系列的な処理に限らず、複数のステップを並列的に処理したり、別個独立して処理したりするようにしてもよい。   Further, the “apparatus” and “unit” shown in the above-described embodiments may be separated into a plurality of cases by function, and are not limited to a single case. In addition, each step described in the above-described flowchart is not limited to time-series processing, and a plurality of steps may be processed in parallel or separately.

以上、この発明の実施形態について説明したが、この発明は、これに限定されるものではなく、特許請求の範囲に記載された発明とその均等の範囲を含むものである。
以下、本願出願の特許請求の範囲に記載された発明を付記する。
(付記)
(請求項1)
請求項1に記載の発明は、
画像内で指定された一部の背景画素の位置情報に基づいて画像全体を前景画素と背景画素に分割する所定の画像分割処理を実行する分割処理手段と、
前記画像の輝度分布に基づいて背景画素の輝度を特定する特定手段と、
前記特定手段によって特定された輝度に対応する輝度を有する画素を前記一部の背景画素として指定して前記所定の画像分割処理を実行させる制御手段と、
を備えたことを特徴とする画像処理装置である。
(請求項2)
請求項2に記載の発明は、請求項1に記載の画像処理装置において、
前記画像を複数の領域に区画する区画手段を更に備え、
前記特定手段は、前記区画手段によって区画された領域毎の輝度分布に基づいて領域毎に背景画素の輝度を特定し、
前記制御手段は、前記特定手段によって領域毎に特定された輝度に対応する輝度を有する画素を領域毎に前記一部の背景画素として指定して前記所定の画像分割処理を実行させる、
ことを特徴とする画像処理装置である。
(請求項3)
請求項3に記載の発明は、請求項1又は請求項2に記載の画像処理装置において、
前記特定手段は、最も分布の多い輝度を背景画素の輝度として特定する、
ことを特徴とする画像処理装置である。
(請求項4)
請求項4に記載の発明は、請求項1〜請求項3のいずれか1項に記載の画像処理装置において、
前記画像は、第1の色を有する描画媒体に第2の色で描かれた線画を撮影した画像であり、
前記特定手段は、前記線画部分を前景とする場合に、前記第1の色に近い部分を背景として特定する、
ことを特徴とする画像処理装置である。
(請求項5)
請求項5に記載の発明は、請求項4に記載の画像処理装置において、
前記所定の画像分割処理が実行された結果、前記線画部分である前景画素の領域に囲まれるように背景画素の領域が存在する場合には、前景画素の領域における最も外側の輪郭に沿った領域を前記画像内の切り抜き領域として設定する切り抜き領域設定手段を更に備える、
ことを特徴とする画像処理装置である。
(請求項6)
請求項6に記載の発明は、請求項1〜請求項5に記載の画像処理装置において、
前記所定の画像分割処理は、最初に指定された背景画素を背景であることが確定された確定画素とし、前景か背景かが未確定の対象画素については、隣接する画素における輝度の差を画像内の複数部分について所定の観点で集計した集計値がより小さくなるように前景か背景かを決定する処理である、
ことを特徴とする画像処理装置である。
(請求項7)
請求項7に記載の発明は、
画像の輝度分布に基づいて背景画素の輝度を特定するステップと、
画像内で指定された一部の背景画素の位置情報に基づいて画像全体を前景画素と背景画素に分割する所定の画像分割処理を実行する際に、前記特定された輝度に対応する輝度を有する画素を前記一部の背景画素として指定して、前記所定の画像分割処理を実行させるステップと、
を含むことを特徴とする画像処理方法である。
(請求項8)
請求項8に記載の発明は、
画像処理装置のコンピュータを制御するためのプログラムであって、
前記コンピュータを、
画像内で指定された一部の背景画素の位置情報に基づいて画像全体を前景画素と背景画素に分割する所定の画像分割処理を実行する分割処理手段、
前記画像の輝度分布に基づいて背景画素の輝度を特定する特定手段、
前記特定手段によって特定された輝度に対応する輝度を有する画素を前記一部の背景画素として指定して前記所定の画像分割処理を実行させる制御手段、
として機能させるようにしたコンピュータ読み取り可能なプログラムである。
The embodiment of the present invention has been described above. However, the present invention is not limited to this, and includes the invention described in the claims and the equivalent scope thereof.
Hereinafter, the invention described in the claims of the present application will be appended.
(Appendix)
(Claim 1)
The invention described in claim 1
Division processing means for performing predetermined image division processing for dividing the entire image into foreground pixels and background pixels based on position information of some background pixels specified in the image;
Specifying means for specifying the luminance of a background pixel based on the luminance distribution of the image;
Control means for designating pixels having brightness corresponding to the brightness specified by the specifying means as the partial background pixels and executing the predetermined image division processing;
An image processing apparatus comprising:
(Claim 2)
The invention according to claim 2 is the image processing apparatus according to claim 1,
Partitioning means for partitioning the image into a plurality of regions;
The specifying means specifies the luminance of a background pixel for each area based on the luminance distribution for each area divided by the dividing means,
The control means designates pixels having luminance corresponding to the luminance specified for each area by the specifying means as the partial background pixels for each area, and executes the predetermined image division processing.
An image processing apparatus characterized by this.
(Claim 3)
The invention according to claim 3 is the image processing apparatus according to claim 1 or 2,
The specifying unit specifies the luminance with the highest distribution as the luminance of the background pixel.
An image processing apparatus characterized by this.
(Claim 4)
The invention according to claim 4 is the image processing apparatus according to any one of claims 1 to 3,
The image is an image obtained by photographing a line drawing drawn in the second color on a drawing medium having the first color;
The specifying means specifies a portion close to the first color as a background when the line drawing portion is a foreground.
An image processing apparatus characterized by this.
(Claim 5)
The invention according to claim 5 is the image processing apparatus according to claim 4,
As a result of the execution of the predetermined image division processing, when a background pixel area exists so as to be surrounded by the foreground pixel area that is the line drawing portion, an area along the outermost contour in the foreground pixel area Is further provided with a clipping region setting means for setting as a clipping region in the image,
An image processing apparatus characterized by this.
(Claim 6)
According to a sixth aspect of the present invention, in the image processing apparatus according to the first to fifth aspects,
In the predetermined image division processing, the first designated background pixel is a confirmed pixel determined to be a background, and for a target pixel whose foreground or background is undetermined, the luminance difference between adjacent pixels is imaged. It is a process of determining whether the foreground or the background so that the aggregated value aggregated from a predetermined point of view for a plurality of parts is smaller.
An image processing apparatus characterized by this.
(Claim 7)
The invention described in claim 7
Identifying the luminance of the background pixels based on the luminance distribution of the image;
When performing predetermined image division processing for dividing the entire image into foreground pixels and background pixels based on position information of some background pixels specified in the image, the image has a luminance corresponding to the specified luminance. Designating a pixel as the partial background pixel and executing the predetermined image segmentation process;
The image processing method characterized by including.
(Claim 8)
The invention according to claim 8 provides:
A program for controlling a computer of an image processing apparatus,
The computer,
Division processing means for performing predetermined image division processing for dividing the entire image into foreground pixels and background pixels based on position information of some background pixels specified in the image;
Specifying means for specifying the luminance of a background pixel based on the luminance distribution of the image;
Control means for designating pixels having luminance corresponding to the luminance specified by the specifying means as the partial background pixels and executing the predetermined image division processing;
It is a computer readable program that is made to function as.

1 制御部
3 記憶部
3a プログラムメモリ
3c 画像メモリ
DESCRIPTION OF SYMBOLS 1 Control part 3 Memory | storage part 3a Program memory 3c Image memory

Claims (11)

前景と背景とに分割すべき対象画像における一部の背景画素の画素値を特定する画素値特定手段と、
前記一部の背景画素の画素値に対応する画素値を有する前記対象画像内の画素を一部の背景画素として特定する第1特定手段と、
前記対象画像内の各画素の画素値および前記一部の背景画素の位置情報を用いて、前記対象画像内の他の背景画素および前景画素を特定する第2特定手段と、
前記第2特定手段により背景画素と前景画素が特定された結果、前景画素の領域に囲まれるように背景画素の領域が存在する場合には、前景画素の領域における最も外側の輪郭に沿った領域を前記対象画像内の切り抜き領域として設定する切り抜き領域設定手段と、
を備えたことを特徴とする画像処理装置。
Pixel value specifying means for specifying pixel values of some background pixels in the target image to be divided into foreground and background;
First specifying means for specifying pixels in the target image having pixel values corresponding to pixel values of the some background pixels as some background pixels;
Second specifying means for specifying other background pixels and foreground pixels in the target image using pixel values of each pixel in the target image and position information of the part of the background pixels;
As a result of specifying the background pixel and the foreground pixel by the second specifying means, if a background pixel area exists so as to be surrounded by the foreground pixel area, the area along the outermost contour in the foreground pixel area Cutting area setting means for setting as a cutting area in the target image;
An image processing apparatus comprising:
前記画素値特定手段は、前景と背景とに分割すべき対象画像の画素値のヒストグラムに基づいて一部の背景画素の画素値を特定する、The pixel value specifying means specifies pixel values of some background pixels based on a histogram of pixel values of a target image to be divided into foreground and background.
ことを特徴とする請求項1に記載の画像処理装置。The image processing apparatus according to claim 1.
前記対象画像は、第1の色を有する描画媒体に第2の色で描かれた線画を撮影した画像であり、
前記画素値特定手段は、前記線画部分を前景とする場合に、前記第1の色に対応する画素値を背景画素の画素値として特定する、
ことを特徴とする請求項1または2に記載の画像処理装置。
The target image is an image obtained by photographing a line drawing drawn in the second color on a drawing medium having the first color;
The pixel value specifying unit specifies a pixel value corresponding to the first color as a pixel value of a background pixel when the line drawing portion is a foreground.
The image processing apparatus according to claim 1 , wherein the image processing apparatus is an image processing apparatus.
前記切り抜き領域設定手段は、前記第2特定手段により背景画素と前景画素が特定された結果、前記線画部分である前景画素の領域に囲まれるように背景画素の領域が存在する場合には、前景画素の領域における最も外側の輪郭に沿った領域を前記対象画像内の切り抜き領域として設定する
ことを特徴とする請求項3に記載の画像処理装置。
The clipping region setting means determines that when a background pixel area exists so as to be surrounded by a foreground pixel area that is the line drawing portion as a result of specifying the background pixel and the foreground pixel by the second specifying means. A region along the outermost contour in the pixel region is set as a cutout region in the target image ;
The image processing apparatus according to claim 3 .
前記第2特定手段は、前記対象画像内の各画素の画素値および前記一部の背景画素の位置情報を用いて、前記対象画像内の背景画素および前景画素を所定の精度で推定し、この推定結果を用いて更により高い精度で前記対象画像内の背景画素および前景画素を特定する処理を繰り返し実行する
ことを特徴とする請求項1乃至4のいずれかに記載の画像処理装置。
The second specifying unit estimates a background pixel and a foreground pixel in the target image with a predetermined accuracy using a pixel value of each pixel in the target image and position information of the part of the background pixels. 5. The image processing apparatus according to claim 1 , wherein a process of specifying a background pixel and a foreground pixel in the target image is repeatedly executed with higher accuracy using the estimation result.
前記対象画像を複数の領域に区画する区画手段を更に備え、
前記画素値特定手段は、前記区画手段によって区画された領域毎の画素値のヒストグラムに基づいて領域毎に一部の背景画素の画素値を特定し、
前記第1特定手段は、前記領域毎に特定された一部の背景画素の画素値に基づいて、前記領域毎に一部の背景画素を特定し、
前記第2特定手段は、前記領域毎に特定された一部の背景画素の位置情報を用いて、前記対象画像全体の背景画素および前景画素を特定する
ことを特徴とする請求項1乃至5のいずれかに記載の画像処理装置。
Partitioning means for partitioning the target image into a plurality of regions;
The pixel value specifying means specifies pixel values of some background pixels for each area based on a histogram of pixel values for each area partitioned by the partitioning means,
The first specifying means specifies some background pixels for each region based on pixel values of some background pixels specified for each region;
The said 2nd specific | specification part specifies the background pixel and the foreground pixel of the said whole target image using the positional information on the one part background pixel specified for every said area | region . The image processing apparatus according to any one of the above.
前記画素値特定手段は、最も分布の多い画素値を背景画素の画素値として特定する、
ことを特徴とする請求項1乃至6のいずれかに記載の画像処理装置。
The pixel value specifying means specifies a pixel value having the most distribution as a pixel value of a background pixel;
The image processing apparatus according to claim 1 , wherein the image processing apparatus is an image processing apparatus.
前記画素値特定手段は、前景と背景とに分割すべき対象画像の輝度のヒストグラムに基づいて一部の背景画素の輝度を特定し、
前記第1特定手段は、前記一部の背景画素の輝度に対応する輝度を有する前記対象画像内の画素を一部の背景画素として特定する
ことを特徴とする請求項1乃至7のいずれかに記載の画像処理装置。
The pixel value specifying means specifies the luminance of some background pixels based on a luminance histogram of a target image to be divided into foreground and background,
Said first specifying means, in any one of claims 1 to 7, wherein the identifying the pixels in the target image having a luminance corresponding to the luminance of the background pixels in the part as part of the background pixel The image processing apparatus described.
前記第2特定手段は、最初に指定された背景画素を背景であることが確定された確定画素とし、前景か背景かが未確定の対象画素については、隣接する画素における輝度の差を画像内の複数部分について所定の観点で集計した集計値がより小さくなるように前景か背景かを決定する処理を行う、
ことを特徴とする請求項1乃至8のいずれかに記載の画像処理装置。
The second specifying means sets the first designated background pixel as a confirmed pixel determined to be the background, and for a target pixel for which the foreground or the background is undetermined, the difference in luminance between adjacent pixels is included in the image. To determine whether the foreground or background so that the aggregated value aggregated from a given point of view for multiple parts of the
The image processing apparatus according to claim 1 , wherein the image processing apparatus is an image processing apparatus.
前景と背景とに分割すべき対象画像の画素値のヒストグラムに基づいて一部の背景画素の画素値を特定する処理と、
前記一部の背景画素の画素値に対応する画素値を有する前記対象画像内の画素を一部の背景画素として特定する処理と、
前記対象画像内の各画素の画素値および前記一部の背景画素の位置情報を用いて、前記対象画像内の他の背景画素および前景画素を特定する処理と、
背景画素と前景画素が特定された結果、前景画素の領域に囲まれるように背景画素の領域が存在する場合には、前景画素の領域における最も外側の輪郭に沿った領域を前記対象画像内の切り抜き領域として設定する処理と、
を含むことを特徴とする画像処理方法。
A process of identifying pixel values of some background pixels based on a histogram of pixel values of a target image to be divided into foreground and background;
A process of identifying pixels in the target image having pixel values corresponding to pixel values of the some background pixels as some background pixels;
A process of specifying other background pixels and foreground pixels in the target image using pixel values of each pixel in the target image and position information of the part of the background pixels;
As a result of specifying the background pixel and the foreground pixel, when a background pixel area exists so as to be surrounded by the foreground pixel area, an area along the outermost contour in the foreground pixel area is defined in the target image. A process to set as a crop area,
An image processing method comprising:
画像処理装置のコンピュータを、
前景と背景とに分割すべき対象画像の画素値のヒストグラムに基づいて一部の背景画素の画素値を特定する画素値特定手段、
前記一部の背景画素の画素値に対応する画素値を有する前記対象画像内の画素を一部の背景画素として特定する第1特定手段、
前記対象画像内の各画素の画素値および前記一部の背景画素の位置情報を用いて、前記対象画像内の他の背景画素および前景画素を特定する第2特定手段、
前記第2特定手段により背景画素と前景画素が特定された結果、前景画素の領域に囲まれるように背景画素の領域が存在する場合には、前景画素の領域における最も外側の輪郭に沿った領域を前記対象画像内の切り抜き領域として設定する切り抜き領域設定手段、
として機能させるためのプログラム。
The computer of the image processing device
Pixel value specifying means for specifying pixel values of some background pixels based on a histogram of pixel values of a target image to be divided into foreground and background;
First specifying means for specifying pixels in the target image having pixel values corresponding to pixel values of the some background pixels as some background pixels;
Second specifying means for specifying other background pixels and foreground pixels in the target image using pixel values of each pixel in the target image and position information of the part of the background pixels;
As a result of specifying the background pixel and the foreground pixel by the second specifying means, if a background pixel area exists so as to be surrounded by the foreground pixel area, the area along the outermost contour in the foreground pixel area Clip region setting means for setting the clip region as a clip region in the target image,
Program to function as.
JP2013211726A 2013-10-09 2013-10-09 Image processing apparatus, image processing method, and program Active JP5811416B2 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2013211726A JP5811416B2 (en) 2013-10-09 2013-10-09 Image processing apparatus, image processing method, and program
CN201410667836.7A CN104580883B (en) 2013-10-09 2014-10-08 Image processing apparatus, image processing method and recording medium
US14/509,779 US9679386B2 (en) 2013-10-09 2014-10-08 Image processing device capable of segmenting an image into plural areas

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013211726A JP5811416B2 (en) 2013-10-09 2013-10-09 Image processing apparatus, image processing method, and program

Publications (3)

Publication Number Publication Date
JP2015075920A JP2015075920A (en) 2015-04-20
JP2015075920A5 JP2015075920A5 (en) 2015-07-02
JP5811416B2 true JP5811416B2 (en) 2015-11-11

Family

ID=52777002

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013211726A Active JP5811416B2 (en) 2013-10-09 2013-10-09 Image processing apparatus, image processing method, and program

Country Status (3)

Country Link
US (1) US9679386B2 (en)
JP (1) JP5811416B2 (en)
CN (1) CN104580883B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9710911B2 (en) * 2015-11-30 2017-07-18 Raytheon Company System and method for generating a background reference image from a series of images to facilitate moving object identification
US10270965B2 (en) 2015-12-04 2019-04-23 Ebay Inc. Automatic guided capturing and presentation of images
CN105744173B (en) * 2016-02-15 2019-04-16 Oppo广东移动通信有限公司 A kind of method, device and mobile terminal of differentiation image front and back scene area
JP7073817B2 (en) * 2018-03-19 2022-05-24 セイコーエプソン株式会社 Projection device and projection method
CN109978889A (en) * 2019-02-20 2019-07-05 广州视源电子科技股份有限公司 A kind of image processing method, system, device, storage medium and blackboard device
CN112784842A (en) * 2019-11-07 2021-05-11 珠海金山办公软件有限公司 Method and device for processing image, computer storage medium and terminal
CN113781292A (en) * 2021-08-23 2021-12-10 北京达佳互联信息技术有限公司 Image processing method and device, electronic device and storage medium

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5889882A (en) * 1996-03-21 1999-03-30 Eastman Kodak Company Detection of skin-line transition in digital medical imaging
JP4054125B2 (en) 1999-03-03 2008-02-27 日本放送協会 Moving image object extraction device
JP2002209082A (en) * 2001-01-12 2002-07-26 Minolta Co Ltd Image processing unit, image processing method, image processing program and computer-readable recording medium with the image processing program recorded thereon
JP2004252748A (en) * 2003-02-20 2004-09-09 Toshiba Corp Image processing method and image processor
US20090279778A1 (en) 2006-06-23 2009-11-12 Koninklijke Philips Electronics N.V. Method, a system and a computer program for determining a threshold in an image comprising image values
US20110216967A1 (en) 2008-11-19 2011-09-08 Yasufumi Hagiwara Specified color area demarcation circuit, detection circuit, and image processing apparatus using same
JP2010205067A (en) * 2009-03-04 2010-09-16 Fujifilm Corp Device, method and program for extracting area
KR100967379B1 (en) * 2009-11-04 2010-07-05 (주)올라웍스 Method, system, and computer-readable recording medium for setting initial value for graph cut
JP5470187B2 (en) 2010-07-30 2014-04-16 セコム株式会社 Image processing apparatus and object detection apparatus
CN102542544A (en) 2010-12-30 2012-07-04 北京大学 Color matching method and system
JP2013029930A (en) 2011-07-27 2013-02-07 Univ Of Tokyo Image processing device
JP5816069B2 (en) * 2011-12-07 2015-11-17 ダンロップスポーツ株式会社 Silhouette correction method and silhouette correction system
CN102490646B (en) 2011-12-30 2014-02-26 东北大学 Intelligent vehicle lamp system with driver eyesight following function and control method for intelligent vehicle lamp system
US8594423B1 (en) * 2012-01-12 2013-11-26 Google Inc. Automatic background identification in video images
EP2637139A1 (en) * 2012-03-05 2013-09-11 Thomson Licensing Method and apparatus for bi-layer segmentation
JP5826081B2 (en) 2012-03-19 2015-12-02 株式会社Pfu Image processing apparatus, character recognition method, and computer program

Also Published As

Publication number Publication date
CN104580883A (en) 2015-04-29
CN104580883B (en) 2018-05-29
JP2015075920A (en) 2015-04-20
US9679386B2 (en) 2017-06-13
US20150098648A1 (en) 2015-04-09

Similar Documents

Publication Publication Date Title
JP5811416B2 (en) Image processing apparatus, image processing method, and program
US11410277B2 (en) Method and device for blurring image background, storage medium and electronic apparatus
CN110248085B (en) Apparatus and method for object boundary stabilization in images of an image sequence
EP2902941B1 (en) System and method for visually distinguishing faces in a digital image
CN108765278B (en) Image processing method, mobile terminal and computer readable storage medium
CN107771336B (en) Feature detection and masking in images based on color distribution
CN110163076B (en) Image data processing method and related device
US9245350B1 (en) Image-based color palette generation
US9311889B1 (en) Image-based color palette generation
JP2019504386A (en) Facial image processing method and apparatus, and storage medium
JP6089886B2 (en) Region dividing method and inspection apparatus
JP2020530920A (en) Image lighting methods, devices, electronics and storage media
EP2863362B1 (en) Method and apparatus for scene segmentation from focal stack images
CN109951635A (en) It takes pictures processing method, device, mobile terminal and storage medium
CN111539269A (en) Text region identification method and device, electronic equipment and storage medium
JP7379684B2 (en) Image generation method and device and computer program
WO2016107229A1 (en) Icon displaying method and device, and computer storage medium
JP2016122367A (en) Image processor, image processing method and program
JP2016197377A (en) Computer program for image correction, image correction device, and image correction method
CN111107264A (en) Image processing method, image processing device, storage medium and terminal
JP2016122367A5 (en)
CN108805883A (en) A kind of image partition method, image segmentation device and electronic equipment
CN114792283A (en) Image processing method, device and equipment and computer readable storage medium
WO2014177756A1 (en) Method, apparatus and computer program product for segmentation of objects in images
CN113034449A (en) Target detection model training method and device and communication equipment

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150512

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150512

A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20150514

A975 Report on accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A971005

Effective date: 20150603

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150609

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150803

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150902

R150 Certificate of patent or registration of utility model

Ref document number: 5811416

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150