JP6900016B2 - Image area extraction processing method and image area extraction processing program - Google Patents

Image area extraction processing method and image area extraction processing program Download PDF

Info

Publication number
JP6900016B2
JP6900016B2 JP2019153742A JP2019153742A JP6900016B2 JP 6900016 B2 JP6900016 B2 JP 6900016B2 JP 2019153742 A JP2019153742 A JP 2019153742A JP 2019153742 A JP2019153742 A JP 2019153742A JP 6900016 B2 JP6900016 B2 JP 6900016B2
Authority
JP
Japan
Prior art keywords
line drawing
image area
region
image
colored
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
JP2019153742A
Other languages
Japanese (ja)
Other versions
JP2021033686A (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.)
Celsys Inc
Original Assignee
Celsys Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Celsys Inc filed Critical Celsys Inc
Priority to JP2019153742A priority Critical patent/JP6900016B2/en
Publication of JP2021033686A publication Critical patent/JP2021033686A/en
Application granted granted Critical
Publication of JP6900016B2 publication Critical patent/JP6900016B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、画像領域抽出処理方法及び画像領域抽出処理プログラムに関する。 The present invention relates to an image area extraction processing method and an image area extraction processing program.

従来、コンピュータでデジタル画像に彩色する際には、ユーザがカラーパレットから任意の色彩を選び、直接彩色するか、または、線画などで閉領域を作成し、当該閉領域全体を塗りつぶすなどの手法が採られていた。 Conventionally, when coloring a digital image with a computer, the user selects an arbitrary color from the color palette and colors it directly, or creates a closed area with a line drawing and fills the entire closed area. It was taken.

しかし、アニメ制作のように彩色を前提としたトレース線による閉領域においては、トーンパターン(スクリーントーン)や細かな書き込み描写が多く、細かな領域が多数存在するため、手作業の切り抜きや彩色に手間がかかるという問題があった。 However, in a closed area with trace lines that are premised on coloring as in animation production, there are many tone patterns (screen tones) and detailed writing depictions, and there are many small areas, so it is necessary to manually cut out and color. There was a problem that it took time and effort.

また、近年の画像制作においては、いわゆるペンタッチなどの書き味が重要視されており、線が途中で切れた線切れが多数見受けられる。そのため、彩色の作業者は、人物や背景などを目視により確認して輪郭線を把握し、デジタル画像の領域を適切に細かく切り抜くなど、輪郭を特定する入力操作を行って、その輪郭に彩色を行っている。そのため、デジタル画像処理上での彩色作業に時間がかかる上に、彩色結果に個人差が生ずるという問題もあった。 Further, in recent image production, the writing taste such as so-called pen touch is regarded as important, and many line breaks can be seen in the middle. Therefore, the coloring worker visually confirms the person, the background, etc., grasps the contour line, performs an input operation for specifying the contour, such as appropriately finely cutting out the area of the digital image, and colors the contour. Is going. Therefore, there is a problem that the coloring work on the digital image processing takes time and the coloring result varies from person to person.

このため、未彩色の線画において描画線で規定された領域を彩色して彩色線画を得る彩色処理装置であって、未彩色の線画の画像解析によって前記線画の特徴量を抽出する特徴量抽出手段と、前記特徴量に基づいて前記線画の描画面を複数の閉領域に分離する領域分離手段と、前記特徴量との関連において規定された所定のルールによって、前記複数の閉領域を、複数種類のオブジェクトに類別して認識するオブジェクト認識手段と、オブジェクトとして認識された閉領域を囲む描画線の線切れを補正することにより閉曲線を得る線切れ補正手段と、前記閉曲線で囲まれた部分領域を前記描画面から切り出して切出領域を得る閉領域切出手段と、各オブジェクトに対応してあらかじめ定めておいた彩色情報に基づいて、前記オブジェクトとして認識された閉領域に対応する前記切出領域を彩色する彩色手段と、を備えることを特徴とする彩色処理装置などが提案されていた(例えば、特許文献1)。 Therefore, it is a coloring processing device that obtains a colored line drawing by coloring a region defined by a drawing line in an uncolored line drawing, and is a feature amount extraction means for extracting the feature amount of the line drawing by image analysis of the uncolored line drawing. A plurality of types of the plurality of closed regions are provided according to a region separating means for separating the drawing surface of the line art into a plurality of closed regions based on the feature quantity and a predetermined rule defined in relation to the feature quantity. An object recognition means for classifying and recognizing an object, a line break correction means for obtaining a closed curve by correcting a line break of a drawing line surrounding a closed area recognized as an object, and a partial area surrounded by the closed curve. The cutout area corresponding to the closed area recognized as the object based on the closed area cutting means for obtaining the cutout area by cutting out from the drawing surface and the coloring information predetermined for each object. A coloring processing apparatus or the like characterized by comprising a coloring means for coloring is proposed (for example, Patent Document 1).

また、ニューラルネットワークを利用して自動彩色を行う技術の例としては、出願人の技術であるCLIP STUDIO PAINT(非特許文献1)、また出願人以外が運営するPaintsChainer(非特許文献2)のウェブサイトが挙げられる。当該技術は、未彩色の線画において描画線で規定された領域を彩色して彩色画像を得る彩色処理技術である。 Further, as an example of the technology for performing automatic coloring using a neural network, CLIP STUDIO PAINT (Non-Patent Document 1), which is the technology of the applicant, and the website of Paints Chainer (Non-Patent Document 2) operated by a person other than the applicant. The site can be mentioned. This technique is a coloring processing technique for obtaining a colored image by coloring a region defined by a drawing line in an uncolored line drawing.

しかしながら、上記技術(特許文献1)は、トーンパターン領域に対して縮小や平均化を施して得られる中間階調領域を利用している。そのため、トーンパターンが使われていない線画のみの画像では、殆ど彩色効果が得られない。 However, the above technique (Patent Document 1) utilizes an intermediate gradation region obtained by reducing or averaging the tone pattern region. Therefore, the coloring effect can hardly be obtained with the image of only the line drawing in which the tone pattern is not used.

また、CLIP STUDIO PAINTおよびPaintsChainerでは、線画の自動彩色に関しては、未着色領域に対して自動的に彩色をする機能が提示されているにとどまっている。 In addition, CLIP STUDIO PAINT and PaintsChainer only offer a function to automatically color uncolored areas for automatic coloring of line drawings.

特開2009−134410号公報JP-A-2009-134410

CLIP STUDIO PAINT[アクセス日:2019年6月25日]、インターネット<https://www.clip-studio.com/clip_site/>CLIP STUDIO PAINT [Access date: June 25, 2019], Internet <https://www.clip-studio.com/clip_site/> PaintsChainer [アクセス日:2019年6月26日]、インターネット<https://paintschainer.preferred.tech/index_ja.html>PaintsChainer [Access date: June 26, 2019], Internet <https://paintschainer.preferred.tech/index_ja.html>

開示の技術は、閉じていない線を含む線画から領域をより適切に抽出することで、この抽出された領域を簡便に利用できるようにすることを目的とする。 The disclosed technique aims to make it easier to use the extracted region by more appropriately extracting the region from the line drawing including the unclosed line.

開示の技術は、線画と彩色が施された線画とを教師データとして機械学習した、入力された線画から彩色を施した画像を出力する画像変換モデルを用いて、対象の線画を彩色済線画に変換するステップと、前記彩色済線画の中から所定の色(1つ若しくは複数の色、1つの色範囲若しくは複数の色範囲)に彩色された画像領域を抽出するステップと、を有する画像領域抽出処理方法を提供する。
また、開示の技術は、上記方法をコンピュータに実行させるプログラム及び当該プログラムを記録した媒体を提供する。
The disclosed technology uses an image conversion model that outputs a colored image from an input line drawing, which is machine-learned using a line drawing and a colored line drawing as teacher data, to convert the target line drawing into a colored line drawing. Image area extraction having a step of converting and a step of extracting an image area colored in a predetermined color (one or more colors, one color range or a plurality of color ranges) from the colored line drawing. Provides a processing method.
The disclosed technology also provides a program that causes a computer to execute the above method and a medium on which the program is recorded.

開示の技術によれば、閉じていない線を含む線画から領域をより適切に抽出することで、この抽出された領域を簡便に利用できるようにすることができる。 According to the disclosed technique, by more appropriately extracting a region from a line drawing including an unclosed line, the extracted region can be easily used.

図1(A)は、閉じていない爪の領域の例を示す図である。図1(B)は、一実施形態を利用して閉じていない爪の領域を抽出した例を示した図である。FIG. 1A is a diagram showing an example of an unclosed nail region. FIG. 1B is a diagram showing an example in which an unclosed nail region is extracted using one embodiment. 図2は、一実施形態のブロック図を示している。FIG. 2 shows a block diagram of one embodiment. 図3は、一実施形態のプログラム又は方法が実行されるハードウェア構成を示している。FIG. 3 shows a hardware configuration in which a program or method of one embodiment is executed. 図4(A)は、AIを用いて彩色が行われた例を示している。図4(B)は、彩色された領域が選択された例を示した図である。FIG. 4A shows an example in which coloring is performed using AI. FIG. 4B is a diagram showing an example in which a colored region is selected. 図5(A)は、図4(A)と異なるAIを用いて彩色を行った例を示す図である。図5(B)は、図5(A)において彩色された領域を選択した例を示した図である。FIG. 5 (A) is a diagram showing an example in which coloring is performed using an AI different from that of FIG. 4 (A). FIG. 5B is a diagram showing an example in which the colored region is selected in FIG. 5A. 図6は、図5(A)と同じAIを用いて彩色を行った後にエッジ保持型平滑化処理を施した後の例を示す図である。図6(B)は、図6(A)において彩色された領域を選択した例を示した図である。FIG. 6 is a diagram showing an example after coloring is performed using the same AI as in FIG. 5A and then edge-retaining smoothing treatment is performed. FIG. 6B is a diagram showing an example in which the colored region is selected in FIG. 6A. 図7(A)は、図6(A)の画像に、図6(B)とは異なる閾値を指定して、領域を選択した場合の例を示した図である。図7(B)は、図7(A)とは異なる閾値を指定して、領域を選択した場合の例を示した図である。FIG. 7 (A) is a diagram showing an example in which a region is selected by designating a threshold value different from that of FIG. 6 (B) in the image of FIG. 6 (A). FIG. 7B is a diagram showing an example in which a region is selected by designating a threshold value different from that in FIG. 7A. 図8(A)は、図7(B)で選択した領域を用いて、爪の部分の先端の部分に線画を加えることで爪の部分を閉じた線画にした例を示した図である。図8(B)は、図7(A)の爪の部分に異なる色で彩色した例を示した図である。FIG. 8 (A) is a diagram showing an example in which the nail portion is closed by adding a line drawing to the tip portion of the nail portion using the region selected in FIG. 7 (B). FIG. 8B is a diagram showing an example in which the nail portion of FIG. 7A is colored with a different color. 図9(A)は、閉じた線画の爪の部分の彩色を削除した例である。図9(B)は、閉じた線画の爪の分に他の画像を張り付けた例を示した図である。FIG. 9A is an example in which the coloring of the nail portion of the closed line drawing is deleted. FIG. 9B is a diagram showing an example in which another image is attached to the claw portion of the closed line drawing. 図10(A)は、図6(A)によって得られた、閉じていない線画を含む爪の画像を抽出した例を示した図である。図10(B)は、図8(B)によって得られた閉じた線画を含む爪の画像を抽出した例を示した図である。図10(C)は、図9(A)によって得られた閉じた線画を含む爪の画像を抽出した例を示した図である。図10(D)は、図9(A)で得られた画像から、彩色された部分を取り除いて、線画を得た例を示す図である。FIG. 10 (A) is a diagram showing an example of extracting an image of a nail including an unclosed line drawing obtained by FIG. 6 (A). FIG. 10B is a diagram showing an example of extracting an image of a nail including a closed line drawing obtained by FIG. 8B. FIG. 10 (C) is a diagram showing an example of extracting an image of a nail including a closed line drawing obtained by FIG. 9 (A). FIG. 10 (D) is a diagram showing an example in which a line drawing is obtained by removing a colored portion from the image obtained in FIG. 9 (A). 図11は、AIによる彩色の機能の学習の例を示す図である。FIG. 11 is a diagram showing an example of learning the coloring function by AI. 図12は、一実施形態の画像の加工の例を示したフローチャートである。FIG. 12 is a flowchart showing an example of image processing of one embodiment. 図13は、AIによる彩色の後に、必要に応じて彩色の修正を行い、所定の色の領域を抽出する例を示した図である。図13においては、この例では必要がないため、彩色の修正を行わずに所定の色の領域を抽出する例を示す。FIG. 13 is a diagram showing an example in which a region of a predetermined color is extracted by correcting the coloring as necessary after coloring by AI. In FIG. 13, since it is not necessary in this example, an example of extracting a predetermined color region without modifying the coloring is shown. 図14は、必要に応じて彩色の修正を行い、所定の色の領域を抽出する例を示した図である。彩色の修正の例としてエッジ保持型平滑化処理を行った後に、所定の色の領域を抽出する例を示す。FIG. 14 is a diagram showing an example in which a predetermined color region is extracted by correcting the coloring as necessary. As an example of color correction, an example of extracting a predetermined color region after performing edge-preserving smoothing processing is shown. 図15は、抽出された領域の画像の加工の例を示した図である。FIG. 15 is a diagram showing an example of processing an image of the extracted region.

以下に、図面を参照しながら、開示の技術の実施形態について説明する。なお、以下の各実施形態は、相互に排他的なものではない。矛盾の無い限り、ある実施形態の一部は、他の実施形態の一部と入れ替えたり、結合させたりすることができる。また、開示されたフローの各ステップは、矛盾の無い限り、入れ替えることができる。また、各フローは同時に実行することもできる。実施形態の一部は、プログラム又はハードウェアのいずれでも実現することができる。また、プログラムの一部は、オペレーティングシステムの機能を利用することができる。プログラムは、可搬型の記録媒体に記録させることができる。 Hereinafter, embodiments of the disclosed technology will be described with reference to the drawings. The following embodiments are not mutually exclusive. As long as there is no contradiction, some of the embodiments may be replaced or combined with some of the other embodiments. In addition, each step of the disclosed flow can be replaced as long as there is no contradiction. Also, each flow can be executed at the same time. Some of the embodiments can be implemented either in programs or in hardware. In addition, a part of the program can utilize the functions of the operating system. The program can be recorded on a portable recording medium.

なお、図面はモノクロ画像を用いている。したがって、カラーの濃淡などは、便宜上、グレースケールで表現されている点に留意すべきである。実際の実施形態では、カラーの画素で構成された画像を用いることができる。そして、色を指定したり、色に対する閾値を指定したりする場合には、閾値に色の彩度、明度又は色相或いはこれらの組合せを用いることができる。 The drawings use monochrome images. Therefore, it should be noted that the shades of color are expressed in gray scale for convenience. In an actual embodiment, an image composed of color pixels can be used. When a color is specified or a threshold value for a color is specified, color saturation, lightness, hue, or a combination thereof can be used as the threshold value.

図1(A)は、閉じていない爪の領域の例を示す図である。図1(B)は、閉じていない爪の領域を抽出した例を示した図である。
図1(A)に示されるように、キャンバス100に、爪1018と指800との線画が描かれている。指800は、指801の線画と指802の線画とキャンバス100の枠線とで閉領域を形成している。
FIG. 1A is a diagram showing an example of an unclosed nail region. FIG. 1B is a diagram showing an example of extracting a region of a nail that is not closed.
As shown in FIG. 1A, a line drawing of a nail 1018 and a finger 800 is drawn on the canvas 100. The finger 800 forms a closed region with the line drawing of the finger 801 and the line drawing of the finger 802 and the frame line of the canvas 100.

これに対して、爪1018は、その線画1010が、線画の端1012及び線画の端1014において開いている。このため、爪1018は閉領域を形成しておらず、背景1019につながっている。このため、閉領域となっていない開いた線画を有する爪1018を選択したり抽出したりすることは容易ではない。図1(B)は、爪の線画1010aを抽出した様子を示している。指の線画1010aが、線画の端1012a及び線画の端1014aにおいて開いている。このため、開いた曲線で構成されている爪の線画1010aを抽出することは、閉曲線を選択する一般的なアルゴリズムを利用して抽出することはできない。
以下に説明する実施形態では、このような開いた曲線で構成される爪の線画1010aであっても、容易に抽出したり加工したりすることを可能とさせる。
On the other hand, the line drawing 1010 of the claw 1018 is open at the end 1012 of the line drawing and the end 1014 of the line drawing. Therefore, the claw 1018 does not form a closed region and is connected to the background 1019. For this reason, it is not easy to select or extract a nail 1018 having an open line drawing that is not a closed region. FIG. 1B shows a state in which the line drawing 1010a of the nail is extracted. The line drawing 1010a of the finger is open at the end 1012a of the line drawing and the end 1014a of the line drawing. Therefore, the extraction of the nail line drawing 1010a composed of the open curve cannot be extracted by using a general algorithm for selecting the closed curve.
In the embodiment described below, even the line drawing 1010a of the nail composed of such an open curve can be easily extracted and processed.

図2は、一実施形態である画像領域抽出処理装置200のブロック図を示している。画像領域抽出処理装置200は、彩色部202、エッジ保持型平滑化処理部204、領域抽出部206、画像加工部208及び表示部210を有する。 FIG. 2 shows a block diagram of the image area extraction processing device 200 according to the embodiment. The image area extraction processing device 200 includes a coloring unit 202, an edge-holding type smoothing processing unit 204, an area extraction unit 206, an image processing unit 208, and a display unit 210.

彩色部202には、元線画が入力される。彩色部では、AIを利用して、元線画に対して彩色が施される。なお、彩色部のAIに対する学習のさせ方については後述する。 The original line drawing is input to the coloring unit 202. In the coloring section, AI is used to color the original line drawing. The method of learning the AI of the coloring part will be described later.

彩色部202で彩色された画像は、SW1によって、領域抽出部206に与えられる。あるいは、SW1によって、彩色部202で彩色された画像は、エッジ保持型平滑化処理部204で補正された後に、領域抽出部206に与えられる。
エッジ保持型平滑化処理部204は、彩色された線画のうち、エッジを持つ線画部分を保持しつつ、彩色された部分の画像を平滑化する機能を有する。
The image colored by the coloring unit 202 is given to the region extraction unit 206 by SW1. Alternatively, the image colored by the coloring unit 202 by SW1 is given to the region extraction unit 206 after being corrected by the edge holding type smoothing processing unit 204.
The edge-holding type smoothing processing unit 204 has a function of smoothing the image of the colored part while holding the line drawing part having an edge in the colored line drawing.

エッジ保持型平滑化は、空間フィルタリングの処理技術である。一般的な「ぼかし」などの平滑化の処理では、エッジを持つ線画部分も含めて全体的に画像を滑らかにする「ぼかし」の処理が施される。これに対してエッジ保持型平滑化は画像中の大きな輝度勾配(エッジ)は保ちつつも、小さな輝度勾配だけを滑らかにする処理である。本実施形態では、大きな輝度勾配が存在する線画の部分の形状は保持され、小さな輝度勾配で構成される色の濃淡を含む彩色された部分は平滑化が施される。
このような、エッジ保持型平滑化処理の技術は、例えば当業者に知られている以下の技術で実現できる。
Edge-preserving smoothing is a spatial filtering processing technique. In a general smoothing process such as "blurring", a "blurring" process is performed to smooth the image as a whole including the line drawing portion having an edge. On the other hand, edge-preserving smoothing is a process of smoothing only a small luminance gradient while maintaining a large luminance gradient (edge) in an image. In the present embodiment, the shape of the line drawing portion having a large luminance gradient is maintained, and the colored portion including the shade of color composed of the small luminance gradient is smoothed.
Such an edge-retaining smoothing technique can be realized by, for example, the following techniques known to those skilled in the art.

例えば、「バイラテラルフィルタ」は、最も基本的なエッジ保持型平滑化処理を行うことができるフィルタである。このフィルタの基本的な処理は、画素間の色の違いと位置の隔たりとの両方に応じて近ければ近いほど重みが大きくなるフィルタである。ガウス関数を使った「ぼかし」のように画素間の距離のみで重みを決めるのではなく、画素の輝度の差も見て、変化が大きいところは重みを小さくすることによってエッジを残す処理を施すフィルタ処理がなされる。
なお、エッジ保持型平滑化処理が施された画像への処理の具体例は、図5及び図6において説明する。
For example, a "bilateral filter" is a filter capable of performing the most basic edge-preserving smoothing process. The basic processing of this filter is a filter in which the closer the color is, the greater the weight is, depending on both the color difference between the pixels and the position difference. Instead of determining the weight only by the distance between pixels like "blurring" using the Gaussian function, the difference in the brightness of the pixels is also seen, and where there is a large change, the weight is reduced to leave an edge. Filtering is done.
Specific examples of processing on the image to which the edge-holding type smoothing process has been performed will be described with reference to FIGS. 5 and 6.

領域抽出部206は、例えば、オペレータからの色の指定と、画像の場所の指定とを受け取ることができる。この場合には、領域抽出部206は、指定された画像領域の周辺において、指定された色の領域を特定する。色の指定には、色の三要素である、色相、明度又は彩度の組合せで、色を指定できる。色の指定には、グレースケールによるグレーの濃淡の指定が含まれ得る。 The area extraction unit 206 can receive, for example, a color designation from the operator and a designation of the location of the image. In this case, the region extraction unit 206 identifies a region of a designated color around the designated image region. To specify a color, a color can be specified by a combination of hue, lightness, or saturation, which are three elements of color. Color designations can include grayscale designations of shades of gray.

また、閾値は、ある幅を持たせた上下の閾値を持つ範囲を設定できる。また、オペレータの指示に基づき、特定される領域を広げる指示があれば、上下の閾値のいずれか又は両方の値を変更させて、上下の閾値で規定される範囲の広狭を変更できるようにさせてもよい。閾値を変更することで、特定される画像の領域を変化させる例は図7を用いて説明する。 Further, the threshold value can be set to a range having upper and lower threshold values having a certain width. In addition, if there is an instruction to expand the specified area based on the operator's instruction, the value of either or both of the upper and lower threshold values can be changed so that the width of the range defined by the upper and lower threshold values can be changed. You may. An example of changing the area of the specified image by changing the threshold value will be described with reference to FIG. 7.

画像加工部208は、抽出された画像領域に対して、種々の加工を施すことができる。例えば、抽出された領域を彩色すること、色を除去すること、抽出された画像以外の領域を除去すること、抽出された領域を他の画像に置き換えることなどを行うことができる。 The image processing unit 208 can perform various processing on the extracted image area. For example, it is possible to color the extracted region, remove the color, remove the region other than the extracted image, replace the extracted region with another image, and the like.

図2におけるSW1は、彩色部202からの出力画像が、領域抽出部206に直接与えられるようにするか(SW1の接点221と接点220とが接続される。)、エッジ保持型平滑化処理部204を経由して領域抽出部206に与えられるか(SW1の接点221と接点222とが接続される。)の2つの経路選択が行えるようになっている。 In FIG. 2, SW1 allows the output image from the coloring unit 202 to be directly given to the area extraction unit 206 (the contact 221 and the contact 220 of SW1 are connected), or the edge holding type smoothing processing unit. Two routes can be selected, either given to the region extraction unit 206 via 204 (contact 221 and contact 222 of SW1 are connected).

図3は、一実施形態のプログラム又は方法が実行されるハードウェア構成300を示している。実施形態は、クライアント端末で入力された線画を、ネットワークを経由してサーバ装置に送り、該サーバ装置により実行されてもよい。或いは、クライアント端末が、実施形態の処理を行ってもよい。したがって、図3に示すハードウェア構成300は、クライアント端末又はサーバ装置のいずれの装置における構成にも当てはまるものである。 FIG. 3 shows a hardware configuration 300 in which the program or method of one embodiment is executed. In the embodiment, the line drawing input by the client terminal may be sent to the server device via the network and executed by the server device. Alternatively, the client terminal may perform the processing of the embodiment. Therefore, the hardware configuration 300 shown in FIG. 3 applies to the configuration of either the client terminal or the server device.

ハードウェア構成300は、ROM303、RAM305、入力部307、通信部309、表示部311、外部記憶制御部313を有する。外部記憶制御部313は、メモリ315に対してデータ又はプログラムの読み出し、書き込みが可能である。
実施形態を実現するプログラムは、メモリ315、ROM303又はRAM305に記憶され得る。
The hardware configuration 300 includes a ROM 303, a RAM 305, an input unit 307, a communication unit 309, a display unit 311 and an external storage control unit 313. The external storage control unit 313 can read and write data or a program to the memory 315.
The program that implements the embodiment may be stored in memory 315, ROM 303 or RAM 305.

図4(A)は、AIを用いて彩色が行われた例を示している。図4(B)は、彩色された領域が選択された例を示した図である。
図4(A)では、指802と爪1041に彩色が施されている。この彩色は、後述するように、例えばディープラーニングのアルゴリズムの一つであるGAN(Generative Adversarial Network)を使って学習したAIを用いた彩色部202により、入力された線画に彩色を施して生成された彩色画像の例である。既に述べたように、図4では、グレースケールで表現されているが、実際の彩色画像は、色を有する画像である。図4(A)の彩色画像では、爪の線画1010の先端における線画の端1042及び線画の端1044の周辺位置にも、爪の形状と近似した彩色が施されている。したがって、爪の線画1010が、閉じた線画でないにもかかわらず、AIによって適切な彩色が施された例である。この例は、理想的な例である。この場合には、彩色された爪1041の領域の一部の位置と、彩色された色とをオペレータが指定すれば、指定された色と略同一の色(或いは、彩色された爪1041の一部の位置をオペレータが指定することによって、その一部の位置の周辺の彩色された色と略同色の色)の領域が特定される。ここで、略同色とは、指定された色と所定の複数の閾値で規定された色に該当する色を意味する。閾値は、既に述べたように、色の彩度、明度又は色相或いはこれらの組合せ(グレースケールを含む)に対応する閾値である。閾値は、複数の閾値を設定することにより、所定の色の範囲を特定することができる。
FIG. 4A shows an example in which coloring is performed using AI. FIG. 4B is a diagram showing an example in which a colored region is selected.
In FIG. 4A, the finger 802 and the nail 1041 are colored. As will be described later, this coloring is generated by coloring the input line drawing by the coloring unit 202 using AI learned using, for example, GAN (Generative Adversarial Network), which is one of the deep learning algorithms. This is an example of a colored image. As already described, in FIG. 4, it is represented in gray scale, but the actual colored image is an image having color. In the colored image of FIG. 4A, the peripheral positions of the line drawing end 1042 and the line drawing end 1044 at the tip of the nail line drawing 1010 are also colored to resemble the shape of the nail. Therefore, the nail line drawing 1010 is an example in which the nail line drawing is appropriately colored by AI even though it is not a closed line drawing. This example is an ideal example. In this case, if the operator specifies a part of the area of the colored nail 1041 and the colored color, the color is substantially the same as the specified color (or one of the colored nails 1041). By specifying the position of the part by the operator, the area of the colored color around the part of the position) is specified. Here, substantially the same color means a color corresponding to a designated color and a color defined by a plurality of predetermined threshold values. As already mentioned, the threshold value is a threshold value corresponding to color saturation, lightness or hue, or a combination thereof (including gray scale). As the threshold value, a predetermined color range can be specified by setting a plurality of threshold values.

図4(B)は、彩色された領域が選択(特定)された例を示した図である。選択(特定)された爪1041aの領域が、ハッチングで示されている。開いた線画で構成される爪の線画1010aには、依然として、線画の端1042a及び線画の端1044aが存在している。 FIG. 4B is a diagram showing an example in which a colored region is selected (specified). The area of the selected (specified) claw 1041a is shown by hatching. In the line drawing 1010a of the nail composed of the open line drawing, the end 1042a of the line drawing and the end 1044a of the line drawing still exist.

このように、線画に対して、AIを利用して、彩色処理を施すことにより、開いた線画で構成される爪の線画1010aであっても、適切に、爪の部分を選択(特定)することができる。このようにすることで、容易に、選択された爪1041aの部分を抽出したり、画像を編集したりすることが可能となる。 In this way, by applying a coloring process to the line drawing using AI, even if it is a nail line drawing 1010a composed of an open line drawing, the nail portion is appropriately selected (specified). be able to. By doing so, it is possible to easily extract the selected portion of the nail 1041a and edit the image.

図5(A)は、図4(A)と異なるAIを用いて彩色を行った例を示す図である。図5(B)は、図5(A)において彩色された領域を選択した例を示した図である。 FIG. 5 (A) is a diagram showing an example in which coloring is performed using an AI different from that of FIG. 4 (A). FIG. 5B is a diagram showing an example in which the colored region is selected in FIG. 5A.

図5(A)では、異なるAIアルゴリズムを適用して爪の線画1010の内部を彩色している。この場合には、領域1056付近において、彩色の明度が極端に変化しており、領域1055においては、彩色がなされているが、領域1057の部分においては、背景色と同じ白色となっており、彩色が施されていないこととなっている。 In FIG. 5A, a different AI algorithm is applied to color the inside of the nail line drawing 1010. In this case, the brightness of the coloring changes extremely in the vicinity of the area 1056, and the area 1055 is colored, but the area 1057 is white, which is the same as the background color. It is supposed to be uncolored.

図5(B)は、図5(A)において彩色された領域を選択した例を示した図である。このような場合に、オペレータが、領域1055のある部分の位置を指定して、領域抽出部206に対して、その指定された位置と略同色の領域を選択させると、爪の線画1010aの内部の領域1055aについては、選択(特定)されている状態となる。しかしながら、領域1055aは、境界1056aまで選択された状態となり、領域1057aの部分については、選択(特定)されないこととなる。 FIG. 5B is a diagram showing an example in which the colored region is selected in FIG. 5A. In such a case, when the operator specifies the position of a certain part of the area 1055 and causes the area extraction unit 206 to select an area having substantially the same color as the specified position, the inside of the nail line drawing 1010a is formed. Region 1055a is in the selected (specified) state. However, the region 1055a is in a state of being selected up to the boundary 1056a, and the portion of the region 1057a is not selected (specified).

AIを用いた彩色部202を用いると、同じAIであっても、線画のパターンの微妙な異なり、パラメータの設定の違い、学習の度合いの違いなどにより、図5(A)及び図5(B)のような状況が起こり得る。
図5のような状況にも対応するために、以下の手法を用いることが有用である。
When the coloring unit 202 using AI is used, even if the AI is the same, FIGS. 5 (A) and 5 (B) are due to slight differences in line drawing patterns, differences in parameter settings, differences in the degree of learning, and the like. ) Can occur.
In order to cope with the situation as shown in FIG. 5, it is useful to use the following method.

図6は、図5(A)と同じAIを用いて彩色を行いった後にエッジ保持型平滑化処理を施した後の例を示す図である。図6(B)は、図6(A)において彩色された領域を選択した例を示した図である。 FIG. 6 is a diagram showing an example after coloring is performed using the same AI as in FIG. 5 (A) and then edge-retaining smoothing processing is performed. FIG. 6B is a diagram showing an example in which the colored region is selected in FIG. 6A.

図6(A)は、図5(A)と同じAIを用いて彩色を行った後に、図5における爪の彩色された領域1055、1056、及び1057に対して、エッジ保持型平滑化処理を施した後の領域1065の例を示す図である。 In FIG. 6 (A), after coloring using the same AI as in FIG. 5 (A), the edge-retaining smoothing process is applied to the colored regions 1055, 1056, and 1057 of the nail in FIG. It is a figure which shows the example of the region 1065 after the application.

図6(A)に示されるように、エッジ保持型平滑化処理を施した爪の領域1065は、爪の線画1010の画像が保持されており、彩色領域については、領域1067の部分まで彩色が施された状態となっていることが分かる。
図6(B)は、図6(A)において彩色された領域1065及び1067のうちの一部の位置を指定して爪の領域を選択した例を示した図である。
As shown in FIG. 6 (A), the image of the nail line drawing 1010 is held in the nail region 1065 subjected to the edge-holding type smoothing treatment, and the colored region is colored up to the region 1067. It can be seen that it is in a state of being applied.
FIG. 6B is a diagram showing an example in which a nail region is selected by designating a position of a part of the colored regions 1065 and 1067 in FIG. 6A.

図6(B)においては、領域1067aの部分まで、彩色がなされているので、斜線で示す選択(特定)された部分は、1065a及び1067aを含めた爪の領域全体に及んでいることが分かる。 In FIG. 6B, since the portion of the region 1067a is colored, it can be seen that the selected (specified) portion indicated by the diagonal line covers the entire region of the nail including the 1065a and 1067a. ..

このように、図6(A)に示すように、エッジ保持型平滑化処理を施すことにより、エッジを含む線画を平滑化することなく、爪の部分の領域について、彩色を平滑化することができる。このようにすることにより、彩色部202における彩色が、一部の領域に偏った形で彩色がなされた場合であっても、エッジ保持型平滑化処理を施すことで、適切な爪の領域を選択(特定)することができる。 In this way, as shown in FIG. 6A, by performing the edge-holding type smoothing process, it is possible to smooth the coloring of the nail portion region without smoothing the line drawing including the edges. it can. By doing so, even when the coloring in the coloring portion 202 is biased to a part of the region, the edge-retaining smoothing process is performed to obtain an appropriate nail region. Can be selected (specified).

図7(A)は、図6(A)の画像に、図6(B)とは異なる閾値を指定して、領域を選択した場合の例を示した図である。図7(B)は、図7(A)とは異なる閾値を指定して、彩色された領域を選択した場合の例を示した図である。 FIG. 7 (A) is a diagram showing an example in which a region is selected by designating a threshold value different from that of FIG. 6 (B) in the image of FIG. 6 (A). FIG. 7B is a diagram showing an example in which a colored region is selected by designating a threshold value different from that in FIG. 7A.

図7(A)では、色に関する閾値が適切でないために、爪の先端の彩色された領域1077bが選択されていない例を示している。選択された領域1075bは、爪の先端部の境界1076bまで選択されている。 FIG. 7A shows an example in which the colored region 1077b at the tip of the nail is not selected because the color threshold is not appropriate. The selected region 1075b is selected up to the boundary 1076b at the tip of the nail.

図7(B)は、図7(A)とは異なる閾値を指定して、領域を選択した場合の例を示した図である。この場合には、図7(A)とは異なる閾値が指定されているため、1077cの領域まで選択されている。したがって、境界領域1076cは、爪の先端部分と整合しており、適切な境界領域となっている。 FIG. 7B is a diagram showing an example in which a region is selected by designating a threshold value different from that in FIG. 7A. In this case, since a threshold value different from that in FIG. 7A is specified, the region up to 1077c is selected. Therefore, the boundary region 1076c is aligned with the tip portion of the nail, and is an appropriate boundary region.

このように、選択するべき色の閾値を調整することによって、爪の部分の領域を適切に選択(特定)することができる。なお、閾値が指定される際に、オペレータが彩色画像又はエッジ保持型平滑化処理が施された彩色画像を表示画面上で確認できるようにすることが望ましい。このようにすることによって、オペレータは、彩色処理自体が適切か不適切か、閾値を調整することが重要であるのか、エッジ保持型平滑化処理における平滑化のパラメータの指定が重要であるのかを確認することができる。 By adjusting the threshold value of the color to be selected in this way, the region of the nail portion can be appropriately selected (specified). When the threshold value is specified, it is desirable that the operator can confirm the colored image or the colored image subjected to the edge-preserving smoothing process on the display screen. By doing so, the operator can determine whether the coloring process itself is appropriate or inappropriate, whether it is important to adjust the threshold value, or whether it is important to specify the smoothing parameters in the edge-preserving smoothing process. You can check.

また、エッジ保持型平滑化処理のパラメータ及び閾値については、オペレータの作業を軽減させるため、デフォルト値をあらかじめ定めておくことが望ましい。或いは、これらの値のペアを予め複数用意して、オペレータに選択させるようにしてもよい。また、このような選択がなされた場合には、オペレータにこのような値の微調整を行えるようにさせることが望ましい。 In addition, it is desirable to set default values for the parameters and threshold values of the edge retention type smoothing process in advance in order to reduce the work of the operator. Alternatively, a plurality of pairs of these values may be prepared in advance so that the operator can select them. It is also desirable to allow the operator to fine-tune such values when such a selection is made.

図8(A)は、図7(B)で選択した領域を用いて、爪の部分の先端の部分に線画を加えることで爪の部分を閉じた線画にした例を示した図である。図8(B)は、図7(A)の爪の部分に異なる色で彩色した例を示した図である。 FIG. 8 (A) is a diagram showing an example in which the nail portion is closed by adding a line drawing to the tip portion of the nail portion using the region selected in FIG. 7 (B). FIG. 8B is a diagram showing an example in which the nail portion of FIG. 7A is colored with a different color.

図8(A)においては、例えば、図74(B)、図6(B)、又は図7(C)におけるように、適切に爪の部分が選択(特定)された場合に、線の端1042と線の端1044とを、選択領域の境界に沿って曲線1083dを加えて、爪の線画1080dを閉領域にする例を示している。
このようにすることによって、閉領域を形成していなかった爪の線画1010を、閉領域を形成する爪の線画1080dに修正することができる。
In FIG. 8 (A), for example, as in FIG. 74 (B), FIG. 6 (B), or FIG. 7 (C), when the claw portion is appropriately selected (specified), the end of the line is formed. An example is shown in which 1042 and the end of the line 1044 are added with a curve 1083d along the boundary of the selected region to make the nail line drawing 1080d a closed region.
By doing so, the line drawing 1010 of the nail that did not form the closed region can be corrected to the line drawing 1080d of the nail that forms the closed region.

このようにすることによって、閉領域を形成していない線画に対して、線の端同士を曲線で適切に連結することで、適切な閉領域を形成する線画を容易に得ることができる。 By doing so, it is possible to easily obtain a line drawing that forms an appropriate closed region by appropriately connecting the ends of the lines with a curve with respect to the line drawing that does not form the closed region.

図8(B)は、図7(A)の爪の部分に異なる色で彩色した例を示した図である。図8(A)で形成された、閉領域で形成された爪の線画1080eに対して、他の色で彩色された爪1085eを容易に得ることができる。 FIG. 8B is a diagram showing an example in which the nail portion of FIG. 7A is colored with a different color. With respect to the line drawing 1080e of the nail formed in the closed region formed in FIG. 8A, the nail 1085e colored with another color can be easily obtained.

図9(A)は、閉じた線画の爪の部分の彩色を削除した例である。図9(B)は、閉じた線画の爪の部分に他の画像を張り付けた例を示した図である。
図9(A)では、閉じた爪の線画1090fの内部の爪の領域1095fの色を削除した例を示している。
図9(B)では、閉じた爪の線画1090gの内部の爪の領域1095gに、他の画像を張り付けた例を示している。貼り付ける画像は、特に限定されないが、張り付けた画像を他の画像に変更することも考慮し、新たなレイヤに画像を張り付けることが望ましい。
FIG. 9A is an example in which the coloring of the nail portion of the closed line drawing is deleted. FIG. 9B is a diagram showing an example in which another image is attached to the claw portion of the closed line drawing.
FIG. 9A shows an example in which the color of the nail region 1095f inside the line drawing 1090f of the closed nail is deleted.
FIG. 9B shows an example in which another image is attached to the inner nail region 1095 g of the closed nail line drawing 1090 g. The image to be pasted is not particularly limited, but it is desirable to paste the image on a new layer in consideration of changing the pasted image to another image.

図10(A)は、図6(A)によって得られた、閉じていない線画を含む爪の画像を抽出した例を示した図である。図10(B)は、図8(A)によって得られた、閉じた線画を含む爪の画像を抽出した例を示した図である。図10(C)は、図9(A)によって得られた、閉じた線画を含む爪の画像を抽出した例を示した図である。図10(D)は、図9(A)で得られた画像から、彩色された部分を取り除いて、線画を得た例を示す図である。 FIG. 10 (A) is a diagram showing an example of extracting an image of a nail including an unclosed line drawing obtained by FIG. 6 (A). FIG. 10B is a diagram showing an example of extracting an image of a nail including a closed line drawing obtained by FIG. 8A. FIG. 10 (C) is a diagram showing an example of extracting an image of a nail including a closed line drawing obtained by FIG. 9 (A). FIG. 10 (D) is a diagram showing an example in which a line drawing is obtained by removing a colored portion from the image obtained in FIG. 9 (A).

図10(A)では、図6(A)に示された爪の部分を、爪の線画1100hと共に、抽出した例を示している。開いた線画1100hも含めて、爪の領域を抽出するにあたっては、選択された領域よりも少し拡大した領域を抽出するようにすればよい。 FIG. 10A shows an example in which the nail portion shown in FIG. 6A is extracted together with the nail line drawing 1100h. When extracting the nail region including the open line drawing 1100h, it is sufficient to extract a region slightly enlarged from the selected region.

図10(B)は、図8(B)によって得られた閉じた線画を含む爪の画像を抽出した例を示した図である。この場合には、爪の線画1100jは閉じているので、爪の内部と閉じた爪の線画を選択して抽出すればよい。 FIG. 10B is a diagram showing an example of extracting an image of a nail including a closed line drawing obtained by FIG. 8B. In this case, since the nail line drawing 1100j is closed, the inside of the nail and the closed nail line drawing may be selected and extracted.

図10(C)は、図9(A)によって得られた閉じた線画を含む爪の画像を抽出した例を示した図である。この処理も、図10(B)に示した処理と同様である。 FIG. 10 (C) is a diagram showing an example of extracting an image of a nail including a closed line drawing obtained by FIG. 9 (A). This process is also the same as the process shown in FIG. 10 (B).

図10(D)は、図9(A)で得られた画像から、彩色された部分を取り除いて、線画を得た例を示す図である。この場合には、図9(A)で示された画像から、順次に彩色された画像を削除することで、閉じた線画で構成される線画800m及び1100mを得ることができる。 FIG. 10 (D) is a diagram showing an example in which a line drawing is obtained by removing a colored portion from the image obtained in FIG. 9 (A). In this case, by sequentially deleting the colored images from the image shown in FIG. 9A, line drawings 800 m and 1100 m composed of closed line drawings can be obtained.

図11は、AIによる彩色の機能の学習の例を示す図である。このAIを、GAN(Generative Adversarial Network)を用いて学習させる。学習用画像の線画402をジェネレータ404に入力する。ジェネレータ404は、学習用彩色画像408になるべく似た彩色画像406を生成するように、学習を行う。ディスクリミネータ410には、ジェネレータ404が生成した彩色画像406または、学習用彩色画像408が入力され、本物(Real)か偽物(Fake)かの判断が出力される。 FIG. 11 is a diagram showing an example of learning the coloring function by AI. This AI is trained using GAN (Generative Adversarial Network). The line drawing 402 of the learning image is input to the generator 404. The generator 404 performs learning so as to generate a colored image 406 that is as similar as possible to the learning colored image 408. The colored image 406 generated by the generator 404 or the learning colored image 408 is input to the discriminator 410, and the determination of whether it is genuine (Real) or fake (Fake) is output.

ジェネレータ404の学習と、ディスクリミネータ410の学習は、通常交互に実行される。学習を進めることによって、ジェネレータ404は、学習用彩色画像に酷似した彩色画像を生成するようになり、ディスクリミネータ410に対し、ジェネレータ404において生成された彩色画像を本物であると判断されるように学習が進められる。ディスクリミネータ410は、ジェネレータ404が生成した彩色画像と学習用彩色画像とを適切に見分けられるように学習を行う。
以上のようにして学習されたジェネレータ404を、図2の彩色部202に用いることにより、線画に彩色が施される。
The learning of the generator 404 and the learning of the discriminator 410 are usually executed alternately. By advancing the learning, the generator 404 will generate a colored image that closely resembles the colored image for learning, and the discriminator 410 will determine that the colored image generated by the generator 404 is genuine. Learning is advanced. The discriminator 410 performs learning so that the colored image generated by the generator 404 and the colored image for learning can be appropriately distinguished.
By using the generator 404 learned as described above for the coloring unit 202 of FIG. 2, the line drawing is colored.

図12は、一実施形態の画像の加工の例を示したフローチャートである。以下に、各ステップについて説明する。
[ステップS1202]線画が受け取られる。処理はステップS1204に移る。
[ステップS1204]受け取られた線画に対して、彩色が施される。処理はステップS1207に移る。
[ステップS1207]必要に応じて、彩色された線画に対して、彩色の修正(例えば、エッジ保持型平滑化処理)が施される。指定された色(色相、彩度又は明度若しくはこれらの組合せ)によって指定された閾値を用いて、彩色された領域が選択(特定)され抽出される。処理はステップS1210に移る。
[ステップS1210]抽出された領域の画像に加工が加えられる。処理はステップS1212に移る。
[ステップS1212]処理の中間画像及び加工された画像が、表示(出力)される。処理を終了する。
以上の処理によって、必ずしも閉じた領域を含まない線を含む線画に対して、適切な領域が選択(特定)され、抽出される。抽出された領域に対して、容易に適切な加工を施すことができるようになる。
FIG. 12 is a flowchart showing an example of image processing of one embodiment. Each step will be described below.
[Step S1202] The line drawing is received. The process proceeds to step S1204.
[Step S1204] The received line drawing is colored. The process proceeds to step S1207.
[Step S1207] If necessary, the colored line drawing is subjected to coloring correction (for example, edge-retaining smoothing process). Colored areas are selected (specified) and extracted using thresholds specified by the specified color (hue, saturation or lightness, or a combination thereof). The process proceeds to step S1210.
[Step S1210] Processing is added to the image of the extracted region. The process proceeds to step S1212.
[Step S1212] The intermediate image and the processed image of the processing are displayed (output). End the process.
By the above processing, an appropriate area is selected (specified) and extracted for the line drawing including the line that does not necessarily include the closed area. Appropriate processing can be easily applied to the extracted region.

図13は、AIによる彩色の後に、必要に応じて彩色の修正を行い、所定の色の領域を抽出する例を示した図である。なお、図13では、この例では必要がないため、彩色の修正を行わずに所定の色の領域を抽出する例を示している。この処理は、図12のステップS1207(必要に応じて彩色の修正を行い、所定の色の領域を抽出する)のサブルーチンの例を示すものである。以下に、各ステップについて説明する。 FIG. 13 is a diagram showing an example in which a region of a predetermined color is extracted by correcting the coloring as necessary after coloring by AI. Note that FIG. 13 shows an example of extracting a predetermined color region without modifying the coloring because it is not necessary in this example. This process shows an example of the subroutine of step S1207 of FIG. 12 (correcting the coloring as necessary and extracting a region of a predetermined color). Each step will be described below.

[ステップS1302]オペレータから、例えば、抽出されるべき領域の中の位置が特定される。この指示によって、どの領域について処理を行うかが指定されたことになる。処理はステップS1304に移る。 [Step S1302] From the operator, for example, a position in the area to be extracted is specified. By this instruction, it is specified which area to process. The process proceeds to step S1304.

[ステップS1304]指定された位置の周辺の色と同様の色の領域を特定する。同様の色は、色相、彩度又は明度若しくはこれらの組合せによって指定できる。色を伴わないグレースケールが指定されてもよい。閾値が2つ指定されることによって、二つの閾値の間にある色の領域が特定される。或いは1つの閾値と、上下の値の許容量が指定されてもよい。或いは、閾値は、複数存在して、色相、彩度、明度、トーンなどの上限、下限の閾値がそれぞれ設定されていてもよい。
処理はステップS1306に移る。
[ステップS1306]選択された領域が特定され、抽出される。処理はステップS1308に移る。
[Step S1304] A region having a color similar to the color around the designated position is specified. Similar colors can be specified by hue, saturation or lightness or a combination thereof. Grayscale without color may be specified. By designating two thresholds, a color region between the two thresholds is specified. Alternatively, one threshold value and the allowable amount of the upper and lower values may be specified. Alternatively, there may be a plurality of threshold values, and upper and lower threshold values such as hue, saturation, lightness, and tone may be set respectively.
The process proceeds to step S1306.
[Step S1306] The selected region is identified and extracted. The process proceeds to step S1308.

[ステップS1308]例えば、閾値の値を変更する指示などを受け取った場合(YES)には、再度領域の特定を行うこととなるため、処理はステップS1304に戻る。閾値等の変更の指示を受け取っていない場合(NO)には、処理はリターンする。
以上の処理によって、オペレータにより閾値が変更されることによって、適切な領域が選択されることとなる。
[Step S1308] For example, when an instruction to change the threshold value is received (YES), the region is specified again, so the process returns to step S1304. If the instruction to change the threshold value or the like has not been received (NO), the process returns.
By the above processing, the threshold value is changed by the operator, so that an appropriate area is selected.

図14は、必要に応じて彩色の修正を行い、所定の色の領域を抽出する例を示す図である。彩色の修正として、エッジ保持型平滑化処理を行う例を示す。そして、所定の色の領域を抽出する。エッジ保持型平滑化処理が利用される場合は、彩色処理において、所望の領域全体に対して彩色にムラがあったり、一部の領域に彩色が偏ったりしている場合などが挙げられる。この処理は、図12のステップS1207(必要に応じて彩色の修正を行い、所定の色の領域を抽出する)のサブルーチンの他の例を示すものである。以下、各ステップについて説明する。 FIG. 14 is a diagram showing an example in which a predetermined color region is extracted by correcting the coloring as necessary. An example of performing edge-preserving smoothing processing as a correction of coloring is shown. Then, a region of a predetermined color is extracted. When the edge-retaining smoothing process is used, in the coloring process, there are cases where the coloring is uneven over the entire desired region, or where the coloring is biased in a part of the region. This process shows another example of the subroutine of step S1207 of FIG. 12 (correcting the coloring as necessary and extracting a region of a predetermined color). Hereinafter, each step will be described.

[ステップS1402]エッジ保持型平滑化の指示があったかが判断される。この判断がYESであれば、処理はステップS1404に移る。この判断がNOであれば、処理はリターンする。 [Step S1402] It is determined whether or not there is an instruction for edge-holding type smoothing. If this determination is YES, the process proceeds to step S1404. If this determination is NO, the process returns.

[ステップS1404]指定された領域の周辺で、エッジ保持型平滑化処理が実行される。処理はステップS1406に移る。 [Step S1404] An edge-preserving smoothing process is executed around the designated area. The process proceeds to step S1406.

[ステップS1406]閾値の範囲に該当する領域が特定され、抽出される。特定される領域は、連続した領域であることが望ましい。処理はステップS1408に移る。 [Step S1406] A region corresponding to the threshold range is specified and extracted. The region specified is preferably a continuous region. The process proceeds to step S1408.

[ステップS1408]
エッジ保持型平滑化処理に係るパラメータの変更指示を受け取ったか否かが判断される。判断がYESの場合には、処理は、ステップS1404に移る。判断がNOの場合には、処理はリターンする。
以上の処理によって、適切なエッジ保持型平滑化処理が行える。この処理は、図13の閾値の設定と組み合わせて、実行されることが望ましい。すなわち、図13と図14の処理は排他的なものではなく、必要に応じて組み合わせて実行されてもよい。
[Step S1408]
It is determined whether or not a parameter change instruction related to the edge-preserving smoothing process has been received. If the determination is YES, the process proceeds to step S1404. If the determination is NO, the process returns.
By the above processing, an appropriate edge-preserving type smoothing process can be performed. It is desirable that this process be performed in combination with the threshold setting of FIG. That is, the processes of FIGS. 13 and 14 are not exclusive and may be executed in combination as necessary.

図15は、抽出された領域の画像の加工の例を示した図である。
図15(A)ないし図15(E)の処理は、図12のステップS1210のサブルーチン例を示すものである。図15の各処理は、単独で実行され得るが、矛盾がなければ、複数の処理が組み合わされて実行されてもよい。或いは、一つの画像に存在する複数の領域の各々に対して、異なる処理が施されてもよい。
以下に、各処理について説明する。
FIG. 15 is a diagram showing an example of processing an image of the extracted region.
The processes of FIGS. 15A to 15E show a subroutine example of step S1210 of FIG. Each process of FIG. 15 can be executed independently, but if there is no contradiction, a plurality of processes may be executed in combination. Alternatively, different processing may be applied to each of the plurality of regions existing in one image.
Each process will be described below.

図15(A)は、抽出された領域を彩色する処理を示している。
[ステップS1502]抽出された領域に彩色がなされる。すでに彩色された色とは異なる色で彩色を行うことができる。或いは、抽出された領域に対して、様々なフィルタ処理が施されてもよい。
FIG. 15A shows a process of coloring the extracted region.
[Step S1502] The extracted area is colored. Coloring can be done with a color different from the already colored color. Alternatively, various filtering processes may be applied to the extracted region.

図15(B)は、抽出された領域から所定の色を除去する処理を示している。
[ステップS1504]抽出された領域から所定の色が除去される。色の除去の前に、開いた線画の端点を連結して、閉じた線画にする処理が行われてもよい。
FIG. 15B shows a process of removing a predetermined color from the extracted region.
[Step S1504] A predetermined color is removed from the extracted region. Prior to color removal, a process may be performed in which the endpoints of the open line art are connected to form a closed line art.

図15(C)は、抽出された領域に含まれない領域の画像を除去する処理を示している。
[ステップS1506]抽出された領域に含まれない領域の画像が除去される。この処理によって、抽出された部分の領域の画像だけを残した画像を得ることができる。
FIG. 15C shows a process of removing an image of a region not included in the extracted region.
[Step S1506] The image of the region not included in the extracted region is removed. By this process, it is possible to obtain an image in which only the image of the region of the extracted portion is left.

図15(D)は、抽出された領域の画像を他の画像に置き換える処理を示している。
[ステップS1508]抽出された領域の画像を他の画像に置き換える処理が行われる。他の画像を更に別の画像に差し替える場合を考慮して、彩色画像とは別のレイヤに画像を置くようにしてもよい。
FIG. 15D shows a process of replacing the image of the extracted region with another image.
[Step S1508] A process of replacing the image of the extracted region with another image is performed. In consideration of the case where another image is replaced with another image, the image may be placed on a layer different from the colored image.

図15(E)は、抽出された領域を閉曲線で囲むことで線画を生成する処理を示している。
[ステップS1510]抽出された領域が、閉曲線で囲まれていない場合がある。このような場合には、抽出された領域に沿って、曲線の端点と端点とが結ばれるように曲線を加える処理を行い閉曲線が形成されるようにしてもよい。或いは、抽出された領域の周囲を囲む閉曲線を作成して、この作成された閉曲線を参照しながら、閉領域の周囲に存在する分断された曲線が滑らかに連結されて閉曲線が形成されるように、分断された曲線をつなぎ合わせて閉曲線を形成してもよい。
以上の処理によって、線画から、適切な領域を容易に抽出することができる。そして、抽出した領域に対して、所望の画像処理を適用することができる。
なお、上記の画像処理は一例であって、これらに限られるものではない点に留意すべきである。
以上の実施形態で用いられているAIは、GANを使って学習させたAIを用いたが、AIの学習手法はGANに限定されるものではない。
FIG. 15E shows a process of generating a line drawing by surrounding the extracted region with a closed curve.
[Step S1510] The extracted region may not be surrounded by a closed curve. In such a case, a closed curve may be formed by performing a process of adding a curve so that the end points of the curve are connected along the extracted region. Alternatively, a closed curve surrounding the extracted region is created so that the divided curves existing around the closed region are smoothly connected to form the closed curve while referring to the created closed curve. , The divided curves may be joined to form a closed curve.
By the above processing, an appropriate region can be easily extracted from the line drawing. Then, desired image processing can be applied to the extracted region.
It should be noted that the above image processing is an example and is not limited to these.
The AI used in the above embodiments is an AI trained using GAN, but the learning method of AI is not limited to GAN.

200 画像領域抽出処理装置
202 彩色部
204 エッジ保持型平滑化処理部
206 領域抽出部
208 画像加工部
210 表示部

200 Image area extraction processing device 202 Coloring unit 204 Edge retention type smoothing processing unit 206 Area extraction unit 208 Image processing unit 210 Display unit

Claims (10)

閉じていない線を含む線画から、前記閉じていない線によって近似的に囲まれる画像領域を抽出する画像領域抽出処理方法であって、
線画と彩色が施された線画とを教師データとして機械学習した、入力された線画から彩色を施した画像を出力する画像変換モデルを用いて、前記閉じていない線を含む線画を彩色済線画に変換するステップと、
前記彩色済線画又は補正された前記彩色済線画の中から、前記閉じていない線によって近似的に囲まれる形状に彩色が施されている画像領域を抽出するステップと、
を有する画像領域抽出処理方法。
An image area extraction processing method for extracting an image area approximately surrounded by the unclosed lines from a line drawing including unclosed lines.
Using an image conversion model that outputs a colored image from the input line drawing, which is machine-learned using the line drawing and the colored line drawing as teacher data, the line drawing including the unclosed line is converted into a colored line drawing. Steps to convert and
From among the color already line drawing or corrected the color already line drawing, extracting an image region color is applied in a shape surrounded by the approximated by the unclosed line,
Image area extraction processing method having.
前記変換するステップと、前記抽出するステップとの間に、
前記彩色済線画にエッジを保持して平滑化する補正を施すステップ、
を更に有する、
請求項1に記載の画像領域抽出処理方法。
Between the conversion step and the extraction step,
A step of making corrections to retain and smooth the edges of the colored line art,
Further have,
The image area extraction processing method according to claim 1.
前記画像領域を抽出するステップは、
前記彩色済線画又は前記補正された彩色済線画の色相、彩度又は明度の値と所定の閾値との大小を比較することで、前記画像領域を特定するステップ、
を含む、請求項1又は2に記載の画像領域抽出処理方法。
The step of extracting the image area is
A step of identifying the image region by comparing the magnitude, saturation or brightness value of the colored line art or the corrected colored line art with a predetermined threshold value.
The image area extraction processing method according to claim 1 or 2, which comprises.
抽出された前記画像領域に彩色を施すステップ、
を更に有する請求項1ないし3のうちいずれか1項に記載の画像領域抽出処理方法。
Steps of coloring the extracted image area,
The image area extraction processing method according to any one of claims 1 to 3, further comprising.
抽出された前記画像領域から所定の色を除去するステップ、
を更に有する請求項1ないし3のうちいずれか1項に記載の画像領域抽出処理方法。
A step of removing a predetermined color from the extracted image area,
The image area extraction processing method according to any one of claims 1 to 3, further comprising.
前記閉じていない線を含む線画前記彩色済線画又は前記補正された彩色済線画から、抽出された前記画像領域に含まれない領域の線画又は前記彩色済線画を除去するステップ、
を更に有する請求項1ないし3のうちいずれか1項に記載の画像領域抽出処理方法。
A step of removing a line drawing of a region not included in the extracted image area or the colored line drawing from the line drawing including the unclosed line , the colored line drawing or the corrected colored line drawing.
The image area extraction processing method according to any one of claims 1 to 3, further comprising.
抽出された前記画像領域を所定の画像に置き換えるステップ、
を更に有する請求項1ないし3のうちいずれか1項に記載の画像領域抽出処理方法。
A step of replacing the extracted image area with a predetermined image,
The image area extraction processing method according to any one of claims 1 to 3, further comprising.
抽出された前記画像領域を閉曲線で囲むことで線画を生成するステップ、
を更に有する請求項1ないし3のうちいずれか1項に記載の画像領域抽出処理方法。
A step of generating a line drawing by surrounding the extracted image area with a closed curve,
The image area extraction processing method according to any one of claims 1 to 3, further comprising.
前記彩色済線画を表示するステップ、
を更に有する請求項1ないし8のうちいずれか1項に記載の画像領域抽出処理方法。
Steps to display the colored line art,
The image area extraction processing method according to any one of claims 1 to 8, further comprising.
請求項1ないし9のうちいずれか1項に記載の方法をコンピュータに実行させるプログラム。
A program that causes a computer to execute the method according to any one of claims 1 to 9.
JP2019153742A 2019-08-26 2019-08-26 Image area extraction processing method and image area extraction processing program Active JP6900016B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019153742A JP6900016B2 (en) 2019-08-26 2019-08-26 Image area extraction processing method and image area extraction processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019153742A JP6900016B2 (en) 2019-08-26 2019-08-26 Image area extraction processing method and image area extraction processing program

Publications (2)

Publication Number Publication Date
JP2021033686A JP2021033686A (en) 2021-03-01
JP6900016B2 true JP6900016B2 (en) 2021-07-07

Family

ID=74677450

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019153742A Active JP6900016B2 (en) 2019-08-26 2019-08-26 Image area extraction processing method and image area extraction processing program

Country Status (1)

Country Link
JP (1) JP6900016B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113140018B (en) * 2021-04-30 2023-06-20 北京百度网讯科技有限公司 Method for training countermeasure network model, method for establishing word stock, device and equipment
WO2023157489A1 (en) * 2022-02-21 2023-08-24 ソニーセミコンダクタソリューションズ株式会社 Solid-state imaging element, imaging device, and method for controlling solid-state imaging element

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06266835A (en) * 1993-03-11 1994-09-22 Fujitsu Ltd Plotting system
JP2914547B2 (en) * 1993-06-23 1999-07-05 大日本スクリーン製造株式会社 How to specify the image processing target area
JPH0877364A (en) * 1994-09-08 1996-03-22 Fujitsu General Ltd Image extracting method
JPH09134422A (en) * 1995-11-07 1997-05-20 B U G:Kk Continuous coloring method for animation and device therefor
JP3927677B2 (en) * 1997-02-21 2007-06-13 キヤノン株式会社 Image processing apparatus and image processing method
JP2000339442A (en) * 1999-05-31 2000-12-08 Nippon Telegr & Teleph Corp <Ntt> Picture coloring method, picture coloring device and recording medium recording picture coloring block
JP4684595B2 (en) * 2004-08-05 2011-05-18 ソニー株式会社 Image display device
JP4747970B2 (en) * 2006-07-04 2011-08-17 オムロン株式会社 Image processing device
JP2008085695A (en) * 2006-09-28 2008-04-10 Fujitsu Ltd Electronic watermark embedding apparatus and detection apparatus
JP2014106713A (en) * 2012-11-27 2014-06-09 Univ Of Tsukuba Program, method, and information processor

Also Published As

Publication number Publication date
JP2021033686A (en) 2021-03-01

Similar Documents

Publication Publication Date Title
US9639965B2 (en) Adjusting color attribute of an image in a non-uniform way
TWI325567B (en) Method and system for enhancing portrait images that are processed in a batch mode
US7082211B2 (en) Method and system for enhancing portrait images
JP4753025B2 (en) Makeup simulation method
JP4171574B2 (en) Image processing condition determining apparatus and image processing condition determining program storage medium
US8406566B1 (en) Methods and apparatus for soft edge masking
JP6900016B2 (en) Image area extraction processing method and image area extraction processing program
JP2006523343A (en) Selective enhancement of digital images.
US20070127783A1 (en) Image processing apparatus, method and program for controlling flesh color of image
CN105404846A (en) Image processing method and apparatus
US20210150676A1 (en) Systems and Methods for Content-Aware Enhancement of Images
JP4124084B2 (en) Image processing apparatus, image processing method, and image processing program
US20230281764A1 (en) Systems and methods for selective enhancement of skin features in images
US20040130554A1 (en) Application of visual effects to a region of interest within an image
JP2007299113A (en) Hair coloring and makeup simulation system
EP1883048B1 (en) Data correction method, apparatus and program
JP2010073222A (en) Makeup simulation method
JP4148090B2 (en) Blocked decoration image
JP7153280B2 (en) MAKEUP SIMULATION SYSTEM, MAKEUP SIMULATION METHOD AND PROGRAM
WO2022249997A1 (en) Teaching data generation device, teaching data generation method, and image processing device
JP4725683B2 (en) Image data management apparatus and image data management program
CN115294243A (en) Automatic coloring method and device for line art picture and storage medium
Giordan How to Use Adobe Photoshop 7: Visually in Full Color
Garness CS4 Digital Retouching for Fashion Beauty and Portrait Photography
KR20220042675A (en) File converter apparatud for webtoon background

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190826

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200629

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200721

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20201006

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20201204

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210608

R150 Certificate of patent or registration of utility model

Ref document number: 6900016

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250