JP5956875B2 - Image processing apparatus and image processing method - Google Patents
Image processing apparatus and image processing method Download PDFInfo
- Publication number
- JP5956875B2 JP5956875B2 JP2012190615A JP2012190615A JP5956875B2 JP 5956875 B2 JP5956875 B2 JP 5956875B2 JP 2012190615 A JP2012190615 A JP 2012190615A JP 2012190615 A JP2012190615 A JP 2012190615A JP 5956875 B2 JP5956875 B2 JP 5956875B2
- Authority
- JP
- Japan
- Prior art keywords
- color
- mesh
- color point
- point
- intersection
- 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.)
- Expired - Fee Related
Links
- 238000012545 processing Methods 0.000 title claims description 50
- 238000003672 processing method Methods 0.000 title claims 3
- 239000003086 colorant Substances 0.000 claims description 22
- 238000001514 detection method Methods 0.000 claims description 13
- 238000004590 computer program Methods 0.000 claims description 8
- 238000000034 method Methods 0.000 description 66
- 230000008569 process Effects 0.000 description 39
- 230000006870 function Effects 0.000 description 19
- 238000003860 storage Methods 0.000 description 19
- 230000008859 change Effects 0.000 description 11
- 238000000605 extraction Methods 0.000 description 11
- 230000000295 complement effect Effects 0.000 description 6
- 238000009877 rendering Methods 0.000 description 6
- 238000005070 sampling Methods 0.000 description 6
- 239000003973 paint Substances 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 238000013213 extrapolation Methods 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 2
- 230000015556 catabolic process Effects 0.000 description 2
- 238000006731 degradation reaction Methods 0.000 description 2
- 239000000284 extract Substances 0.000 description 2
- 230000012447 hatching Effects 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 230000007704 transition Effects 0.000 description 2
- 230000004913 activation Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 238000012888 cubic function Methods 0.000 description 1
- 238000003708 edge detection Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
- Image Generation (AREA)
Description
本発明は、画像をベクトル表現する画像処理技術に関するものであり、特に、ラスタ画像をメッシュ群で表現するベクトル表現技術に関するものである。 The present invention relates to an image processing technique for expressing an image as a vector, and more particularly to a vector expression technique for expressing a raster image by a mesh group.
従来から、画像をベクトル表現する技術は広く知られている。ベクトル表現された画像は、拡大縮小時に画質劣化が少ない、画像編集し易い、高い圧縮率を実現できるなどの利点がある。 Conventionally, a technique for expressing an image as a vector is widely known. The vector-represented image has advantages such as little image quality degradation at the time of enlargement / reduction, easy image editing, and high compression ratio.
イラストや文字をベクトル表現するには、オブジェクトの輪郭をベジェ、スプライン関数などで近似する手法が用いられている。オブジェクト領域内は、単一色、線形グラデーション、放射状グラデーションなどで塗ることができるが、複雑なグラデーションの表現は困難である。 In order to represent an illustration or a character in a vector, a method of approximating the contour of an object with a Bezier or spline function is used. The object area can be painted with a single color, linear gradation, radial gradation, etc., but it is difficult to express complex gradation.
複雑なグラデーションを含むオブジェクトをベクトル表現するには、Adobe Illustrator(登録商標)のグラディエント・メッシュ・ツールが一般に用いられている。グラディエント・メッシュでは、メッシュに色と勾配を与えて3次関数を生成することで複雑なグラデーションを含むオブジェクトを描画できる(特許文献1)。 In order to represent an object including a complex gradation as a vector, an Adobe Illustrator (registered trademark) gradient mesh tool is generally used. In a gradient mesh, an object including a complex gradation can be drawn by generating a cubic function by giving a color and a gradient to the mesh (Patent Document 1).
グラディエント・メッシュは4頂点から成る曲線メッシュであるが、3頂点から成る曲線メッシュを用いることでより複雑なグラデーションをベクトル表現する技術が知られている(非特許文献1)。画像内のエッジを線分群として抽出し(以下エッジ線と呼ぶ)、エッジ線を再現する3頂点曲線メッシュ群を構成することでベクトル表現を行う。ここで、3頂点曲線メッシュとは、メッシュの頂点数が3であり、頂点間を結ぶメッシュの辺が直線または曲線であるものとする。 A gradient mesh is a curved mesh composed of four vertices, but a technique for expressing a more complex gradation vector by using a curved mesh composed of three vertices is known (Non-Patent Document 1). Edges in the image are extracted as line segments (hereinafter referred to as edge lines), and a vector expression is performed by constructing a 3-vertex curve mesh group that reproduces the edge lines. Here, the three-vertex curve mesh is assumed that the number of vertices of the mesh is 3, and the sides of the mesh connecting the vertices are straight lines or curves.
自然画像のような色が複雑に変化するオブジェクトを3頂点曲線メッシュ群によりベクトル表現することを考える。直線メッシュに対して曲線メッシュは、オブジェクトの形状や特徴を曲線で近似するため、より少ないメッシュ数でオブジェクトを近似できる。3頂点曲線メッシュ群で画像を精度良く近似するためには、エッジ線を再現し、且つ画像の大域的な色変化の特徴を捉えたメッシュ群を生成する必要がある。 Consider a vector representation of an object such as a natural image whose color changes in a complex manner using a three-vertex curve mesh group. Since a curved mesh approximates the shape and characteristics of an object with a curved line, the object can be approximated with a smaller number of meshes. In order to approximate an image with a three-vertex curve mesh group with high accuracy, it is necessary to generate a mesh group that reproduces edge lines and captures the characteristics of global color change of the image.
例えば非特許文献1では、画像内のエッジ線を抽出し、エッジ線に沿うようなメッシュ群を生成する。そしてその後、メッシュ毎にRGBの3成分に対して、メッシュ内の色を塗る薄板スプライン関数を入力画像の色を元に最適化して生成している。このとき、隣接するメッシュ間はエッジ線をまたいでいない時のみ、薄板スプライン関数を連続させることでエッジ部分の急峻な色変化とグラデーション部分の緩やかな色変化を表現している。しかしこの方法では、メッシュ毎に色決定のための最適化演算を要するため、画像近似精度は良いが計算量が多くなってしまう。
For example, in Non-Patent
他にはメッシュを更に微小な3頂点からなるメッシュに細分割し、細分割メッシュの頂点をサンプリング点として入力画像から色を取得し、それら微小な三角形内の色を双線形補間で補うことで、メッシュの色を表現する手法が考えられる。しかしこの手法によるとエッジ部分において同じ頂点をサンプリング点として取得することとなるため、エッジの急峻な色変化を表現できなくなってしまう。特にエッジ線が会合する交点部分においては、色の浸み出しが発生してしまい画質の劣化を招く。 Otherwise, the mesh is further subdivided into three fine vertices, the colors are obtained from the input image using the vertices of the subdivided mesh as sampling points, and the colors in these small triangles are compensated by bilinear interpolation. A method of expressing the color of the mesh can be considered. However, according to this method, since the same vertex is acquired as the sampling point in the edge portion, it becomes impossible to express a sharp color change of the edge. In particular, at the intersections where the edge lines meet, color oozes out, leading to degradation of image quality.
本発明はこのような問題に鑑みて成されたものであり、エッジ線交点部分においても色再現性の良い3頂点曲線メッシュ群を生成するための技術を提供することを目的とする。 The present invention has been made in view of such problems, and an object thereof is to provide a technique for generating a three-vertex curve mesh group having good color reproducibility even at an edge line intersection.
本発明の目的を達成するために、例えば、本発明の画像処理装置は、入力画像から検出された検出線が、3頂点から成り且つ該3頂点間を結ぶ辺が直線または曲線であるメッシュの一辺となるように、前記入力画像を該メッシュを単位に分割し、該メッシュを複数のサブメッシュに分割し、該サブメッシュの各頂点を色点として該色点に色を割り当てる画像処理装置であって、前記入力画像中のメッシュ辺のうち前記検出線に対応するメッシュ辺を対応メッシュ辺とし、該対応メッシュ辺上の色点のうち着目色点が3以上の対応メッシュ辺の交点となっている場合、該交点を共有するメッシュ群を該3以上の対応メッシュ辺を境界にして複数のグループに分割し、それぞれのグループ内の該交点に近接する位置の色を、前記着目色点に割り当てる第1の割り当て手段と、前記対応メッシュ辺上の前記交点ではない色点に対しては、該色点を共有するそれぞれのメッシュ内で該色点に近接する位置の色を、該色点に割り当てる第2の割り当て手段と、前記対応メッシュ辺上の色点以外の他色点に対して、前記入力画像中の該他色点の位置における色を割り当てる第3の割り当て手段と、前記第1乃至3の割り当て手段によって割り当てた色を出力する手段とを備えることを特徴とする。 In order to achieve the object of the present invention, for example, the image processing apparatus of the present invention has a mesh having a detection line detected from an input image consisting of three vertices and a side connecting the three vertices being a straight line or a curve. An image processing apparatus that divides the input image into units of the mesh so as to be one side, divides the mesh into a plurality of sub-mesh, and assigns colors to the color points using the vertices of the sub-mesh as color points. The mesh side corresponding to the detection line among the mesh sides in the input image is the corresponding mesh side, and the color point of interest among the color points on the corresponding mesh side is an intersection of the corresponding mesh sides of three or more. The mesh group sharing the intersection is divided into a plurality of groups with the three or more corresponding mesh sides as a boundary, and the color at a position close to the intersection in each group is defined as the target color point. Allocation And a color point that is not the intersection point on the corresponding mesh side, the color at a position close to the color point in each mesh that shares the color point is the color point. Second assigning means for assigning to each other, third assigning means for assigning a color at the position of the other color point in the input image to a color point other than the color point on the corresponding mesh side, And means for outputting the color assigned by one to three assigning means.
本発明の構成により、エッジ線交点部分においても色再現性の良い3頂点曲線メッシュ群を生成することができる。 With the configuration of the present invention, it is possible to generate a three-vertex curve mesh group with good color reproducibility even at the edge line intersection.
以下、添付図面を参照し、本発明の好適な実施形態について説明する。なお、以下説明する実施形態は、本発明を具体的に実施した場合の一例を示すもので、特許請求の範囲に記載の構成の具体的な実施例の1つである。 Preferred embodiments of the present invention will be described below with reference to the accompanying drawings. The embodiment described below shows an example when the present invention is specifically implemented, and is one of the specific examples of the configurations described in the claims.
[第1の実施形態]
先ず、本実施形態で用いる3頂点曲線メッシュについて説明する。上記の通り、3頂点曲線メッシュの各辺は曲線若しくは線分であるが、この曲線は、ベジェ曲線で構成されても良いし、B−スプラインで構成されても良い。即ち、曲線の種類は特定の種類に限るものではない。以下では説明上、3頂点曲線メッシュにパラメトリック曲面の一つである3頂点のベジェパッチを用いるものとする。ベジェパッチの中でも特に3次のベジェパッチでは、メッシュの各辺が3次のベジェ曲線となるため、3頂点曲線メッシュを生成したのちにユーザによる編集が容易であるという利点がある。P1、P2、P3を頂点とする3次のベジェパッチ内の点は以下の式で表される。
[First Embodiment]
First, the three-vertex curve mesh used in this embodiment will be described. As described above, each side of the three-vertex curve mesh is a curve or a line segment, but this curve may be constituted by a Bezier curve or a B-spline. That is, the type of curve is not limited to a specific type. In the following description, a three-vertex Bezier patch that is one of parametric curved surfaces is used for the three-vertex curved mesh. Among the Bezier patches, in particular, the cubic Bezier patch has an advantage that each side of the mesh becomes a cubic Bezier curve, so that the user can easily edit after generating the three-vertex curve mesh. The points in the cubic Bezier patch having the vertices at P1, P2, and P3 are expressed by the following equations.
ここでs、t、uはパッチのパラメータ(パッチ内の重心座標)である。また、p1、p2、p3はそれぞれ、頂点P1、P2、P3の座標値である。c1、c2、c3、c4、c5、c6およびc7は曲線パッチの形状を定めるパラメータである。ここで、c1からc6はベジェパッチの輪郭を決める3つのベジェ曲線の制御点に対応するパラメータである。c7はベジェパッチの輪郭には関与しないパラメータであり、本実施形態ではベジェパッチの頂点の座標と、輪郭を成すベジェ曲線の制御点に対応するパラメータから以下の式によって定める。 Here, s, t, and u are patch parameters (center-of-gravity coordinates in the patch). Further, p1, p2, and p3 are coordinate values of the vertices P1, P2, and P3, respectively. c1, c2, c3, c4, c5, c6 and c7 are parameters for determining the shape of the curved patch. Here, c1 to c6 are parameters corresponding to control points of three Bezier curves that determine the contour of the Bezier patch. c7 is a parameter that does not relate to the contour of the Bezier patch. In this embodiment, the parameter is determined from the coordinates of the vertex of the Bezier patch and the parameter corresponding to the control point of the Bezier curve forming the contour by the following equation.
次に、本実施形態に係る画像処理装置の機能構成例について、図1のブロック図を用いて説明する。なお、図1に示した構成はあくまで以下に説明する処理を実行するための構成の一例に過ぎない。 Next, a functional configuration example of the image processing apparatus according to the present embodiment will be described with reference to the block diagram of FIG. The configuration illustrated in FIG. 1 is merely an example of a configuration for executing processing described below.
画像入力部101には、ラスタ表現の画像(入力画像)が入力される。入力画像はカラー画像、グレー画像、白黒画像のいずれでも構わない。また、入力画像は矩形画像でも構わないし、画像の一部をベクトル化したい場合には背景部を透過色に設定した画像等、切り出された領域が与えられても良い。そして画像入力部101は、この入力画像を後段の特徴線検出部102に転送する。
A raster representation image (input image) is input to the
特徴線検出部102は、入力画像中に、特徴を表す曲線形状の特徴線を構成する。本実施形態では、特徴線としてエッジ線を用いる。特徴線を構成するための処理は大きく分けて、エッジ検出処理と、エッジ線構成処理と、に分けられる。
The feature
先ず、エッジ線検出処理について説明する。エッジ線検出処理では先ず、入力画像からエッジを構成する画素(エッジ画素)を検出する。本実施形態では、キャニー法という既知の方法を用いてエッジ画素を検出するが、他の手法を用いてエッジ画素を検出するようにしても良い。また、キャニー法が効果的に機能するように、入力画像に対して明るさ調整、エッジ強調などの前処理を施しても構わない。 First, the edge line detection process will be described. In the edge line detection process, first, pixels (edge pixels) constituting an edge are detected from the input image. In the present embodiment, the edge pixel is detected using a known method called the Canny method, but the edge pixel may be detected using another method. In addition, preprocessing such as brightness adjustment and edge enhancement may be performed on the input image so that the Canny method functions effectively.
そして次に、エッジ線構成処理を行う。エッジ線構成処理では先ず、隣接するエッジ画素間を結ぶ線分を構成することで、エッジ線を再現する線分群を構成する。隣接するエッジ画素間を結んで線分群を構成する際に、注目エッジ画素の上、下、左、右にある4つのエッジ画素が隣接しているとみなす4連結接続がある。また、この4方向に加えて右上、右下、左上、左下にある4つのエッジ画素も隣接していると見なす8連結接続もある。本実施形態では8連結接続を用いるが、これは一例に過ぎない。 Then, an edge line configuration process is performed. In the edge line configuration process, first, a line segment that reproduces an edge line is configured by configuring a line segment that connects adjacent edge pixels. When a line segment group is formed by connecting adjacent edge pixels, there is a four-connection connection in which four edge pixels located above, below, left, and right of the target edge pixel are considered to be adjacent. Further, in addition to these four directions, there are eight connected connections in which four edge pixels on the upper right, lower right, upper left, and lower left are considered to be adjacent. In the present embodiment, eight linked connections are used, but this is only an example.
ここで、キャニー法を用いて検出したエッジ画素に対して8連結接続で隣接しているとみなせるエッジ画素間を結ぶと、エッジ線として望ましくない結果が得られる場合がある。このケースについて図2を用いて説明する。 Here, when edge pixels that can be considered to be adjacent to each other by 8-connection are connected to edge pixels detected using the Canny method, an undesirable result may be obtained as an edge line. This case will be described with reference to FIG.
図2(a)〜(d)には画像中のある領域を構成する画素群を示しており、1つの四角形が1つの画素を表している。また、斜線で示している四角形がエッジ画素を表しており、斜線がない四角形がエッジ画素以外の画素(非エッジ画素)を表している。 FIGS. 2A to 2D show a pixel group constituting a certain area in the image, and one square represents one pixel. In addition, a rectangle indicated by hatching represents an edge pixel, and a rectangle without hatching represents a pixel other than the edge pixel (non-edge pixel).
図2(a)に示したエッジ画素群について、8連結接続で隣接したエッジ画素を結ぶと、図2(b)に示すように、エッジ画素201、202、203を結ぶようなループが発生してしまう。図2(a)に示すようなエッジ画素が検出された場合、このようなループの発生を抑制する必要がある。そこで本実施形態では、8連結接続を行う前に、Hilditch細線化法という既知の手法を用いることで、この問題を解決する。図2(a)に示したエッジ画素群に対してHilditch細線化を行うと、図2(b)に示したエッジ画素201は非エッジ画素となる。その結果、図2(c)に示すように、エッジ画素(204〜207)がループのない1つのエッジ線によって結ばれることになる。
As shown in FIG. 2B, when the edge pixel group shown in FIG. 2A is connected to adjacent edge pixels by 8-connection, a loop that connects the
このとき、図2(d)のエッジ画素208に示すように、複数のエッジ線が一か所に会合するようなパターンが発生することがある。このような場合は、会合するエッジ線を分断し、それぞれ独立したエッジ線として扱うこととする。図2(d)の例でいえばエッジ線は3本となる。
At this time, as shown by the
なお、特徴線にはエッジ線以外にも、例えば入力画像中のオブジェクトの領域の輪郭などが考えられる。ここでオブジェクトとは、文字や物体像等を指している。既に述べたように、入力画像の一部をベクトル化するという目的で、入力画像の一部が透過色に設定されている場合は、透過色と非透過色の境界に有る画素がオブジェクトの輪郭画素となる。オブジェクトの輪郭画素を1つの線分群にまとめる処理は、エッジ線構成処理と同様の処理に従って隣接する画素同士をつなぎ合わせることで実現できる。これは、入力画像内の異なる属性の領域の間の境界線にある画素についても同様である。 In addition to the edge line, for example, the contour of an object region in the input image can be considered as the feature line. Here, the object refers to a character, an object image, or the like. As already mentioned, for the purpose of vectorizing a part of the input image, if a part of the input image is set to transparent color, the pixel at the boundary between the transparent color and the non-transparent color is the outline of the object. It becomes a pixel. The process of combining the contour pixels of the object into one line segment group can be realized by connecting adjacent pixels according to the same process as the edge line configuration process. The same applies to pixels on the boundary line between regions having different attributes in the input image.
また、特徴線検出部102は、入力画像を領域分割し、その境界線を特徴線としても良い。領域分割は最近傍法を用いたもの、EMアルゴリズムを利用したものなど、多くの手法が知られている。本実施形態では、濃度変化の基準として閾値を定めたうえでキャニー法を適用してエッジ画素を検出し、このエッジ画素を用いて特徴線を構成する。
The feature
図1に戻って、次に、特徴点抽出部103は、特徴線上のサンプル点のうち、最終的に用いるサンプル点を特徴点として決定する。特徴点抽出部103の動作について、図3,4を用いて説明する。
Returning to FIG. 1, next, the feature
図3(a)には、入力画像中のある領域で構成された特徴線を示している。特徴点抽出部103は、この特徴線上に複数のサンプル点を設定する。このサンプル点は上記のエッジ画素であっても良い。
FIG. 3A shows a characteristic line configured by a certain area in the input image. The feature
ある区間における特徴線上のサンプル点群を図4(a)に示す。図4(a)において401〜405はサンプル点を示している。特徴線の端点を起点として隣接するサンプル点を順番に削除して近似関数を生成していく。
A sample point group on a characteristic line in a certain section is shown in FIG. In FIG. 4A,
先ず、図4(b)に示す如く、特徴線の端点であるサンプル点401を起点として、まずサンプル点402が削除され、サンプル点401とサンプル点403とを近似曲線の端点として、サンプル点402を近似するように近似曲線406を生成する。ここで近似関数は、3次のベジェ関数を最小自乗近似により生成しているが、B−スプライン関数など他の関数を用いても構わない。生成した近似曲線406と削除したサンプル点402との距離から誤差を計算し、誤差が閾値以内であれば次のサンプル点を削除する。本実施形態では、誤差の閾値は1画素としている。図4(b)では誤差が閾値以内であるとして、次の処理を説明する。
First, as shown in FIG. 4B, starting from the
図4(c)に示す如く、次に隣接したサンプル点403を削除して、サンプル点401とサンプル点404を近似曲線の端点として、サンプル点402とサンプル点403を近似するように近似曲線407を生成する。近似曲線407とサンプル点402、403との誤差を計算する。図4(c)では誤差が閾値以内であるとして、次の処理を説明する。
As shown in FIG. 4C, the next
図4(d)に示す如く、次に隣接したサンプル点404を削除して、サンプル点401とサンプル点405を近似曲線の端点としてサンプル点402、403、404を近似するように近似曲線408を生成する。近似曲線408とサンプル点402、403、404との誤差を計算する。ここで近似曲線408とサンプル点402、404との誤差が閾値を超えたとする。このとき近似曲線408は採用せず、前に生成された近似曲線407が有効な近似関数として採用される。
As shown in FIG. 4D, next, the
そしてこの場合は、図4(e)に示す如く、特徴線の端点であるサンプル点401を起点とし、サンプル点402、403は削除され、近似曲線407の端点であるサンプル点404を特徴点としてサンプリングする。すなわち、特徴線の端点であるサンプル点401とサンプル点405、特徴点としてサンプリングされたサンプル点404が第1の特徴点として採用される。ここで、サンプル点がより多いとき、サンプル点404を起点として同様の処理を繰り返して、特徴点を決定していく。以上の処理により、図2(c)のエッジ画素204、207のような特徴線の端点と図2(d)のエッジ画素208のような特徴線の交点に加え、特徴点が抽出される。図3(a)の特徴線に対し、最終的にサンプリングされた特徴点は、図3(b)の白丸301と星印302で示される通りである。もちろん画像の特徴を再現できるのであれば、特徴線の端点間を均等にサンプリングして特徴点とするなど他の方法を用いても構わない。
In this case, as shown in FIG. 4E, the
図1に戻って、曲線メッシュ生成部104は、特徴線を再現可能に、入力画像を3頂点曲線メッシュ群に分割する。曲線メッシュ生成部104が行う処理について、同処理のフローチャートを示す図5を用いて説明する。もちろん、図5のフローチャートに示した各ステップにおける処理の主体は何れも曲線メッシュ生成部104である。
Returning to FIG. 1, the curved
先ず、ステップS501では、曲線化対象とする辺を設定する。ここでは、特徴点抽出部103によって決定された特徴点において、特徴線上で隣接している特徴点間を結ぶ線分を曲線化対象とする辺として設定する。
First, in step S501, a side to be curved is set. Here, in the feature points determined by the feature
次に、ステップS502では、ステップS501で設定した辺を制約条件として制約付きドロネー三角形分割を利用することで、設定した辺がメッシュの辺となる3頂点直線メッシュ群を生成する。制約付きドロネー三角形分割は、点群と制約条件を与えると、与えられた点群を頂点とし、かつ制約条件を満たす直線メッシュを生成するアルゴリズムである。ここで制約条件とは点群の一部を結ぶ線分である。もちろん、設定した辺を再現する3頂点直線メッシュを生成することができるのであれば、他の方法を用いても良い。 Next, in step S502, by using the Delaunay triangulation with constraints using the side set in step S501 as a constraint condition, a three-vertex line mesh group in which the set side becomes a side of the mesh is generated. The constrained Delaunay triangulation is an algorithm that, when given a point group and a constraint condition, generates a straight line mesh with the given point group as a vertex and satisfying the constraint condition. Here, the constraint condition is a line segment connecting a part of the point group. Of course, other methods may be used as long as a three-vertex straight line mesh that reproduces the set side can be generated.
ステップS503では、曲線化対象となる全ての辺を曲線化したか否かを判断する。この判断の結果、曲線化対象となる全ての辺を曲線化したのであれば、図5のフローチャートに従った処理は完了し、曲線化対象となる辺のうちまだ曲線化していない辺が残っているのであれば、処理はステップS504に進む。 In step S503, it is determined whether or not all sides to be curved have been curved. As a result of the determination, if all the sides to be curved have been curved, the processing according to the flowchart of FIG. 5 is completed, and the sides that have not yet been curved remain among the sides to be curved. If yes, the process proceeds to step S504.
ステップS504では、曲線化対象となる辺のうちまだ曲線化してない辺を1つ選択する。そしてステップS505では、ステップS504で選択した辺を曲線化する。この曲線化では、特徴線を近似するようにメッシュの辺を曲線化する。本実施形態では特徴点抽出部103で生成した3次のベジェ関数をそのままメッシュの辺として利用しているため、曲線を再計算する必要はない。図3(a)の特徴線に対してこのような3頂点曲線メッシュ群生成処理を行った結果を図6に示す。
In step S504, one side that has not yet been curved is selected from the sides to be curved. In step S505, the side selected in step S504 is curved. In this curving, the sides of the mesh are curved so as to approximate the feature line. In the present embodiment, the cubic Bezier function generated by the feature
図1に戻って、次に、色点抽出部105は、曲線メッシュ生成部104によって入力画像上に設定された各メッシュを塗るために必要な色情報を定める。色情報を生成する為には様々な方法が考えられる。その方法の1つとして考えられるのが、各メッシュを一色で塗る方法である。一色の定め方としては、メッシュの内部に含まれる画素の画素値の平均値を、このメッシュの色情報とする方法などがある。メッシュ内の色をより複雑に表現する方法としては、各メッシュに対して色を表現する関数を生成する方法が考えられる。例えば非特許文献1では、RGBの3成分に対して、メッシュ内の色を塗る薄板スプライン関数を入力画像の色を元に生成している。本実施形態では、各メッシュを更に微小な3頂点からなるメッシュ(サブメッシュ)に分割し、分割したサブメッシュの頂点の画素の色を入力画像から取得し、該頂点に割り当てる(色割り当て)。レンダリングの際はそれら微小な三角形内の色を双線形補間で補うことで、各メッシュの色を塗ることができる。
Returning to FIG. 1, the color
ここで、各メッシュを構成するために必要な形状情報と色情報について説明する。図7(a)は、3頂点から成り且つ3頂点間が曲線で結ばれている(何れの辺も曲線で表現されている)メッシュ(3頂点曲線メッシュ)に係る形状情報を示す。701、702、703は曲線メッシュの頂点、704〜709は曲線メッシュの制御点である。この形状情報は、曲線メッシュ生成部104によって生成されている。
Here, shape information and color information necessary for configuring each mesh will be described. FIG. 7A shows shape information relating to a mesh (three-vertex curve mesh) composed of three vertices and connected between three vertices by a curve (all sides are expressed by a curve).
図7(b)は、図7(a)に示した曲線メッシュに係る色情報を示す。710〜724は曲線メッシュ内におけるサブメッシュの頂点(色点)であり、それぞれの色点は色情報を有する。ここでは色点はRGB値を色情報として有しているものとして説明するが、CMYKなど他の色空間における色情報を有するものとしても良い。また、入力画像がグレー画像である場合、色点は、対応する画素の輝度情報を色情報として保持することになる。色点は、ベジェパッチを規則的に分割することで導出される。ここでは色点として15点を用いているが、ベジェパッチの分割数を変更し、色点数を変更しても構わない。例えば、図8(a)では分割数が1であり、色点のサンプリング数は3となる。また図8(b)、(c)、(d)ではそれぞれ、分割数が2、3、4であり、色点のサンプリング数は6、10、15点となる。
FIG. 7B shows color information relating to the curved mesh shown in FIG.
図1に戻って、次に、エッジ上色点補完部106は、エッジ線をまたぐ際に起こる急峻な色変化を表現するために、色点の色情報を補完する。本実施形態では、特徴線に沿って曲線化された辺(曲線化辺と呼称する)の各色点には、一つの色点に2種類の色を保持させることで前述の色変化を表現している。図9(a)の色点901〜905は、曲線化辺上にない色点であるので、このような色点には1色を保持させる。対して図9(b)の色点906〜910は、曲線化辺上にある色点であるので、このような色点には2色を保持させる。つまり本実施形態では、曲線化辺が2種類の色を有する。実際に色点に持たせる色としては曲線化辺を該曲線化辺に対して垂直方向に数画素分ずらした位置における入力画像の色を適用するなどが考えられる。図9(b)の例では、色点906〜910は白と黒の色を有し、右側のメッシュをレンダリングするときは、辺の右側の色を用いている。また左側のメッシュをレンダリングするときは、辺の左側の色を用いている。また、3本以上の曲線化辺が会合する図3の星印302で示されるような交点に関しては次の工程で補完するため本工程での補完対象としない。
Returning to FIG. 1, the on-edge color
図1に戻って、次に、交点色補完部107は、曲線化辺が3本以上会合する交点部分における急峻な色変化を表現するために、該交点上の色点の色を補完する。本実施形態では、交点上の色点に会合する曲線化辺の本数と同数の色を該色点に保持させることで前述の色変化を表現している。図10(a)の破線(1002、1003、1004)は曲線化辺、実線はそれ以外のメッシュの辺を表現している。また図10(a)の色点1001は曲線化辺1002、1003、1004の交点となっている。また1005〜1010はそれぞれ色点1001を共有するメッシュである。このとき、色点1001で会合する曲線化辺の本数は3本であるため、この色点1001は3色を有する。このような交点部分における色を決定するために交点色補完部107が行う処理について、同処理のフローチャートを示す図11を用いて説明する。なお、図10(b)は図10(a)の例における交点部分付近を拡大した図である。
Returning to FIG. 1, the intersection
先ず、ステップS1101では、交点を共有する曲線化辺の数Enumを計数する。図10の例では、交点(色点1001)を共有する曲線化辺は、曲線化辺1002,1003,1004の3本であるので、Enum=3となる。次に、ステップS1102では、以下の処理で用いる変数iを1に初期化する。
First, in step S1101, the number Enum of curved edges sharing the intersection is counted. In the example of FIG. 10, since there are three
ステップS1103ではEnum本の曲線化辺を(交点を軸に時計若しくは半時計回り順に)E1,…,EEnumとした場合に、EiとEi+1(EEnum+1=E1)との間にはさまれるメッシュMij(j=1〜Minum)の数Minumを計数する。図10の例では、E1を曲線化辺1002、E2を曲線化辺1003、E3を曲線化辺1004とした場合に、E1とE2との間にはさまれているメッシュは、メッシュ1005(M11),1006(M12)の2つのであるので、Minum=2となる。また、E2とE3との間にはさまれているメッシュは、メッシュ1007(M21)の1つのであるので、Minum=1となる。また、E3とE1との間にはさまれているメッシュは、メッシュ1008(M31),1009(M32),1010(M33)の3つのであるので、Minum=3となる。
In step S1103, when Enum curved edges are set to E1,. The number Minum of j = 1 to Minum) is counted. In the example of FIG. 10, when E1 is a
ステップS1104では、Minum=1であるか否かを判断する。この判断の結果、Minum=1であれば処理はステップS1105に進み、Minum≠1であれば、処理はステップS1106に進む。 In step S1104, it is determined whether Minum = 1. If Minum = 1 as a result of this determination, the process proceeds to step S1105. If Minum ≠ 1, the process proceeds to step S1106.
ステップS1105では、メッシュMi1における交点近傍の色を取得し、該取得した色を交点の色として設定する。具体的には、EiとEi+1のそれぞれにおいて交点に最も近い色点を特定し、特定したそれぞれの色点の中点位置を求める。この中点位置は、メッシュMi1中の位置である。そしてこの中点位置における色を入力画像から取得し、該取得した色を交点に対して設定する。 In step S1105, the color near the intersection in the mesh Mi1 is acquired, and the acquired color is set as the color of the intersection. Specifically, the color point closest to the intersection is specified in each of Ei and Ei + 1, and the midpoint position of each specified color point is obtained. This midpoint position is a position in the mesh Mi1. The color at the midpoint position is acquired from the input image, and the acquired color is set for the intersection.
図10の例では、i=2の場合に処理はステップS1004からステップS1005に進む。この場合、曲線化辺1003、1004において、色点1001に最も近い色点は色点1012,1013である。然るに、色点1012と色点1013との中点位置(メッシュ1007内の位置)を求め、この中点位置における色を入力画像から取得し、該取得した色を色点1001に対して設定する。こうすることで、エッジ付近の中間色を取ることなく、パッチ内部の安定した色で交点の色を補完することができる。
In the example of FIG. 10, when i = 2, the process proceeds from step S1004 to step S1005. In this case, the color points closest to the
一方、ステップS1006では、EiとEi+1とにはさまれたメッシュにおいて、交点近傍の、曲線化辺上にはない色点の色を取得し、該取得した色から計算される計算色を交点の色として設定する。具体的には、EiとEi+1とにはさまれたメッシュにおいて、交点近傍の、曲線化辺上にはない複数の色点を特定し、特定したそれぞれの色点における色から計算される計算色(例えば平均色)を求め、該求めた計算色を交点の色として設定する。 On the other hand, in step S1006, in the mesh sandwiched between Ei and Ei + 1, the color of the color point near the intersection and not on the curvilinear side is acquired, and the calculated color calculated from the acquired color is calculated at the intersection. Set as color. Specifically, in a mesh sandwiched between Ei and Ei + 1, a plurality of color points that are not on the curved side in the vicinity of the intersection are specified, and a calculated color calculated from the colors at the specified color points (For example, an average color) is obtained, and the obtained calculated color is set as the color of the intersection.
図10の例では、i=1の場合やi=3の場合に、処理はステップS1004からステップS1005に進む。i=3の場合、曲線化辺1004と曲線化辺1002との間にはさまれたメッシュはメッシュ1008〜1010である。そして、メッシュ1008〜1010内の色点のうち、曲線化辺上にはなく且つ色点1001の近傍(ここでは最も近い)の色点は色点1014,1015である。この場合、色点1014,1015の色から計算色を求め、該求めた計算色を色点1001に設定する。こうすることでエッジ付近の中間色を取ることなく、かつ複数のメッシュとの色の連続性を保持しながら交点の色を補完することができる。
In the example of FIG. 10, when i = 1 or i = 3, the process proceeds from step S1004 to step S1005. When i = 3, meshes sandwiched between the
なお、i=1の場合、曲線化辺1002と曲線化辺1003との間にはさまれたメッシュ1005,1006内の色点のうち、曲線化辺上にはなく且つ色点1001の近傍(ここでは最も近い)の色点は色点1011のみとなる。このような場合は、色点1011の色を色点1001に設定することになる。
When i = 1, the color points in the
ステップS1107では、i=Enumであるか否かを判断する。この判断の結果、i=Enumであれば、図11のフローチャートに従った処理は終了する。一方、i<Enumであれば、処理はステップS1108に進む。ステップS1108では、変数iの値を1つインクリメントし、ステップS1103以降の処理を繰り返す。 In step S1107, it is determined whether i = Enum. If i = Enum as a result of this determination, the processing according to the flowchart of FIG. 11 ends. On the other hand, if i <Enum, the process proceeds to step S1108. In step S1108, the value of variable i is incremented by one, and the processing from step S1103 is repeated.
以上説明した各処理を実行することで、メッシュによる画像表現のために必要な形状情報と色情報とを設定することができる。 By executing the processes described above, it is possible to set shape information and color information necessary for image representation using a mesh.
図1に戻って、画像出力部108は、これまでの処理で得られたメッシュによる画像表現のために必要な形状情報と色情報とを元にレンダリング処理を行うことで、画像を生成し、該生成した画像を出力する。生成した画像の出力先は、特定の出力先に限るものではなく、CRTや液晶画面などに表示しても良いし、適当なメモリに出力しても良いし、外部装置に対して出力しても良い。また、上記の処理により得られた形状情報や色情報は、周知のメッシュ符号化の対象として処理しても良い。
Returning to FIG. 1, the
以上の処理を入力画像に対して行うことで、ビットマップで表現される画像をそのまま拡大した場合に発生するようなジャギーを発生させることなく、かつエッジの周辺や、交点部分の急峻な色変化を再現した画像を得ることができる。 By performing the above processing on the input image, there is no jaggy that occurs when the image represented by the bitmap is enlarged as it is, and there is a steep color change around the edge or at the intersection. Can be obtained.
<第1の実施形態の変形例>
図1に示した各部はハードウェアで構成しても良いが、ソフトウェア(コンピュータプログラム)として実装しても良い。この場合、このソフトウェアは、PC(パーソナルコンピュータ)等、一般のコンピュータのメモリにインストールされることになる。そしてこのコンピュータのCPUがこのインストールされたソフトウェアを実行することで、このコンピュータは、上述の画像処理装置の機能(図1に示した各部の機能)を実現することになる。即ち、このコンピュータは、上述の画像処理装置に適用することができる。図12を用いて、第1の実施形態に係る画像処理装置として適用可能なコンピュータのハードウェア構成例について説明する。
<Modification of First Embodiment>
Each unit shown in FIG. 1 may be configured by hardware, but may be implemented as software (computer program). In this case, the software is installed in a memory of a general computer such as a PC (personal computer). When the CPU of the computer executes the installed software, the computer realizes the functions of the above-described image processing apparatus (functions of each unit illustrated in FIG. 1). That is, this computer can be applied to the above-described image processing apparatus. A hardware configuration example of a computer applicable as the image processing apparatus according to the first embodiment will be described with reference to FIG.
CPU1201は、RAM1202やROM1203に格納されているコンピュータプログラムやデータを用いて、コンピュータ全体の制御を行うと共に、画像処理装置が行うものとして説明した上述の各処理を実行する。即ち、図1に示した各部が行うものとして上述した各処理を実行する。
The
RAM1202は、コンピュータ読み取り可能な記憶媒体の一例である。RAM1202は、外部記憶装置1207や記憶媒体ドライブ1208からロードされたコンピュータプログラムやデータ、I/F(インターフェース)1209を介して外部装置から受信したデータなどを一時的に記憶するためのエリアを有する。更に、RAM1202は、CPU1201が各種の処理を実行する際に用いるワークエリアを有する。即ち、RAM1202は、各種のエリアを適宜提供することができる。ROM1203は、コンピュータ読み取り可能な記憶媒体の一例であり、コンピュータの設定データや、ブートプログラムなどが格納されている。
The
キーボード1204、マウス1205は、コンピュータの操作者が操作することで、各種の指示をCPU1201に対して入力することができる。表示装置1206は、CRTや液晶画面などにより構成されており、CPU1201による処理結果を画像や文字などをもって表示することができる。例えば、上記入力画像を表示したり、3頂点曲線メッシュ群や上記レンダリング結果などを表示したりすることができる。
A
外部記憶装置1207は、コンピュータ読み取り記憶媒体の一例であり、ハードディスクドライブ装置に代表される大容量情報記憶装置である。外部記憶装置1207には、OS(オペレーティングシステム)や、図1に示した各部の機能をCPU1201に実現させるためのコンピュータプログラムやデータ、上記入力画像のデータ、既知の情報として説明した情報等が保存されている。外部記憶装置1207に保存されているコンピュータプログラムやデータは、CPU1201による制御に従って適宜RAM1202にロードされ、CPU1201による処理対象となる。
The external storage device 1207 is an example of a computer-readable storage medium, and is a large-capacity information storage device represented by a hard disk drive device. The external storage device 1207 stores an OS (operating system), computer programs and data for causing the
記憶媒体ドライブ1208は、CD−ROMやDVD−ROMなどの記憶媒体に記録されているコンピュータプログラムやデータを読み出し、読み出したコンピュータプログラムやデータを外部記憶装置1207やRAM1202に出力する。なお、外部記憶装置1207に保存されているものとして説明した情報の一部若しくは全部をこの記憶媒体に記録させておき、この記憶媒体ドライブ1208に読み取らせても良い。
The storage medium drive 1208 reads a computer program and data recorded on a storage medium such as a CD-ROM or DVD-ROM, and outputs the read computer program or data to the external storage device 1207 or the
I/F1209は、外部装置をコンピュータに接続する為のものである。例えば、ディジタルカメラなど、上記入力画像を取得するための装置を、このI/F1209に接続し、この装置から入力画像をI/F1209を介してRAM1202や外部記憶装置1207に取得するようにしても良い。1210は、上述の各部を繋ぐバスである。
The I /
上述構成において、本コンピュータの電源がONになると、CPU1201はROM1203に格納されている上記ブートプログラムに従って、外部記憶装置1207からOSをRAM1202にロードする。この結果、キーボード1204、マウス1205を介した情報入力操作が可能となり、表示装置1206にGUIを表示することが可能となる。ユーザが、キーボード1204やマウス1205を操作し、外部記憶装置1207に格納された画像処理用アプリケーションプログラムの起動指示を入力すると、CPU1201はこのプログラムをRAM1202にロードし、実行する。これにより、本コンピュータが上記の画像処理装置として機能することになる。
In the above configuration, when the computer is turned on, the
CPU1201が実行する画像処理用のアプリケーションプログラムは、基本的に図1,16の各処理部、及び、図5,11,14の各ステップに示す各構成要素に相当する関数を備えることになる。
The image processing application program executed by the
[第2の実施形態]
第1の実施形態では、図11で示した交点色補完処理においては交点近傍の色点の色、もしくは色点間を結ぶ直線の中点位置における色そのものを交点の色として適用していた。しかしこれはメッシュ内の色の移り変わりを反映していない。本実施形態ではこれを考慮し、メッシュ内の色を用いて線形外挿を行う。なお、本実施形態は、以下に説明する点以外については、第1の実施形態と同様であるとする。即ち、以下では、第1の実施形態との差分のみについて説明する。
[Second Embodiment]
In the first embodiment, in the intersection color complement processing shown in FIG. 11, the color of the color point near the intersection or the color itself at the midpoint position of the straight line connecting the color points is applied as the color of the intersection. However, this does not reflect the color transition in the mesh. In the present embodiment, this is taken into consideration, and linear extrapolation is performed using colors in the mesh. This embodiment is the same as the first embodiment except for the points described below. That is, only the difference from the first embodiment will be described below.
図13(a)の破線(1302、1303、1304)は曲線化辺、実線はそれ以外のメッシュの辺を表現している。また図13(a)の色点1301は曲線化辺1302、1303、1304の交点となっている。また1305〜1310はそれぞれ色点1301を共有するメッシュである。このとき、色点1301で会合する特徴線の本数は3本であるため、この色点1301は3色を有する。このような交点部分における色を決定するために交点色補完部107が行う処理について、同処理のフローチャートを示す図14を用いて説明する。なお、図13(b)は図13(a)の例における交点部分付近を拡大した図である。ステップS1401〜S1403はそれぞれ、上記のステップS1101〜S1103と同じであるため、説明は省略する。
In FIG. 13A, broken lines (1302, 1303, 1304) represent curved edges, and solid lines represent other mesh edges. Further, the
ステップS1404では、Minumが偶数であるか奇数であるかを判断する。この判断の結果、Minumが偶数である場合には、処理はステップS1406に進み、Minumが奇数である場合には、処理はステップS1405に進む。 In step S1404, it is determined whether Minum is an even number or an odd number. As a result of the determination, if Minum is an even number, the process proceeds to step S1406. If Minum is an odd number, the process proceeds to step S1405.
ステップS1405では、EiとEi+1との間にはさまれるメッシュのうち中央のメッシュを特定し、特定したメッシュにおいて交点を通る辺上の色点のうち、交点近傍の色点を特定し、特定した色点を用いて交点の色を決める。 In step S1405, the center mesh is specified from among the meshes sandwiched between Ei and Ei + 1, and among the color points on the sides passing through the intersection in the identified mesh, the color points near the intersection are identified and identified. The color of the intersection is determined using the color point.
図13の例では、E1を曲線化辺1302、E2を曲線化辺1303、E3を曲線化辺1304とした場合に、E1とE3との間には3つのメッシュ(メッシュ1308,1309,1310)がさまれている。このうち中央のメッシュはメッシュ1309であるので、メッシュ1309の辺のうち色点1301を通る辺(辺1312,1312)を特定し、特定した辺1312,1313上の色点のうち、色点1301に最も近い色点、2番目に近い色点を特定する。図13の場合は、色点1301に最も近い色点は色点1316,1318となり、2番目に近い色点は色点1317,1319となる。
In the example of FIG. 13, when E1 is a
そして、最も近い色点間の中点位置における色と、2番目に近い色点間の中間位置における色と、を入力画像から取得する。図13の場合は、色点1316と色点1318との中間位置1320における色と、色点1317と色点1319との中間位置1321における色と、を入力画像から取得する。そして、中間位置1320及び中間位置1321の座標位置及び色を用いて、線形外挿法により交点の色を決定する。
Then, the color at the midpoint position between the closest color points and the color at the intermediate position between the second closest color points are acquired from the input image. In the case of FIG. 13, the color at the
一方、ステップS1406では、EiとEi+1との間にはさまれるメッシュのうち中央の2つのメッシュを特定し、特定した2つのメッシュで共有する辺上の色点のうち、交点近傍の色点を特定し、特定した色点を用いて交点の色を決める。 On the other hand, in step S1406, two meshes at the center of the meshes sandwiched between Ei and Ei + 1 are specified, and among the color points on the side shared by the two specified meshes, the color points near the intersection are selected. Identify and determine the color of the intersection using the identified color points.
図13の例では、E1とE2との間には2つのメッシュ(メッシュ1305,1306)がさまれている。このうち中央の2つのメッシュはメッシュ1305,1306であり、これらのメッシュで共有している辺は辺1311となる。そして、辺1311上の色点のうち色点1301に最も近い色点、2番目に近い色点を求める。図13の例では、色点1301に最も近い色点は色点1314、2番目に近い色点は色点1315となる。そして、最も近い色点における色と、2番目に近い色点における色と、を入力画像から取得する。図13の場合は、色点1314における色と、色点1315における色と、を入力画像から取得する。そして、色点1314及び色点1315の座標位置及び色を用いて、線形外挿法により交点の色を決定する。
In the example of FIG. 13, two meshes (
ステップS1407及びS1408はそれぞれ、図11のステップS1107及びS1108と同じであるため、説明は省略する。以上の処理を行うことで、メッシュ内の色の移り変わりも反映した交点色の補完を実現できる。 Steps S1407 and S1408 are the same as steps S1107 and S1108 in FIG. By performing the above processing, it is possible to complement the intersection color reflecting the color transition in the mesh.
なお、第1,2の実施形態で説明した構成はあくまで一実施形態としての構成であり、以下に説明する構成の一例に過ぎない。即ち、何れの実施形態も、次のような画像処理装置の一例に過ぎない。すなわち、入力画像から検出された検出線が3頂点曲線メッシュの一辺となるように、入力画像を該メッシュを単位に分割し、該メッシュを複数のサブメッシュに分割し、該サブメッシュの各頂点を色点として該色点に色を割り当てる画像処理装置である。 The configuration described in the first and second embodiments is merely a configuration as an embodiment, and is merely an example of the configuration described below. In other words, any of the embodiments is merely an example of the following image processing apparatus. That is, the input image is divided into units of the mesh so that the detection line detected from the input image becomes one side of the three-vertex curve mesh, the mesh is divided into a plurality of sub-mesh, and each vertex of the sub-mesh Is an image processing apparatus that assigns a color to the color point.
この画像処理装置では、入力画像中のメッシュ辺のうち検出線に対応するメッシュ辺を対応メッシュ辺とすると、該対応メッシュ辺上の色点のうち着目色点が3以上の対応メッシュ辺の交点となっている場合には、次のようにしてこの着目色点に色を割り当てる。すなわち、該交点を共有するメッシュ群を該3以上の対応メッシュ辺を境界にして複数のグループに分割し、それぞれのグループ内の該交点に近接する位置の色を、着目色点に割り当てる(第1の割り当て)。図10の例では、交点としての色点1001を共有するメッシュ群(メッシュ1005〜1010)をE1〜E3を境界にして、(メッシュ1005,1006)、(メッシュ1007)、(メッシュ1008〜1010)の3グループに分割している。そして、グループ(メッシュ1005,1006)内で交点に近接する位置の色、グループ(メッシュ1007)内で交点に近接する位置の色、グループ(メッシュ1008〜1010)内で交点に近接する位置の色、を色点1001に割り当てる。
In this image processing apparatus, when a mesh side corresponding to a detection line among mesh sides in an input image is a corresponding mesh side, an intersection of corresponding mesh sides having three or more target color points among color points on the corresponding mesh side. In this case, a color is assigned to the target color point as follows. That is, the mesh group sharing the intersection is divided into a plurality of groups with the three or more corresponding mesh sides as boundaries, and the color at the position close to the intersection in each group is assigned to the target color point (first 1 allocation). In the example of FIG. 10, mesh groups (
また、対応メッシュ辺上の交点ではない色点に対しては、該色点を共有するそれぞれのメッシュ内で該色点に近接する位置の色を、該色点に割り当てる(第2の割り当て)。また、対応メッシュ辺上の色点以外の他色点に対しては、入力画像中の該他色点の位置における色を割り当てる(第3の割り当て)。そして、このような第1乃至3の割り当てによって割り当てた色を出力する。 For a color point that is not an intersection on the corresponding mesh side, a color at a position close to the color point in each mesh sharing the color point is assigned to the color point (second assignment). . Further, a color at a position of the other color point in the input image is assigned to a color point other than the color point on the corresponding mesh side (third assignment). Then, the colors assigned by the first to third assignments are output.
このような構成において、第1の実施形態では、複数のグループの中に、1つのメッシュから成るグループが含まれていた場合には、第1の割り当てとして、次のような処理を行っている。即ち、該1つのメッシュにおいて交点を共有する一方の対応メッシュ辺上の色点のうち交点に最も近い色点、他方の対応メッシュ辺上の各色点のうち交点に最も近い色点、を特定する。そして、該特定したそれぞれの色点の中間位置における入力画像上の色を、着目色点に割り当てる。 In such a configuration, in the first embodiment, when a group composed of one mesh is included in a plurality of groups, the following processing is performed as the first assignment. . That is, the color point closest to the intersection among the color points on one corresponding mesh side sharing the intersection in the one mesh and the color point closest to the intersection among the color points on the other corresponding mesh side are specified. . Then, the color on the input image at the intermediate position between the specified color points is assigned to the target color point.
また、複数のグループの中に、2以上のメッシュから成るグループが含まれていた場合には、第1の割り当てとして、該2以上のメッシュ内の他色点のうち交点に近接する他色点の色若しくはその平均色を、着目色点に割り当てる処理を行っている。 In addition, when a group composed of two or more meshes is included in the plurality of groups, the other color point close to the intersection among the other color points in the two or more meshes is assigned as the first assignment. Is assigned to the target color point.
また、第2の実施形態では、複数のグループの中に、奇数個のメッシュから成るグループが含まれていた場合には、第1の割り当てとして、次のような処理を行っている。即ち、該奇数個のメッシュのうち中央のメッシュの着目色点を通るそれぞれのメッシュ辺から、着目色点に最も近い色点、2番目に近い色点を特定する。そして、該それぞれのメッシュ辺から特定した着目色点に最も近い色点の中間位置における色と、該それぞれのメッシュ辺から特定した着目色点に2番目に近い色点の中間位置における色と、を用いて求めた色を、着目色点に割り当てる。 In the second embodiment, when a group composed of an odd number of meshes is included in a plurality of groups, the following processing is performed as the first assignment. That is, the color point closest to the target color point and the second closest color point are specified from the mesh sides passing through the target color point of the center mesh among the odd number of meshes. A color at an intermediate position of a color point closest to the target color point specified from each mesh side; and a color at an intermediate position of the color point closest to the target color point specified from the respective mesh side; The color obtained using is assigned to the color point of interest.
また、複数のグループの中に、偶数個のメッシュから成るグループが含まれている場合には、第1の割り当てとして、次のような処理を行っている。即ち、該偶数個のメッシュのうち中央の2つのメッシュで共有しているメッシュ辺上の色点から着目色点に最も近い色点、2番目に近い色点を特定し、該最も近い色点における色と、該2番目に近い色点における色と、を用いて求めた色を、着目色点に割り当てる。 Further, when a group composed of an even number of meshes is included in the plurality of groups, the following processing is performed as the first assignment. That is, among the even number of meshes, the color point closest to the target color point is identified from the color points on the mesh side shared by the two central meshes, and the closest color point is specified. And the color obtained using the color at the second closest color point are assigned to the target color point.
[第3の実施形態]
第1の実施形態では、特徴点抽出部103において、特徴線上にベジェ近似の誤差の多寡でのみ特徴点とするか否かを決定していたが、交点からの距離が一定の箇所に必ず特徴点を取るよう特徴点の補正を行ってもよい。こうすることで、交点付近のメッシュは一定の大きさを保つことができるため、微小なメッシュでの交点色補正を行わずともよくなるようになり、より安定した交点の色補完を行うことができる。
[Third Embodiment]
In the first embodiment, the feature
[第4の実施形態]
第1の実施形態では、出力データを画像データとしており、メッシュの形状情報と色情報をその過程で中間データとしてのみ用いているが、第1の実施形態でも述べたように、該メッシュの形状情報と色情報を符号データとして出力してもよい。符号データは、例えば図15に示す如く、メッシュを構成する各頂点に係る情報である頂点情報1501、メッシュを構成する各辺に係る情報であるメッシュ辺情報1502、メッシュの色に係る情報である色情報1503、を含む形態で出力しても良い。
[Fourth Embodiment]
In the first embodiment, output data is image data, and mesh shape information and color information are used only as intermediate data in the process. However, as described in the first embodiment, the shape of the mesh is used. Information and color information may be output as code data. The code data is, for example, as shown in FIG. 15,
頂点情報1501は、メッシュの頂点数1504、メッシュ頂点ID1505、メッシュ頂点座標1506からなる。メッシュ辺情報1502は、メッシュ辺数1507、メッシュ辺ID1508、メッシュ辺を形成するメッシュ頂点のID1509と、メッシュ辺を曲線化するための制御点座標1510からなる。色情報1503は、メッシュ数1511と、メッシュを形成するメッシュ辺のID1512と、メッシュ内の色点の色1513からなる。
The
なお、復号の際には上記情報を読み込んで、メッシュをビットマップデータとしてレンダリングすることで所望の画像を得ることができる。このような符号データの生成や該符号データから画像データを得るための復号は、図1の画像処理装置が行うようにしても良いし、他の装置が行うようにしても良い。 In decoding, a desired image can be obtained by reading the above information and rendering the mesh as bitmap data. Such generation of code data and decoding for obtaining image data from the code data may be performed by the image processing apparatus of FIG. 1 or may be performed by another apparatus.
[第5の実施形態]
第4の実施形態では、符号データを生成する際に交点色補完を行った上で出力しているが、交点の色は設定済みの他の色点から補完することができるので、交点色補完を符号化時に行う必要は必ずしもない。例えば、符号データを生成する側の装置の構成を図16(a)に示すような構成とし、該符号データを復号する側の装置の構成を図16(b)に示すような構成としても良い。
[Fifth Embodiment]
In the fourth embodiment, when the code data is generated, the intersection color is complemented and output. However, since the color of the intersection can be complemented from other set color points, the intersection color complement is performed. Is not necessarily performed at the time of encoding. For example, the configuration of the device on the code data generation side may be configured as shown in FIG. 16A, and the configuration of the device on the code data decoding side may be configured as shown in FIG. .
図16(a)において1601〜1606の各部は、図1の101〜106と同じである。交点抽出部1607は、交点を用いているメッシュ頂点を特定する情報、例えばIDを抽出し、出力する。そして符号データ出力部1608は、メッシュの形状情報、色情報に加え、交点を用いている頂点を特定する情報を出力する。
In FIG. 16A, each part of 1601-1606 is the same as 101-106 of FIG. The
図16(b)において符号データ入力部1609は、符号データ出力部1608が出力したデータを受けて、これを後段の交点色補完部1610に転送する。交点色補完部1610は、符号データ中の交点を用いている頂点を特定する情報に基づき、交点を用いているメッシュを抽出する。そして抽出したメッシュにおいて、第1の実施形態で説明した交点色補完と同等の処理を行う。そして画像出力部1611は、メッシュデータをレンダリングし、該レンダリングの結果を画像として出力する。
In FIG. 16B, the code
このような構成により、符号化時には交点に複数の色を持たせなくてもよくなるため、符号データのサイズを第4の実施形態で説明した符号データのサイズよりも小さくすることができる。 With such a configuration, since it is not necessary to have a plurality of colors at the intersections at the time of encoding, the size of the code data can be made smaller than the size of the code data described in the fourth embodiment.
(その他の実施例)
また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。
(Other examples)
The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and a computer (or CPU, MPU, or the like) of the system or apparatus reads the program. It is a process to be executed.
Claims (7)
前記入力画像中のメッシュ辺のうち前記検出線に対応するメッシュ辺を対応メッシュ辺とし、該対応メッシュ辺上の色点のうち着目色点が3以上の対応メッシュ辺の交点となっている場合、該交点を共有するメッシュ群を該3以上の対応メッシュ辺を境界にして複数のグループに分割し、それぞれのグループ内の該交点に近接する位置の色を、前記着目色点に割り当てる第1の割り当て手段と、
前記対応メッシュ辺上の前記交点ではない色点に対しては、該色点を共有するそれぞれのメッシュ内で該色点に近接する位置の色を、該色点に割り当てる第2の割り当て手段と、
前記対応メッシュ辺上の色点以外の他色点に対して、前記入力画像中の該他色点の位置における色を割り当てる第3の割り当て手段と、
前記第1乃至3の割り当て手段によって割り当てた色を出力する手段と
を備えることを特徴とする画像処理装置。 The input image is divided into units of the mesh so that the detection line detected from the input image is composed of three vertices and the side connecting the three vertices is one side of a mesh that is a straight line or a curve. Is divided into a plurality of sub-mesh, and each vertex of the sub-mesh is used as a color point to assign a color to the color point,
The mesh side corresponding to the detection line among the mesh sides in the input image is the corresponding mesh side, and the color point of interest among the color points on the corresponding mesh side is the intersection of three or more corresponding mesh sides First, a mesh group sharing the intersection is divided into a plurality of groups with the three or more corresponding mesh sides as a boundary, and a color at a position close to the intersection in each group is assigned to the target color point. Assigning means,
For a color point that is not the intersection on the corresponding mesh side, a second assigning unit that assigns a color at a position close to the color point in each mesh sharing the color point to the color point; ,
Third assigning means for assigning a color at a position of the other color point in the input image to a color point other than the color point on the corresponding mesh side;
An image processing apparatus comprising: means for outputting colors assigned by the first to third assigning means.
前記複数のグループの中に、1つのメッシュから成るグループが含まれていた場合には、該メッシュにおいて前記交点を共有する一方の対応メッシュ辺上の色点のうち前記交点に最も近い色点、他方の対応メッシュ辺上の各色点のうち前記交点に最も近い色点、を特定し、該特定したそれぞれの色点の中間位置における前記入力画像上の色を、前記着目色点に割り当てる
ことを特徴とする請求項1に記載の画像処理装置。 The first assigning means includes
When the group consisting of one mesh is included in the plurality of groups, the color point closest to the intersection among the color points on one corresponding mesh side sharing the intersection in the mesh, Specifying the color point closest to the intersection among the color points on the other corresponding mesh side, and assigning the color on the input image at an intermediate position of the specified color points to the target color point The image processing apparatus according to claim 1, wherein:
前記複数のグループの中に、2以上のメッシュから成るグループが含まれていた場合には、該2以上のメッシュ内の前記他色点のうち前記交点に近接する他色点の色若しくはその平均色を、前記着目色点に割り当てる
ことを特徴とする請求項1又は2に記載の画像処理装置。 The first assigning means includes
In the case where a group composed of two or more meshes is included in the plurality of groups, the color of the other color point close to the intersection among the other color points in the two or more meshes or an average thereof The image processing apparatus according to claim 1, wherein a color is assigned to the target color point.
前記複数のグループの中に、奇数個のメッシュから成るグループが含まれていた場合には、該奇数個のメッシュのうち中央のメッシュの前記着目色点を通るそれぞれのメッシュ辺から、前記着目色点に最も近い色点、2番目に近い色点を特定し、該それぞれのメッシュ辺から特定した前記着目色点に最も近い色点の中間位置における色と、該それぞれのメッシュ辺から特定した前記着目色点に2番目に近い色点の中間位置における色と、を用いて求めた色を、前記着目色点に割り当てる
ことを特徴とする請求項1に記載の画像処理装置。 The first assigning means includes
When a group consisting of an odd number of meshes is included in the plurality of groups, the target color is determined from each mesh side passing through the target color point of the center mesh among the odd number of meshes. The color point closest to the point is specified, the color point closest to the second is specified, the color at the middle position of the color point closest to the target color point specified from the respective mesh sides, and the above specified from the respective mesh sides The image processing apparatus according to claim 1, wherein a color obtained by using a color at an intermediate position of a color point that is second closest to the target color point is assigned to the target color point.
前記複数のグループの中に、偶数個のメッシュから成るグループが含まれている場合には、該偶数個のメッシュのうち中央の2つのメッシュで共有しているメッシュ辺上の色点から前記着目色点に最も近い色点、2番目に近い色点を特定し、該最も近い色点における色と、該2番目に近い色点における色と、を用いて求めた色を、前記着目色点に割り当てる
ことを特徴とする請求項1又は4に記載の画像処理装置。 The first assigning means includes
In the case where a group consisting of an even number of meshes is included in the plurality of groups, the attention point is determined from a color point on a mesh side shared by two meshes at the center among the even number of meshes. A color point closest to the color point is specified, a color point closest to the second color point is specified, and a color obtained using the color at the closest color point and the color at the color point closest to the second is determined as the color point of interest. The image processing apparatus according to claim 1, wherein the image processing apparatus is assigned to the image processing apparatus.
前記画像処理装置の第1の割り当て手段が、前記入力画像中のメッシュ辺のうち前記検出線に対応するメッシュ辺を対応メッシュ辺とし、該対応メッシュ辺上の色点のうち着目色点が3以上の対応メッシュ辺の交点となっている場合、該交点を共有するメッシュ群を該3以上の対応メッシュ辺を境界にして複数のグループに分割し、それぞれのグループ内の該交点に近接する位置の色を、前記着目色点に割り当てる第1の割り当て工程と、
前記画像処理装置の第2の割り当て手段が、前記対応メッシュ辺上の前記交点ではない色点に対しては、該色点を共有するそれぞれのメッシュ内で該色点に近接する位置の色を、該色点に割り当てる第2の割り当て工程と、
前記画像処理装置の第3の割り当て手段が、前記対応メッシュ辺上の色点以外の他色点に対して、前記入力画像中の該他色点の位置における色を割り当てる第3の割り当て工程と、
前記画像処理装置の出力手段が、前記第1乃至3の割り当て工程で割り当てた色を出力する工程と
を備えることを特徴とする画像処理方法。 The input image is divided into units of the mesh so that the detection line detected from the input image is composed of three vertices and the side connecting the three vertices is one side of a mesh that is a straight line or a curve. Is divided into a plurality of sub-mesh, and an image processing method performed by an image processing apparatus that assigns a color to each color point using each vertex of the sub-mesh as a color point,
The first assigning unit of the image processing apparatus sets a mesh side corresponding to the detection line among mesh sides in the input image as a corresponding mesh side, and among the color points on the corresponding mesh side, a target color point is 3 When the intersection of the corresponding mesh sides is the above, the mesh group sharing the intersection is divided into a plurality of groups with the three or more corresponding mesh sides as a boundary, and the position close to the intersection in each group A first assigning step of assigning the color of the color to the target color point;
For a color point that is not the intersection point on the corresponding mesh side, the second assigning unit of the image processing apparatus selects a color at a position close to the color point in each mesh that shares the color point. A second assigning step assigning to the color point;
A third allocating step in which a third allocating unit of the image processing apparatus allocates a color at a position of the other color point in the input image to a color point other than the color point on the corresponding mesh side; ,
An image processing method, comprising: an output unit of the image processing apparatus outputting a color assigned in the first to third assignment steps.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012190615A JP5956875B2 (en) | 2012-08-30 | 2012-08-30 | Image processing apparatus and image processing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012190615A JP5956875B2 (en) | 2012-08-30 | 2012-08-30 | Image processing apparatus and image processing method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2014048847A JP2014048847A (en) | 2014-03-17 |
JP5956875B2 true JP5956875B2 (en) | 2016-07-27 |
Family
ID=50608472
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2012190615A Expired - Fee Related JP5956875B2 (en) | 2012-08-30 | 2012-08-30 | Image processing apparatus and image processing method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5956875B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6472226B2 (en) * | 2014-11-27 | 2019-02-20 | キヤノン株式会社 | Image processing apparatus, image processing method, and computer program |
JP6692984B1 (en) * | 2019-09-20 | 2020-05-13 | アジア航測株式会社 | Super resolution stereoscopic processing system and its program |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH05114030A (en) * | 1991-09-17 | 1993-05-07 | Nec Software Ltd | Area painting-out display system for polygon |
US6271861B1 (en) * | 1998-04-07 | 2001-08-07 | Adobe Systems Incorporated | Smooth shading of an object |
JP2003089300A (en) * | 2001-09-17 | 2003-03-25 | Harumi Okamoto | Polygonal picture pallete |
JP3872056B2 (en) * | 2003-11-10 | 2007-01-24 | 株式会社ソニー・コンピュータエンタテインメント | Drawing method |
JP5587132B2 (en) * | 2010-10-19 | 2014-09-10 | キヤノン株式会社 | Image processing apparatus and image processing method |
-
2012
- 2012-08-30 JP JP2012190615A patent/JP5956875B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2014048847A (en) | 2014-03-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8044955B1 (en) | Dynamic tessellation spreading for resolution-independent GPU anti-aliasing and rendering | |
KR100891428B1 (en) | System and method for generating color gradients, interpolation method for facilitating color gradients, computer readable recording medium storing data packet for facilitating color gradients | |
EP1833024B1 (en) | Image processing apparatus, image processing method, and image processing program | |
US8269770B1 (en) | Tessellation of trimmed parametric surfaces by walking the surface | |
KR102666054B1 (en) | Graphics processing systems | |
JP5451285B2 (en) | Image processing apparatus and image processing method | |
JP2006209223A (en) | Drawing method, image generation device and electronic information apparatus | |
US20180232915A1 (en) | Line stylization through graphics processor unit (gpu) textures | |
US11087511B1 (en) | Automated vectorization of a raster image using a gradient mesh with arbitrary topology | |
US7948489B1 (en) | Minimizing tessellation of surfaces | |
KR20160003223A (en) | Tessellation of two-dimensional curves using a graphics pipeline | |
CN110866965A (en) | Mapping drawing method and device for three-dimensional model | |
EP4094231A1 (en) | Mesh optimization for computer graphics | |
JP6294700B2 (en) | Image processing apparatus and image processing method | |
JP5956875B2 (en) | Image processing apparatus and image processing method | |
JP5798357B2 (en) | Image processing apparatus and image processing method | |
US8217936B1 (en) | Minimizing tessellation of surfaces | |
JP5888989B2 (en) | Image processing apparatus and image processing method | |
US11989807B2 (en) | Rendering scalable raster content | |
JP5587132B2 (en) | Image processing apparatus and image processing method | |
JP2012230668A (en) | Image processor, image processing method, and program | |
EP2372659A1 (en) | Method and system for rapidly vectorizing image by gradient meshes based on parameterization | |
JP6472226B2 (en) | Image processing apparatus, image processing method, and computer program | |
JP2015090613A (en) | Image processor and image processing method | |
US11776179B2 (en) | Rendering scalable multicolored vector content |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20150803 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20160516 |
|
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: 20160520 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20160617 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 5956875 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
LAPS | Cancellation because of no payment of annual fees |