JP2004078411A - Method for automatic creation of sketch drawing and its apparatus - Google Patents
Method for automatic creation of sketch drawing and its apparatus Download PDFInfo
- Publication number
- JP2004078411A JP2004078411A JP2002235780A JP2002235780A JP2004078411A JP 2004078411 A JP2004078411 A JP 2004078411A JP 2002235780 A JP2002235780 A JP 2002235780A JP 2002235780 A JP2002235780 A JP 2002235780A JP 2004078411 A JP2004078411 A JP 2004078411A
- Authority
- JP
- Japan
- Prior art keywords
- parameter
- line
- parameters
- sketch
- image data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Images
Landscapes
- Image Processing (AREA)
Abstract
Description
【0001】
【発明の属する技術分野】
本発明は、スケッチ画の自動描画方法およびその装置に関するものである。
【0002】
【従来の技術】
スケッチ画を描く方法としては、対象物を見ながら紙に書く方法や、対象物を写真撮影しそれをトレースする方法などが一般的であるが、これらの方法は作業が面倒であり、描画された図の完成度が作成者の作図能力等に大きく影響を受ける。一方、コンピュータによるスケッチ画の自動描画として、上記の写真撮影のデータを取り込み、対象物のエッジを検出し、細線化した後、線画像を折線近似し、スケッチ画を作成する手法がある。しかし、この手法では、例えば、エッジ検出において、画像によっては十分にエッジが検出できずに、線画像が途切れることがあり、充分にきれいなスケッチ画が得られない。
【0003】
【発明が解決しようとする課題】
本発明は上記問題点に鑑みて成されたものであり、作業が容易でかつ対象物を忠実に表わすスケッチ画を自動描画することを目的とする。
【0004】
【課題を解決するための手段】
本発明に係るスケッチ画自動作成方法は元画像の画像データに対して、複数のパラメータの値に応じたそれぞれの処理を行って線図形を描画するスケッチ画自動作成方法において、複数のパラメータの少なくとも1つを変更して、線図形の描画を2回以上同じ作図面上において行う。これにより、画像データをできるだけ忠実に捉えた線図形を描写することが可能となる。
【0005】
好ましくは、線図形の描画において、細線化を実行する。複数のパラメータは、それぞれエッジ検出を行うためのエッジ感度パラメータ、折線近似を行うための折線近似パラメータ、および所定の大きさ以下の画像データを消去するためのゴミサイズパラメータであることが好ましい。また、好ましくは、複数のパラメータの少なくとも1つは所定範囲内で任意に設定される。
【0006】
本発明に係るスケッチ画自動作成装置は元画像の画像データに対して、複数のパラメータの値に応じたそれぞれの処理を行って線図形を描画する手段と、複数のパラメータの少なくとも1つを変更し、線図形の描画を少なくとも2回以上同じ作図面上において行うように指示する手段とを備える。これにより、画像データをできるだけ忠実に捉えた線図形を描写することが可能となる。
【0007】
好ましくは、線図形の描画において、細線化を実行する。また、好ましくは、複数のパラメータは、それぞれエッジ検出を行うためのエッジ感度パラメータ、折線近似を行うための折線近似パラメータ、および所定の大きさ以下の画像データを消去するためのゴミサイズパラメータである。また、複数のパラメータの少なくとも1つは所定範囲内で任意に設定されることが好ましい。また、本発明に係るプログラムは、コンピューターを、元画像の画像データに対して、複数のパラメータの値に応じたそれぞれの処理を行って線図形を描画する手段と、複数のパラメータの少なくとも1つを変更し、線図形の描画を少なくとも2回以上同じ作図面上において行うように指示する手段として機能させるためのプログラムである。
【0008】
【発明の実施の形態】
以下、本発明の実施形態について添付図面を参照して説明する。図1は元画像の一例であるコンパクトカメラの外観である。図2、3はスケッチ画自動作成装置によって描画された線図形である。図2は1回の描画により描かれた線図形であり、図3は所定のパラメータを変更して、描画が複数回実施されたときの線図形である。図2の線図形は例えば、左上のダイヤル部10が不鮮明であるように、複雑な部分について元画像の画像データの特徴が充分に捉えられていない。一方、所定のパラメータが変更されて、描画を複数回実施されると、図3に示すように、例えば左上のダイヤル部10が鮮明に描画されている。このように、本発明においては、一度の描画では捉えられない元画像の特徴が捉えられ、複雑な部分でも元画像を極力忠実に表現した線図形が描かれる。
【0009】
図4はスケッチ画自動作成装置において実行されるスケッチ画自動作成ルーチンを示すフローチャートである。ステップ100において元画像は、ラインセンサを用いてスキャンされ、スケッチ画自動作成装置内に画像データとして読み取られる。読み取られた画像データは、ステップ110において、画像データの濃淡に応じて、すべての画素データについて白(0)から黒(255)の256段階の濃度値が割り当てられるグレイスケーリングが行なわれる。ステップ120においては、線図形が描かれる作図面に関するデータが初期化される。作図面は例えばコンピューターのディスプレイ画面である。
【0010】
ステップ130、140、150において、それぞれエッジ検出を行うためのエッジ感度パラメータ、折線近似を行うための折線近似パラメータ、および所定の大きさ以下の画像データを消去するためのゴミサイズパラメータが設定される。このとき、それそれのパラメータはスケッチ画自動作成装置内に記憶されているそれぞれのパラメータの最小値から最大値の範囲内で、自動的に任意に設定される。すなわち、それぞれのパラメータは記憶されている最小値から最大値の範囲で、無作為に抽出される。記憶されているそれぞれのパラメータの最小値若しくは最大値、またはそれぞれのパラメータはマニュアルで設定されるようにしてもよい。
【0011】
ステップ160では、グレイスケーリングされた画像データが、ステップ130で設定されたエッジ感度パラメータに応じて、公知の手法によりエッジ検出される。ここでは図5に示す加重マトリックスが用いられ、すべての画素についてのエッジ強度が求められる。求められたそれぞれのエッジ強度はステップ130で設定されたエッジ感度パラメータより大きければエッジと認識され、特徴点として1の値に変換され、パラメータより小さければ0の値に変換される。1の値の特徴点によって作られる画像データはステップ170において、公知の手法により細線化される。
【0012】
ステップ180においては、細線化された画像データがステップ140で設定された折線近似パラメータに応じて、折線近似される。ここでは、図6、図7、図8に示すように、交差数が算出された後、ベクター化が行なわれる。細線化された画像データは、すべての特徴点を着目点と見て、図6に示すように隣接画素をk=0〜7として、
交差数=Σf(k)(1−f(k+1))
ただし、f(8)=f(0)
の式により交差数が求められる。特徴点は図7に示すように、それぞれ端点、内部点、分岐点、交差点であることを示す交差数1、2、3、4のいずれかに算出される。なお、Σはk=0〜7についての和を示す。
【0013】
交差数が求められた後、図8に示すように特徴点がベクター化される。ここでは、画像データがラスター走査され、1つの端点が検出され、その点を出発点として、その端点の隣接画素が探索される。探索によって検知された隣接画素は、公知の手法によりチェインコードを用いて方向コードが割り当てられる。そして、検知された隣接画素が内部点であれば、さらに隣接画素が探索される。検知された隣接画素が端点であれば、その端点を終点として、出発点と終点の間で区分的直線近似によってベクター化されると同時に、新たな出発点の探索が行なわれる。検知された隣接画素が分岐点もしくは交差点であれば、それらの点を終点として、出発点と終点の間で区分的直線近似によってベクター化されると同時に、その点を新たな出発点として2方向若しくは3方向について隣接画素の探索が行われる。これらの操作はすべての特徴点がベクター化されるまで行なわれる。
【0014】
図9にベクター化における区分的直線近似の例を示す。チェインコードを割り当てられた特徴点の集まりである特徴点群30において、見つけ出された出発点31と終点32が結ばれ線分33が作られる。次に、この線分33と特徴点群30において最も離れた折線点34が検出される。検出された折線点34と線分33の距離36が設定された折線近似パラメータ以上であれば、その点を折線点34として2つの新たな線分37、38に分割される。距離36が折線近似パラメータ未満ならば、線分33が特徴点群30の近似直線とされる。分割された線分37、38に対しても、それぞれ線分33のときと同様に最も離れた折線点が1つずつ見つけられる。線分37、38と各々の線分と対応する折線点との距離が折線近似パラメータ未満であれば、その線分が近似直線とされ、折線近似パラメータ以上であれば、同様の操作が折線近似パラメータ未満になるまで繰り返される。
【0015】
ステップ180で折線近似された画像は、ステップ190においてゴミ削除が行なわれる。すなわち、ステップ150で設定されたゴミサイズパラメータ以下の大きさの画像データが消去される。ステップ200において、ゴミ削除が行なわれた画像データは、ステップ120でデータが初期化された作図面上に、線図形として描画される。
【0016】
ステップ210ではステップ130ないしステップ200の操作があらかじめ記憶されている所定回数実行されたかどうかが判定される。所定回数実行されていれば、このルーチンは終了する。所定回数実行されていなければ、ステップ130ないしステップ200が再度行なわれる。このとき、ステップ130ないし150では毎回各パラメータが再設定され、ステップ160ないしステップ190では、再設定された各パラメータに応じたデータ処理がなされ、異なる線図形がステップ200において同一の作図面上に描かれることになる。なお、2回目以降の描画におけるパラメータの再設定においては、パラメータのうちいずれかが固定され、その他のパラメータのみが再設定される構成にしてもよい。また、ステップ200における所定回数はマニュアルで設定されるようにしてもよい。
【0017】
例えば、2回目の線描画では、ステップ130、150において1回目の線描画と同一のパラメータが設定され、ステップ140において1回目のパラメータよりも大きな値の折線近似パラメータが設定される。これにより、ステップ160、170におけるエッジ検出、細線化およびステップ180における交差数算出は1回目の線描画と同様に行なわれる。しかし、ステップ180でのベクター化における区分的直線近似では、図10に示すように、パラメータを大きくしたことによって、線分43と折線点44の距離46がより少ない分割で折線近似パラメータ未満となるため、折れ点の数が1回目のときとは異なり、描く線図形も異なる。3回目以降の線描画においては、他のパラメータについても変更が加えられ、毎回種々のパラメータに応じた線図形が同一の作図面上に描かれることになる。
【0018】
以上のように、パラメータを変更して、描画を複数回実施すると、図2および図3に示すように、一度の描画では捉えられない特徴が捉えられ、複雑な部分でも元画像を極力忠実に表現した線図形が描かれる。
【0019】
【発明の効果】
本発明によれば、元画像の画像データに基づいた自動線描画により、元画像のの特徴を的確に捉えたスケッチ画が簡単に得られる。
【図面の簡単な説明】
【図1】元画像の一例であるコンパクトカメラの外観である。
【図2】スケッチ画自動作成装置によって、1回の描画により得られた線図形である。
【図3】スケッチ画自動作成装置によって、パラメータが変更され、複数回描画することにより得られた線図形である。
【図4】本発明の一実施形態であるスケッチ画自動作成装置において実行されるスケッチ画自動作成ルーチンを示すフローチャートである。
【図5】本発明においてエッジ検出を行うための加重マトリックスである。
【図6】本発明の折線近似における交差数算出の参照図である。
【図7】交差数算出において算出された交差数とその特徴点との関係を示す図である。
【図8】本発明の折線近似におけるベクター化の参照図である。
【図9】本発明の区分的直線近似の参照図である。
【図10】本発明の折線近似において折線近似パラメータが変更されたときの区分的直線近似の参照図である。
【符号の説明】
30 特徴点群
34、44 折線点
36、46 距離[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a method and an apparatus for automatically drawing a sketch image.
[0002]
[Prior art]
There are many ways to draw sketches, such as writing on paper while looking at the object, or taking a picture of the object and tracing it.However, these methods are cumbersome and require drawing. The degree of completion of a figure is greatly affected by the drawing ability of the creator. On the other hand, as an automatic drawing of a sketch image by a computer, there is a method in which data of the above photographing is taken in, the edge of an object is detected, thinned, and then a line image is approximated by a broken line to create a sketch image. However, in this method, for example, in edge detection, a sufficient edge cannot be detected depending on an image, and a line image may be interrupted, so that a sufficiently clear sketch image cannot be obtained.
[0003]
[Problems to be solved by the invention]
The present invention has been made in view of the above problems, and has as its object to automatically draw a sketch image which is easy to work and faithfully represents an object.
[0004]
[Means for Solving the Problems]
An automatic sketch image creation method according to the present invention is a sketch image automatic creation method for drawing a line figure by performing respective processes on image data of an original image in accordance with values of a plurality of parameters. One is changed and the drawing of the line figure is performed twice or more on the same drawing. This makes it possible to describe a line figure that captures image data as faithfully as possible.
[0005]
Preferably, in drawing a line figure, thinning is performed. Preferably, the plurality of parameters are an edge sensitivity parameter for performing edge detection, a polygonal line approximation parameter for performing polygonal line approximation, and a dust size parameter for erasing image data of a predetermined size or less. Preferably, at least one of the plurality of parameters is arbitrarily set within a predetermined range.
[0006]
An apparatus for automatically creating a sketch image according to the present invention performs a process corresponding to a plurality of parameter values on image data of an original image to draw a line graphic, and changes at least one of the plurality of parameters. Means for instructing to draw a line graphic at least twice on the same drawing. This makes it possible to describe a line figure that captures image data as faithfully as possible.
[0007]
Preferably, in drawing a line figure, thinning is performed. Preferably, the plurality of parameters are an edge sensitivity parameter for performing edge detection, a polygonal line approximation parameter for performing polygonal line approximation, and a dust size parameter for erasing image data having a predetermined size or less. . Preferably, at least one of the plurality of parameters is set arbitrarily within a predetermined range. Further, the program according to the present invention is a program for causing a computer to perform a process corresponding to a plurality of parameter values on image data of an original image to draw a line graphic, and at least one of the plurality of parameters. And a function for instructing to draw a line graphic at least twice on the same drawing.
[0008]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. FIG. 1 is an external view of a compact camera which is an example of an original image. 2 and 3 show line figures drawn by the automatic sketch drawing apparatus. FIG. 2 shows a line figure drawn by one drawing, and FIG. 3 shows a line figure when a predetermined parameter is changed and drawing is performed a plurality of times. In the line figure of FIG. 2, for example, the feature of the image data of the original image is not sufficiently captured for a complicated portion, such as the upper
[0009]
FIG. 4 is a flowchart showing a sketch image automatic creation routine executed in the sketch image automatic creation device. In
[0010]
In
[0011]
In
[0012]
In
Number of intersections = Σf (k) (1−f (k + 1))
Where f (8) = f (0)
The number of intersections is obtained by the following equation. As shown in FIG. 7, the feature points are calculated as any one of the numbers of
[0013]
After the number of intersections is determined, the feature points are vectorized as shown in FIG. Here, the image data is raster-scanned, one end point is detected, and starting from that point, a pixel adjacent to the end point is searched. Direction codes are assigned to adjacent pixels detected by the search using a chain code by a known method. Then, if the detected adjacent pixel is an internal point, further adjacent pixels are searched. If the detected adjacent pixel is an end point, the end point is set as an end point, vectorization is performed between the start point and the end point by piecewise linear approximation, and a search for a new start point is performed. If the detected adjacent pixel is a branch point or an intersection, these points are set as end points, vectorized by a piecewise linear approximation between the start point and the end point, and at the same time, the point is set as a new start point in two directions. Alternatively, adjacent pixels are searched for in three directions. These operations are performed until all the feature points are vectorized.
[0014]
FIG. 9 shows an example of piecewise linear approximation in vectorization. In a
[0015]
In
[0016]
In
[0017]
For example, in the second line drawing, the same parameters as those in the first line drawing are set in
[0018]
As described above, when the drawing is performed a plurality of times by changing the parameters, as shown in FIGS. 2 and 3, features that cannot be captured by a single drawing are captured, and the original image is faithfully reproduced even in a complicated portion. The expressed line figure is drawn.
[0019]
【The invention's effect】
According to the present invention, by automatic line drawing based on the image data of the original image, a sketch image accurately capturing the characteristics of the original image can be easily obtained.
[Brief description of the drawings]
FIG. 1 is an external view of a compact camera which is an example of an original image.
FIG. 2 is a line figure obtained by a single drawing by the automatic sketch drawing apparatus.
FIG. 3 is a line figure obtained by drawing a plurality of times with parameters changed by the automatic sketch drawing apparatus.
FIG. 4 is a flowchart showing an automatic sketch drawing routine executed in the automatic sketch drawing apparatus according to one embodiment of the present invention;
FIG. 5 is a weight matrix for performing edge detection in the present invention.
FIG. 6 is a reference diagram for calculating the number of intersections in the broken line approximation of the present invention.
FIG. 7 is a diagram illustrating the relationship between the number of intersections calculated in the calculation of the number of intersections and the feature points thereof.
FIG. 8 is a reference diagram of vectorization in the folding line approximation of the present invention.
FIG. 9 is a reference diagram of the piecewise linear approximation of the present invention.
FIG. 10 is a reference diagram of a piecewise linear approximation when a polygonal line approximation parameter is changed in the polygonal line approximation of the present invention.
[Explanation of symbols]
30
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002235780A JP2004078411A (en) | 2002-08-13 | 2002-08-13 | Method for automatic creation of sketch drawing and its apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002235780A JP2004078411A (en) | 2002-08-13 | 2002-08-13 | Method for automatic creation of sketch drawing and its apparatus |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2004078411A true JP2004078411A (en) | 2004-03-11 |
Family
ID=32020170
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2002235780A Withdrawn JP2004078411A (en) | 2002-08-13 | 2002-08-13 | Method for automatic creation of sketch drawing and its apparatus |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2004078411A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008052701A (en) * | 2006-07-28 | 2008-03-06 | Sony Corp | Image processing method, image processing device, and program |
CN110453395A (en) * | 2019-07-19 | 2019-11-15 | 广东智媒云图科技股份有限公司 | A kind of intelligent robot embroidering method, electronic equipment, storage medium |
-
2002
- 2002-08-13 JP JP2002235780A patent/JP2004078411A/en not_active Withdrawn
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008052701A (en) * | 2006-07-28 | 2008-03-06 | Sony Corp | Image processing method, image processing device, and program |
CN110453395A (en) * | 2019-07-19 | 2019-11-15 | 广东智媒云图科技股份有限公司 | A kind of intelligent robot embroidering method, electronic equipment, storage medium |
CN110453395B (en) * | 2019-07-19 | 2021-04-09 | 广东智媒云图科技股份有限公司 | Intelligent robot embroidery method, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7738730B2 (en) | Method of image analysis using sparse hough transform | |
JP2008234654A (en) | Object image detection method and image detection device | |
JP2007513555A (en) | Image processing | |
US8873839B2 (en) | Apparatus of learning recognition dictionary, and method of learning recognition dictionary | |
CN111079730A (en) | Method for determining area of sample image in interface image and electronic equipment | |
CN111461070A (en) | Text recognition method and device, electronic equipment and storage medium | |
JP2015197851A (en) | Image processor, program for image processing and information management system | |
JP2007198912A (en) | Image inspection device, image inspection method, program for allowing computer to function as image inspection device and recording medium | |
JP2008040557A (en) | Image display apparatus, image display method, and image display program | |
CN112418243A (en) | Feature extraction method and device and electronic equipment | |
JP2004078411A (en) | Method for automatic creation of sketch drawing and its apparatus | |
CN110827194A (en) | Image processing method, device and computer storage medium | |
JP5988228B2 (en) | Two-dimensional code, image reading apparatus, image reading method, program, and storage medium | |
JP2018092507A (en) | Image processing apparatus, image processing method, and program | |
JP7138503B2 (en) | Object detection system | |
JP5756947B2 (en) | Two-dimensional code, image reading apparatus, image reading method, program, and storage medium | |
US10380463B2 (en) | Image processing device, setting support method, and non-transitory computer-readable media | |
JP4890351B2 (en) | Image processing apparatus, image processing program, computer-readable recording medium storing the image processing program, and image processing method | |
JP2005078482A (en) | Method of detecting traveling direction of object | |
KR101280840B1 (en) | Method of identifying the laser point position on screen of presentation system | |
JP6244787B2 (en) | Image recognition apparatus, image recognition method, and image recognition program | |
JP7268560B2 (en) | Stone wall placement support program, stone wall placement support method, and stone wall placement support device | |
JPH06301775A (en) | Picture processing method, picture identification method and picture processor | |
JP2005157911A (en) | Face region detection method, device, and program, and computer-readable storage medium with face region detecting program stored thereon | |
JP2800192B2 (en) | High-speed character / graphic separation device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20050428 |
|
A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A712 Effective date: 20080425 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20080513 |
|
A131 | Notification of reasons for refusal |
Effective date: 20080603 Free format text: JAPANESE INTERMEDIATE CODE: A131 |
|
A761 | Written withdrawal of application |
Free format text: JAPANESE INTERMEDIATE CODE: A761 Effective date: 20080731 |