JP2021108222A - Image processing device, image processing method, and image processing program - Google Patents

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

Info

Publication number
JP2021108222A
JP2021108222A JP2021076266A JP2021076266A JP2021108222A JP 2021108222 A JP2021108222 A JP 2021108222A JP 2021076266 A JP2021076266 A JP 2021076266A JP 2021076266 A JP2021076266 A JP 2021076266A JP 2021108222 A JP2021108222 A JP 2021108222A
Authority
JP
Japan
Prior art keywords
pixel
edge
region
value
area
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.)
Granted
Application number
JP2021076266A
Other languages
Japanese (ja)
Other versions
JP7246103B2 (en
JP2021108222A5 (en
Inventor
祐樹 中村
Yuki Nakamura
祐樹 中村
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.)
Axell Corp
Original Assignee
Axell Corp
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 Axell Corp filed Critical Axell Corp
Priority to JP2021076266A priority Critical patent/JP7246103B2/en
Publication of JP2021108222A publication Critical patent/JP2021108222A/en
Publication of JP2021108222A5 publication Critical patent/JP2021108222A5/ja
Application granted granted Critical
Publication of JP7246103B2 publication Critical patent/JP7246103B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

To improve calculation accuracy of an edge angle when enlarging an input image with high quality using a data-dependent triangulation method.SOLUTION: A contrast C of a first pixel region 12 is calculated from a pixel value of a pixel 11 included in the first pixel region 12. The first pixel region 12 is set as a reference region 15a when the contrast C is less than a threshold Cτ; a region including the first pixel region 12 and being larger than the first pixel region 12 is set as a reference region 15b when the contrast C is equal to or greater than a threshold Cτ. An angle θ of an edge 13 of the first pixel region is calculated using a pixel value of a pixel included in the reference region.SELECTED DRAWING: Figure 3

Description

本発明は、入力画像を高品質に拡大する画像処理装置、画像処理方法、及びそのプログラムに関し、特に、入力画像を複数の三角形により領域分割して画素を補間するデータ依存性三角形分割手法(Data Dependent Triangulation:DDT法)を用いて、入力画像を高品質に拡大することができる画像処理装置、画像処理方法、及びそのプログラムに関する。 The present invention relates to an image processing device for enlarging an input image with high quality, an image processing method, and a program thereof. In particular, a data-dependent triangle division method (Data) in which an input image is divided into regions by a plurality of triangles and pixels are interpolated. Dependent Triangulation (DDT method) is used to relate to an image processing apparatus capable of enlarging an input image with high quality, an image processing method, and a program thereof.

ビットマップ画像等のラスタ画像の拡大、回転、変形等をする際に、画像中に存在するエッジの角度を算出し、算出されたエッジの角度に基づいて作成したベクトルデータを用いて画素を補間する技術として、例えばDDT法が知られている(非特許文献1)。
DDT法は、コスト関数やエッジの角度に基づいて、ラスタ画像を複数の三角形によって領域分割する。ラスタ画像を領域分割する三角形メッシュデータはベクトルデータである。DDT法は、三角形の頂点に対応する画素の画素値と、ベクトルデータである三角形メッシュデータとを用いて、三角形メッシュ内の領域に画素を線形補間する。
上記DDT法を画像拡大処理に応用した画像処理方法として、特許文献2が挙げられる。
When enlarging, rotating, deforming, etc. a raster image such as a bitmap image, the angle of the edge existing in the image is calculated, and the pixels are interpolated using the vector data created based on the calculated edge angle. For example, the DDT method is known as a technique for interpolating (Non-Patent Document 1).
The DDT method divides the raster image into regions by a plurality of triangles based on the cost function and the angle of the edge. The triangular mesh data that divides the raster image into regions is vector data. In the DDT method, the pixel values of the pixels corresponding to the vertices of the triangle and the triangle mesh data which is the vector data are used to linearly interpolate the pixels in the region in the triangle mesh.
Patent Document 2 is mentioned as an image processing method in which the above DDT method is applied to image enlargement processing.

特開2018−32301号公報Japanese Unexamined Patent Publication No. 2018-32301

X.Yu, B.S. Morse, and T.W. Sederberg, “Image Reconstruction UsingData-Dependent Triangulation”, IEEE Computer Graphics and Applications, Vol.21, No. 3, pp. 62-68 May/Jun. (2001)X.Yu, B.S. Morse, and T.W. Sederberg, “Image Reconstruction UsingData-Dependent Triangulation”, IEEE Computer Graphics and Applications, Vol.21, No. 3, pp. 62-68 May / Jun. (2001)

特許文献1においては、ラスタ画像中の2×2画素からなる画素領域のエッジの角度を、2×2画素領域の情報のみに基づいて算出するため、エッジの角度の算出精度が低下する虞がある。
本発明は上述の事情に鑑みてなされたものであり、エッジの角度の算出精度を向上させることを目的とする。
In Patent Document 1, since the edge angle of the pixel region consisting of 2 × 2 pixels in the raster image is calculated based only on the information of the 2 × 2 pixel region, the calculation accuracy of the edge angle may decrease. be.
The present invention has been made in view of the above circumstances, and an object of the present invention is to improve the accuracy of calculating the edge angle.

上記の課題を解決するために、本発明は、複数の画素を含む第一画素領域を含み、前記第一画素領域よりも広い第二画素領域における前記各画素の画素値を取得する画素値取得手段と、前記第二画素領域における前記各画素の画素値を用いて前記第一画素領域のエッジの角度を算出するエッジ算出手段と、前記第一画素領域における前記画素の画素値の最大値と最小値との差を算出する差分算出手段と、を備え、前記エッジ算出手段は、前記画素値の最大値と最小値との差に応じて前記第一画素領域を含む参照領域を設定し、該参照領域における前記各画素の画素値を用いて前記第一画素領域の前記エッジの角度を算出することを特徴とする。 In order to solve the above problems, the present invention includes a first pixel region including a plurality of pixels, and acquires a pixel value of each pixel in a second pixel region wider than the first pixel region. Means, an edge calculating means for calculating the edge angle of the first pixel region using the pixel value of each pixel in the second pixel region, and the maximum value of the pixel value of the pixel in the first pixel region. The edge calculation means includes a difference calculation means for calculating the difference from the minimum value, and the edge calculation means sets a reference area including the first pixel area according to the difference between the maximum value and the minimum value of the pixel value. It is characterized in that the angle of the edge of the first pixel region is calculated by using the pixel value of each pixel in the reference region.

一実施態様によれば、エッジの角度の算出精度を向上させることが可能となる。 According to one embodiment, it is possible to improve the accuracy of calculating the edge angle.

本発明の一実施形態に係る画像処理装置の機能構成を示すブロック図である。It is a block diagram which shows the functional structure of the image processing apparatus which concerns on one Embodiment of this invention. 本発明の一実施形態に係るコンピュータのハードウェア構成を示すブロック図である。It is a block diagram which shows the hardware structure of the computer which concerns on one Embodiment of this invention. (a)〜(c)は、本発明の一実施形態に係る画像処理装置によるエッジ算出方法の概要について説明する図である。(A)-(c) is a figure explaining the outline of the edge calculation method by the image processing apparatus which concerns on one Embodiment of this invention. エッジ算出部が生成する中間画像を示す図である。It is a figure which shows the intermediate image generated by the edge calculation part. エッジ抽出部による対角線の抽出方法の一例について説明する模式図である。It is a schematic diagram explaining an example of the diagonal line extraction method by an edge extraction part. (a)〜(f)は、分割エッジとして抽出される対角線の検出パターンの一例を示す図である。(A) to (f) are diagrams showing an example of a diagonal detection pattern extracted as a dividing edge. (a)、(b)は、判定用の角度範囲の決定方法の一例について説明する模式図である。(A) and (b) are schematic views explaining an example of the method of determining the angle range for determination. (a)〜(d)は、補間される分割エッジの一例を示す図である。(A) to (d) are diagrams showing an example of the divided edges to be interpolated. 本発明の一実施形態に係る画像の処理手順を示したフローチャートである。It is a flowchart which showed the image processing procedure which concerns on one Embodiment of this invention.

以下、本発明を図に示した実施形態を用いて詳細に説明する。但し、この実施形態に記載される構成要素、種類、組み合わせ、形状、その相対配置などは特定的な記載がない限り、この発明の範囲をそれのみに限定する主旨ではなく単なる説明例に過ぎない。 Hereinafter, the present invention will be described in detail using the embodiments shown in the drawings. However, unless there is a specific description, the components, types, combinations, shapes, relative arrangements, etc. described in this embodiment are merely explanatory examples, not the purpose of limiting the scope of the present invention to that alone. ..

〔機能構成〕
図1は、本発明の一実施形態に係る画像処理装置の機能構成を示すブロック図である。
画像処理装置100は、ビットマップ画像等(ラスタ画像の一例)の入力画像を拡大・回転・変形し、高解像度化した或いは高品質化した出力画像を生成する装置である。画像処理装置100は、複数の画素により構成される入力画像(元画像)を、入力画像中のエッジを活用した複数の三角形によりメッシュ状に領域分割する。入力画像を三角形メッシュにより領域分割する領域分割情報はベクターデータである。画像処理装置100は、領域分割情報に基づいて入力画像を拡大して出力画像を生成する。
画像処理装置100は、エッジ算出部(画素値取得手段、エッジ算出手段)110、メッシュ生成部120、エッジ強調部130、及びラスタライズ部140を備える。
エッジ算出部110は、入力画像から複数の画素(元画素)を含む第一画素領域を選択し、第一画素領域における各画素の画素値に基づいてエッジの角度を算出する手段である。また、エッジ算出部110は、算出された各エッジの角度に対応する画素値を夫々有した中間画素により構成された中間画像を生成するエッジ画像生成手段としても機能する。エッジ算出部110は、コントラスト算出部(差分算出手段)111、グラディエント算出部112、及び、アウトライヤ算出部113を備える。
[Functional configuration]
FIG. 1 is a block diagram showing a functional configuration of an image processing apparatus according to an embodiment of the present invention.
The image processing device 100 is a device that enlarges, rotates, and transforms an input image such as a bitmap image (an example of a raster image) to generate a high-resolution or high-quality output image. The image processing device 100 divides an input image (original image) composed of a plurality of pixels into a mesh-like region by a plurality of triangles utilizing edges in the input image. The area division information for dividing the input image into areas by a triangular mesh is vector data. The image processing device 100 enlarges the input image and generates an output image based on the area division information.
The image processing device 100 includes an edge calculation unit (pixel value acquisition means, edge calculation means) 110, a mesh generation unit 120, an edge enhancement unit 130, and a rasterization unit 140.
The edge calculation unit 110 is a means for selecting a first pixel region including a plurality of pixels (original pixels) from an input image and calculating an edge angle based on the pixel value of each pixel in the first pixel region. The edge calculation unit 110 also functions as an edge image generation means for generating an intermediate image composed of intermediate pixels having pixel values corresponding to the calculated angles of each edge. The edge calculation unit 110 includes a contrast calculation unit (difference calculation means) 111, a gradient calculation unit 112, and an outliner calculation unit 113.

メッシュ生成部120は、エッジ算出部110により算出されたエッジの角度に基づいて、入力画像を複数の三角形により領域分割する手段である。メッシュ生成部120は、エッジ抽出部(エッジ抽出手段)121、検出パターン記憶部122、メッシュ補間部123、及び、補間パターン記憶部124を備える。
エッジ強調部130は、入力画像のエッジを強調した鮮鋭化画像を生成する。
ラスタライズ部140は、エッジ強調部130から出力される鮮鋭化画像を、メッシュ生成部120から出力される領域分割情報を用いて拡大すると共に、必要に応じてバイリニア法やバイキュービック法等を用いてピクセル補間を行って、高解像度化した出力画像を生成する。
上記画像処理装置100を構成する各部は電子回路(ハードウェア)により実現されるが、一般的なコンピュータが実行するソフトウェアにより実現されてもよい。
The mesh generation unit 120 is a means for dividing the input image into regions by a plurality of triangles based on the edge angle calculated by the edge calculation unit 110. The mesh generation unit 120 includes an edge extraction unit (edge extraction means) 121, a detection pattern storage unit 122, a mesh interpolation unit 123, and an interpolation pattern storage unit 124.
The edge enhancement unit 130 generates a sharpened image in which the edges of the input image are emphasized.
The rasterization unit 140 enlarges the sharpened image output from the edge enhancement unit 130 by using the region division information output from the mesh generation unit 120, and also uses a bilinear method, a bicubic method, or the like as necessary. Pixel interpolation is performed to generate a high-resolution output image.
Each part constituting the image processing apparatus 100 is realized by an electronic circuit (hardware), but may be realized by software executed by a general computer.

〔コンピュータの構成〕
図1に示した画像処理装置の各部をソフトウェアにより実現する場合のコンピュータのハードウェア構成の一例について説明する。
図2は、本発明の一実施形態に係るコンピュータのハードウェア構成を示すブロック図である。
画像処理装置100は、CPU(Central Processing Unit)151、ROM(Read Only Memory)152、RAM(Random Access Memory)153、及びバス154を備える。各構成要素は、バス154により接続される。なお、画像処理装置100は、記憶装置155、外部I/F156、リーダライタ157の何れか又は全部を備えてもよい。
[Computer configuration]
An example of the hardware configuration of the computer when each part of the image processing apparatus shown in FIG. 1 is realized by software will be described.
FIG. 2 is a block diagram showing a hardware configuration of a computer according to an embodiment of the present invention.
The image processing device 100 includes a CPU (Central Processing Unit) 151, a ROM (Read Only Memory) 152, a RAM (Random Access Memory) 153, and a bus 154. Each component is connected by a bus 154. The image processing device 100 may include any or all of the storage device 155, the external I / F 156, and the reader / writer 157.

CPU151は、ROM152に格納されたプログラム等を用いて画像処理装置100全体の制御をする。ROM152は、CPU151に画像処理装置100全体を制御する処理を実行させるための制御プログラムを記憶する不揮発性の記憶手段である。画像処理装置100全体を制御する処理を実行させるための制御プログラムは、画像処理装置100が備える記憶装置155に記憶されてもよい。ここで、記憶装置155は例えばHDD(Hard Disk Drive)やSSD(Solid State Drive)等である。
画像処理装置100全体を制御する処理を実行させるための制御プログラムは、記録媒体162に記憶され、画像処理装置100が備えるリーダライタ157で読み出されてROM152又は画像処理装置100が備える記憶装置155に記憶されてもよい。記録媒体162は、例えば、SDメモリーカード(SD Memory Card)、FD(Floppy Disk)、CD(Compact Disc)、DVD(Digital Versatile Disk)、BD(Blu-ray(登録商標) Disk)、およびフラッシュメモリなどの非一時的記録媒体である。
The CPU 151 controls the entire image processing apparatus 100 by using a program or the like stored in the ROM 152. The ROM 152 is a non-volatile storage means for storing a control program for causing the CPU 151 to execute a process of controlling the entire image processing device 100. The control program for executing the process of controlling the entire image processing device 100 may be stored in the storage device 155 included in the image processing device 100. Here, the storage device 155 is, for example, an HDD (Hard Disk Drive), an SSD (Solid State Drive), or the like.
The control program for executing the process of controlling the entire image processing device 100 is stored in the recording medium 162, read by the reader / writer 157 included in the image processing device 100, and stored in the ROM 152 or the storage device 155 included in the image processing device 100. It may be stored in. The recording medium 162 includes, for example, an SD memory card (SD Memory Card), an FD (Floppy Disk), a CD (Compact Disc), a DVD (Digital Versatile Disk), a BD (Blu-ray (registered trademark) Disk), and a flash memory. It is a non-temporary recording medium such as.

RAM153は、ROM152から読み出されたプログラムやデータ等を一時的に格納する揮発性の記憶手段である。CPU151が起動時にROM152から制御プログラムを読み出してRAM153に展開し、RAM153をワークスペースとして制御プログラムを実行することにより、各種の機能が実現される。
外部I/F156は、画像処理装置100と外部記憶装置161とを接続する。外部記憶装置161は、入力画像や出力画像等、各種のデータを記憶する。外部記憶装置161は、例えば、HDDやSSD等である。
図1に示したエッジ算出部110、メッシュ生成部120、エッジ強調部130、及びラスタライズ部140は、夫々、CPU151が制御プログラムをROM152等から読み出してRAM153に展開して実行することにより実現される。また、検出パターン記憶部122及び補間パターン記憶部124は、記憶装置155により実現される。
The RAM 153 is a volatile storage means for temporarily storing programs, data, and the like read from the ROM 152. Various functions are realized by the CPU 151 reading the control program from the ROM 152 at startup, expanding it into the RAM 153, and executing the control program using the RAM 153 as a workspace.
The external I / F 156 connects the image processing device 100 and the external storage device 161. The external storage device 161 stores various data such as an input image and an output image. The external storage device 161 is, for example, an HDD, an SSD, or the like.
The edge calculation unit 110, the mesh generation unit 120, the edge enhancement unit 130, and the rasterization unit 140 shown in FIG. 1 are each realized by the CPU 151 reading the control program from the ROM 152 or the like, expanding it into the RAM 153, and executing the control program. .. Further, the detection pattern storage unit 122 and the interpolation pattern storage unit 124 are realized by the storage device 155.

〔エッジ算出部〕
<処理概要>
図3(a)〜(c)は、本発明の一実施形態に係る画像処理装置によるエッジ算出方法の概要について説明する図である。
コントラスト算出部111は、図3(a)に示す入力画像10から、複数の画素11により形成される所定形状の第一画素領域12を選択し、第一画素領域12の各画素11の画素値(例えば輝度値)を取得する。コントラスト算出部111は、第一画素領域12を構成する各画素11の各画素値に基づいて、第一画素領域12における画素の画素値の差、即ちコントラストC(f_cont)を算出する(図3(b))。
グラディエント算出部112、及びアウトライヤ算出部113は、第一画素領域12のエッジ13の角度を算出する(図3(c))。本例において、グラディエント算出部112はエッジ13の角度を0〜90度の範囲で算出し、アウトライヤ算出部113はエッジ13の向き(右下方向、又は左下方向)を算出する。
[Edge calculation unit]
<Outline of processing>
3A to 3C are diagrams illustrating an outline of an edge calculation method by an image processing apparatus according to an embodiment of the present invention.
The contrast calculation unit 111 selects a first pixel region 12 having a predetermined shape formed by a plurality of pixels 11 from the input image 10 shown in FIG. 3A, and the pixel value of each pixel 11 in the first pixel region 12 (For example, brightness value) is acquired. The contrast calculation unit 111 calculates the difference between the pixel values of the pixels in the first pixel region 12, that is, the contrast C (f_cont), based on the pixel values of the pixels 11 constituting the first pixel region 12 (FIG. 3). (B)).
The gradient calculation unit 112 and the outliner calculation unit 113 calculate the angle of the edge 13 of the first pixel region 12 (FIG. 3 (c)). In this example, the gradient calculation unit 112 calculates the angle of the edge 13 in the range of 0 to 90 degrees, and the outliner calculation unit 113 calculates the direction of the edge 13 (lower right direction or lower left direction).

グラディエント算出部112は、第一画素領域12のコントラストCの大きさに応じて第一画素領域12を含む参照領域15(15a,15b)を設定する(図3(c))。即ち、グラディエント算出部112は、コントラストCが閾値Cτ未満の場合に第一画素領域12を参照領域15aとして設定し、コントラストCが閾値Cτ以上の場合に第一画素領域12よりも広い第二画素領域を参照領域15bとして設定する。グラディエント算出部112は、設定した参照領域15の各画素11の画素値を取得し、参照領域15における各画素の画素値を用いて第一画素領域12のエッジ13の角度を算出する。
アウトライヤ算出部113は、第一画素領域12の各画素11の画素値を取得し、第一画素領域12における各画素の画素値を用いて第一画素領域12のエッジ13の向きを算出する。
以下、各部の動作について、具体例を用いて詳細に説明する。
The gradient calculation unit 112 sets the reference area 15 (15a, 15b) including the first pixel area 12 according to the magnitude of the contrast C of the first pixel area 12 (FIG. 3 (c)). That is, the gradient calculation unit 112 sets the first pixel region 12 as the reference region 15a when the contrast C is less than the threshold value Cτ, and the second pixel wider than the first pixel region 12 when the contrast C is the threshold value Cτ or more. The area is set as the reference area 15b. The gradient calculation unit 112 acquires the pixel value of each pixel 11 of the set reference region 15, and calculates the angle of the edge 13 of the first pixel region 12 using the pixel value of each pixel in the reference region 15.
The outliner calculation unit 113 acquires the pixel value of each pixel 11 in the first pixel region 12, and calculates the direction of the edge 13 of the first pixel region 12 using the pixel value of each pixel in the first pixel region 12.
Hereinafter, the operation of each part will be described in detail with reference to specific examples.

<コントラスト算出部>
<<1要素画像の場合>>
図3(a)に示すように、コントラスト算出部111は、入力画像10の例えば左上から複数の画素11を含む第一画素領域12を順次設定し、各第一画素領域12に含まれる各画素の輝度値を取得する。コントラスト算出部111は第一画素領域12のコントラストC、言い換えれば、第一画素領域12における画素の輝度値の差を算出する。
ここで、第一画素領域12を2×2画素領域(2×2行列A)とし、各画素の輝度値(2×2行列Aの成分)をa,b,c,dとした場合、コントラストC(f_cont)は、例えば、

Figure 2021108222
・・・式(1)
のように算出される。なお、符号
Figure 2021108222
は、小数点以下の数値を切り捨てる床関数である。
このように、コントラスト算出部111は、第一画素領域12における最大輝度値と最小輝度値の差をコントラストCとして算出することができる。 <Contrast calculation unit>
<< In the case of 1-element image >>
As shown in FIG. 3A, the contrast calculation unit 111 sequentially sets the first pixel area 12 including a plurality of pixels 11 from the upper left of the input image 10, and each pixel included in each first pixel area 12. Get the brightness value of. The contrast calculation unit 111 calculates the contrast C of the first pixel region 12, in other words, the difference in the brightness values of the pixels in the first pixel region 12.
Here, when the first pixel area 12 is a 2 × 2 pixel area (2 × 2 matrix A) and the luminance value (component of the 2 × 2 matrix A) of each pixel is a, b, c, d, the contrast C (f_cont) is, for example,
Figure 2021108222
... Equation (1)
It is calculated as. The code
Figure 2021108222
Is a floor function that truncates numbers after the decimal point.
In this way, the contrast calculation unit 111 can calculate the difference between the maximum luminance value and the minimum luminance value in the first pixel region 12 as the contrast C.

<<多要素画像の場合>>
仮に、入力画像が、その各画素が夫々R(Red)、G(Green)、B(Blue)の各要素について夫々輝度値を有するRGB画像(多要素画像、特に3要素画像の一例)である場合、コントラストC(f_cont)は、第一画素領域12を2×2画素領域、要素Xに係る各画素の輝度値(行列Axの成分)をax,bx,cx,dxとして、

Figure 2021108222

Figure 2021108222

Figure 2021108222

Figure 2021108222
・・・式(2)
のように算出される。
このように、コントラスト算出部111は、入力画像が、入力画像の各画素が夫々複数の要素を有した多要素画像である場合も1要素画像の場合と同様に、コントラストCを算出することができる。 << For multi-factor images >>
Suppose that the input image is an RGB image (an example of a multi-element image, particularly a three-element image) in which each pixel has a brightness value for each element of R (Red), G (Green), and B (Blue). In the case of contrast C (f_cont), the first pixel area 12 is a 2 × 2 pixel area, and the brightness value (component of the matrix Ax) of each pixel related to the element X is ax, bx, cx, dx.
Figure 2021108222

Figure 2021108222

Figure 2021108222

Figure 2021108222
... Equation (2)
It is calculated as.
As described above, the contrast calculation unit 111 can calculate the contrast C even when the input image is a multi-element image in which each pixel of the input image has a plurality of elements, as in the case of the one-element image. can.

<<第一画素領域の形状>>
本例では第一画素領域を2×2画素により構成される正方形状の画素領域としているが、第一画素領域を、複数の画素を含むその他の矩形状の画素領域としてもよい。また、第一画素領域を、複数の画素を含む任意の形状の画素領域(例えば円形の画素領域)としてもよい。この場合、コントラスト算出部111は、矩形状の画素領域を選択し、不要な画素をマスクすることで、任意の形状の画素領域を第一画素領域として設定することができる。
<< Shape of first pixel area >>
In this example, the first pixel area is a square pixel area composed of 2 × 2 pixels, but the first pixel area may be another rectangular pixel area including a plurality of pixels. Further, the first pixel region may be a pixel region having an arbitrary shape including a plurality of pixels (for example, a circular pixel region). In this case, the contrast calculation unit 111 can set a pixel region having an arbitrary shape as the first pixel region by selecting a rectangular pixel region and masking unnecessary pixels.

<グラディエント算出部>
グラディエント算出部112は、図3(c)に示すようにコントラストCの大きさに応じて第一画素領域12を含む参照領域15(15a,15b)を設定する。具体的には、グラディエント算出部112は、コントラストCの大きさに応じて、第一画素領域12(参照領域15a)又は第一画素領域12よりも広い領域(参照領域15b)を参照領域15として設定する。グラディエント算出部112は、設定した参照領域15における各画素の輝度値を用いて第一画素領域12のエッジ13の角度θが0度〜90度の範囲で示されたグラディエントG(f_grad、(gx,gy))を算出する。
<Gradient calculation unit>
As shown in FIG. 3C, the gradient calculation unit 112 sets the reference area 15 (15a, 15b) including the first pixel area 12 according to the magnitude of the contrast C. Specifically, the gradient calculation unit 112 sets the first pixel region 12 (reference region 15a) or a region wider than the first pixel region 12 (reference region 15b) as the reference region 15 according to the magnitude of the contrast C. Set. The gradient calculation unit 112 uses the brightness value of each pixel in the set reference region 15 to indicate the gradient G (f_grad, (gx)) in which the angle θ of the edge 13 of the first pixel region 12 is shown in the range of 0 degrees to 90 degrees. , Gy)) is calculated.

<<2×2グラディエント関数>>
グラディエント算出部112は、コントラストCが閾値Cτ未満の場合に第一画素領域12を参照領域15aとして設定する(図3(c))。
参照領域15aが2×2画素領域であり、2×2行列Aとして表現される場合、グラディエント算出部112は、以下の式(3)に示される2×2グラディエント関数により参照領域15aの水平方向における輝度値の変化量(又は変化率)gxと、垂直方向における輝度値の変化量(又は変化率)gyと、を算出する。

Figure 2021108222
・・・式(3)
なお、記号「*」は行列のたたみ込みを表し、各行列の夫々の成分の積を足し合わせることを意味する。参照領域15aの各画素の輝度値(行列Aの成分)をa,b,c,dとしてグラディエントG(f_grad)を具体的に示せば、
Figure 2021108222

Figure 2021108222

Figure 2021108222
・・・式(4)
となる。式(4)に示すように、本例においてgxとgyは、共に正の数となる。 << 2 × 2 gradient function >>
The gradient calculation unit 112 sets the first pixel region 12 as the reference region 15a when the contrast C is less than the threshold value Cτ (FIG. 3C).
When the reference area 15a is a 2 × 2 pixel area and is expressed as a 2 × 2 matrix A, the gradient calculation unit 112 uses the 2 × 2 gradient function shown in the following equation (3) to move the reference area 15a in the horizontal direction. The amount of change (or rate of change) gx of the brightness value in the vertical direction and the amount of change (or rate of change) gy of the brightness value in the vertical direction are calculated.
Figure 2021108222
... Equation (3)
The symbol "*" represents the convolution of the matrix, and means that the products of the components of each matrix are added together. If the gradient G (f_grad) is specifically shown with the luminance values (components of the matrix A) of each pixel in the reference region 15a as a, b, c, and d,
Figure 2021108222

Figure 2021108222

Figure 2021108222
... Equation (4)
Will be. As shown in the formula (4), both gx and gy are positive numbers in this example.

仮に、入力画像が、入力画像の各画素が夫々R(Red)、G(Green)、B(Blue)の各要素について夫々輝度値を有するRGB画像(多要素画像、特に3要素画像の一例)である場合、そのグラディエントG(f_grad)は、各要素X(X∈{R,G,B})に係るグラディエントGの総和として求めることができる。

Figure 2021108222
・・・式(5) Suppose that the input image is an RGB image in which each pixel of the input image has a brightness value for each element of R (Red), G (Green), and B (Blue) (multi-element image, particularly an example of a three-element image). If, the gradient G (f_grad) can be obtained as the sum of the gradient G related to each element X (X ∈ {R, G, B}).
Figure 2021108222
... Equation (5)

<<4×4グラディエント関数>>
グラディエント算出部112は、コントラストCが閾値Cτ以上の場合に第一画素領域12を含み、且つ第一画素領域12よりも大きい領域(第二画素領域)を参照領域15bとして設定する(図3(c))。
本例において、グラディエント算出部112は、第一画素領域12よりも一回り大きい4×4画素領域を参照領域15bとして設定する。
<< 4 × 4 gradient function >>
The gradient calculation unit 112 sets a region (second pixel region) including the first pixel region 12 and larger than the first pixel region 12 as the reference region 15b when the contrast C is equal to or higher than the threshold value Cτ (FIG. 3 (FIG. 3). c)).
In this example, the gradient calculation unit 112 sets a 4 × 4 pixel area, which is one size larger than the first pixel area 12, as the reference area 15b.

参照領域15bが4×4画素領域である場合(4×4行列Bとして表現される)、グラディエント算出部112は、以下の式(6)に示される4×4グラディエント関数により参照領域15bの水平方向における輝度値の変化量(又は変化率)gxと、垂直方向における輝度値の変化量(又は変化率)gyと、を算出する。

Figure 2021108222
・・・式(6) When the reference area 15b is a 4 × 4 pixel area (expressed as a 4 × 4 matrix B), the gradient calculation unit 112 is horizontal to the reference area 15b by the 4 × 4 gradient function shown in the following equation (6). The amount of change (or rate of change) gx of the luminance value in the direction and the amount of change (or rate of change) gy of the luminance value in the vertical direction are calculated.
Figure 2021108222
... Equation (6)

グラディエント算出部112は、参照領域15bの各画素の輝度値に対し、第一画素領域12に含まれる画素との位置関係に応じた重み付け係数を乗じた上でエッジの角度(グラディエント)を算出する。即ち、グラディエント算出部112は、第一画素領域12を構成する画素の輝度値に対して重み付け係数「+4」又は「−4」を乗じ、第一画素領域12に対して水平又は垂直方向に隣接する画素の輝度値に対して重み付け係数「+2」又は「−2」を乗じ、他の画素の輝度値に対して重み付け係数「+1」又は「−1」を乗じている。
上記、重み付け係数には2のべき乗値が設定されている。重み付け係数に2のべき乗値を設定することにより、ビットをずらして計算するシフト演算が利用できるようになり、処理速度の向上を図ることができる。
The gradient calculation unit 112 calculates the edge angle (gradient) after multiplying the brightness value of each pixel in the reference region 15b by a weighting coefficient according to the positional relationship with the pixels included in the first pixel region 12. .. That is, the gradient calculation unit 112 multiplies the luminance value of the pixels constituting the first pixel region 12 by the weighting coefficient "+4" or "-4", and is adjacent to the first pixel region 12 in the horizontal or vertical direction. The brightness value of the pixel to be used is multiplied by the weighting coefficient "+2" or "-2", and the brightness value of the other pixels is multiplied by the weighting coefficient "+1" or "-1".
A power value of 2 is set for the weighting coefficient. By setting a power value of 2 to the weighting coefficient, a shift operation for calculating by shifting the bits can be used, and the processing speed can be improved.

<<エッジの角度θ>>
グラディエント算出部112は、式(3)又は式(6)により求めたグラディエントG(gx,gy)から、逆三角関数により第一画素領域12のエッジ13の角度θ(0°≦θ≦90°)を求めることができる。

Figure 2021108222
・・・式(7)
即ち、グラディエント算出部112は、参照領域15の水平方向における輝度値の変化率gxと垂直方向における輝度値の変化率gyとに基づいてエッジ13の角度θを算出する。
なお、逆三角関数の計算は処理負荷が高いため、式(7)の代わりに、角度θの正接
Figure 2021108222
・・・式(8)
を求めてもよい。 << Edge angle θ >>
The gradient calculation unit 112 uses an inverse trigonometric function to calculate the angle θ (0 ° ≦ θ ≦ 90 °) of the edge 13 of the first pixel region 12 from the gradient G (gx, gy) obtained by the formula (3) or the formula (6). ) Can be obtained.
Figure 2021108222
... Equation (7)
That is, the gradient calculation unit 112 calculates the angle θ of the edge 13 based on the rate of change gx of the brightness value in the horizontal direction of the reference region 15 and the rate of change gy of the brightness value in the vertical direction.
Since the calculation of the inverse trigonometric function has a high processing load, the tangent of the angle θ is used instead of the equation (7).
Figure 2021108222
... Equation (8)
May be sought.

グラディエント算出部112は、コントラストCが閾値Cτ以上の場合に、第一画素領域12よりも広い参照領域15bの各画素の輝度値に基づいてグラディエントGを算出するため、より正確にエッジ13の角度θを算出可能となる。また、参照領域15bの各輝度値に対して、第一画素領域12との位置関係に応じた重み付け係数を乗じることにより、より正確にエッジ13の角度θを算出できる。 When the contrast C is equal to or greater than the threshold value Cτ, the gradient calculation unit 112 calculates the gradient G based on the brightness value of each pixel in the reference region 15b wider than the first pixel region 12, so that the angle of the edge 13 is more accurately calculated. θ can be calculated. Further, the angle θ of the edge 13 can be calculated more accurately by multiplying each luminance value of the reference region 15b by a weighting coefficient according to the positional relationship with the first pixel region 12.

<アウトライヤ算出部>
アウトライヤ算出部113は、第一画素領域12における局所的なエッジ13の強さと方向を推定する値であるアウトライヤ(f_outlier)を算出する。
例えば、第一画素領域12を2×2画素領域(行列A)とした場合、アウトライヤ(f_outlier)は、

Figure 2021108222
・・・式(9)
のように算出される。なお、記号「*」は行列のたたみ込みを表し、各行列の夫々の成分の積を足し合わせることを意味する。 <Outlier calculation unit>
The outlier calculation unit 113 calculates an outlier (f_outlier) which is a value for estimating the strength and direction of the local edge 13 in the first pixel region 12.
For example, when the first pixel area 12 is a 2 × 2 pixel area (matrix A), the outlier (f_outlier) is
Figure 2021108222
... Equation (9)
It is calculated as. The symbol "*" represents the convolution of the matrix, and means that the products of the components of each matrix are added together.

第一画素領域12の各画素の輝度値(行列Aの成分)をa,b,c,dとしてアウトライヤ(f_outlier)を具体的に示せば、以下のようになる。

Figure 2021108222
・・・式(10)
即ち、アウトライヤ(f_outlier)の大きさは、斜め方向における輝度変化の大きさを示し、アウトライヤ(f_outlier)の符号は、エッジ13の向きを表す。アウトライヤ(f_outlier)が正の数をとるときエッジ13は右下方向を向き、負の数をとるときエッジ13は左下方向に向いていることを示す。
グラディエントGから求められるエッジの角度θが0〜90度の範囲であっても、アウトライヤの値を求めることによって、エッジの角度θを0〜180度の範囲で特定することができる。 The outliers (f_outlier) are specifically shown with the luminance values (components of the matrix A) of each pixel in the first pixel region 12 as a, b, c, and d as follows.
Figure 2021108222
... Equation (10)
That is, the magnitude of the outlier (f_outlier) indicates the magnitude of the change in brightness in the oblique direction, and the sign of the outlier (f_outlier) indicates the direction of the edge 13. When the outlier (f_outlier) takes a positive number, the edge 13 points in the lower right direction, and when the outlier (f_outlier) takes a negative number, the edge 13 points in the lower left direction.
Even if the edge angle θ obtained from the gradient G is in the range of 0 to 90 degrees, the edge angle θ can be specified in the range of 0 to 180 degrees by obtaining the outliner value.

<エッジ算出部が生成する中間画像>
図4は、エッジ算出部が生成する中間画像を示す図である。
最終的に、エッジ算出部110は、夫々の第一画素領域12における各エッジ13の角度θ(0〜90度、又は0〜180度)、又はこれを示す値(グラディエント(gx,gy)、及びアウトライヤ)を画素値として夫々有した複数の中間画素21により構成される中間画像20を生成する。即ち、エッジ算出部110は、各画素がエッジの角度情報を有する中間画像20を生成するエッジ画像生成手段として機能する。本例において中間画像20は、各中間画素21がグラディエントの値を有したグラディエント画像と、各中間画素21がアウトライヤの値を有したアウトライヤ画像の複数の画像から構成される。
各中間画素21が有するアウトライヤとグラディエントの値は、元画像(入力画像10)において第一画素領域12を構成する4つの画素11の関係性を示すものである。中間画像20は、入力画像10の各画素11の画素中心を頂点とする正方形状の領域として表される複数の中間画素21から構成される。また、中間画像20は入力画像10に対して右下方向に半画素ずれた位置関係となる。
<Intermediate image generated by the edge calculation unit>
FIG. 4 is a diagram showing an intermediate image generated by the edge calculation unit.
Finally, the edge calculation unit 110 determines the angle θ (0 to 90 degrees, or 0 to 180 degrees) of each edge 13 in each first pixel region 12, or a value indicating this (gradient (gx, gy), And an outliner) as pixel values, respectively, to generate an intermediate image 20 composed of a plurality of intermediate pixels 21. That is, the edge calculation unit 110 functions as an edge image generation means for generating an intermediate image 20 in which each pixel has edge angle information. In this example, the intermediate image 20 is composed of a plurality of images of a gradient image in which each intermediate pixel 21 has a gradient value and an outline image in which each intermediate pixel 21 has an outliner value.
The outliner and gradient values of each intermediate pixel 21 indicate the relationship between the four pixels 11 constituting the first pixel region 12 in the original image (input image 10). The intermediate image 20 is composed of a plurality of intermediate pixels 21 represented as a square region having the pixel center of each pixel 11 of the input image 10 as a vertex. Further, the intermediate image 20 has a positional relationship that is shifted by half a pixel in the lower right direction with respect to the input image 10.

<変形例>
本実施形態においては、グラディエントを算出するための参照領域15を設定するに際して、第一画素領域12の輝度のコントラスト(輝度値の差)を利用しているが、色のコントラスト(色差)等、画素の持つ輝度値以外の画素値の差を利用してもよい。輝度のコントラストに代えて、色のコントラスト(色を表す画素値の差)を用いてもよい。
グラディエント算出部112は、上記実施形態とは異なり、コントラストCが閾値Cτ未満の場合に第一画素領域12よりも広い領域を参照領域として設定し、コントラストCが閾値Cτ以上の場合に第一画素領域12を参照領域として設定してもよい。
<Modification example>
In the present embodiment, when setting the reference area 15 for calculating the gradient, the brightness contrast (difference in luminance value) of the first pixel region 12 is used, but the color contrast (color difference) and the like are used. The difference in pixel values other than the brightness value of the pixels may be used. Instead of the brightness contrast, a color contrast (difference in pixel values representing colors) may be used.
Unlike the above embodiment, the gradient calculation unit 112 sets a region wider than the first pixel region 12 as a reference region when the contrast C is less than the threshold value Cτ, and sets the first pixel when the contrast C is the threshold value Cτ or more. Area 12 may be set as a reference area.

〔メッシュ生成部〕
<処理概要>
メッシュ生成部120は、入力画像10中のエッジを活用して、入力画像10を複数の三角形により領域分割する。即ち、入力画像10中のエッジが、入力画像10を領域分割する三角形のエッジとなるように、入力画像10を分割する三角形を選択する。
エッジ抽出部121は、エッジ算出部110により算出されたエッジの角度θ(エッジの角度を示す値を含む)、又はこれを示す値(例えば、グラディエント(gx,gy)及びアウトライヤ)に基づいて、入力画像10を領域分割する三角形の辺である分割エッジ(対角線23)を順次抽出する。
メッシュ補間部123は、入力画像10の全体が三角形により領域分割されるように、メッシュが不完全な部分について分割エッジを補間する。
[Mesh generator]
<Outline of processing>
The mesh generation unit 120 utilizes the edges in the input image 10 to divide the input image 10 into regions by a plurality of triangles. That is, the triangle that divides the input image 10 is selected so that the edge in the input image 10 becomes the edge of the triangle that divides the input image 10 into a region.
The edge extraction unit 121 is based on the edge angle θ (including a value indicating the edge angle) calculated by the edge calculation unit 110 or a value indicating this (for example, a gradient (gx, gy) and an outliner). The division edges (diagonal lines 23), which are the sides of the triangle that divides the input image 10 into regions, are sequentially extracted.
The mesh interpolation unit 123 interpolates the divided edges with respect to the incomplete mesh portion so that the entire input image 10 is divided into regions by triangles.

<エッジ抽出部:対角線の抽出方法>
図5は、エッジ抽出部による対角線の抽出方法の一例について説明する模式図である。以下、対角線を形成する矩形領域が右3×2画素領域である場合の例により説明する。なお、「右3×2画素領域」とは、図中、対角線が右下方向に伸び、且つ3×2画素からなる矩形領域を意味する。対角線が図中左下方向に伸びる場合は「左・・・画素領域」と表現する。
エッジ抽出部121は、図4に示す中間画像20から、複数の中間画素21により形成される矩形領域22(ここでは右3×2画素領域)を選択する。エッジ抽出部121は、矩形領域22の対角線23が通過する中間画素を判定対象画素24(図中、着色部分)として設定する。エッジ抽出部121は、矩形領域22中の全ての判定対象画素24が示す夫々のエッジ13の角度θが対角線23の角度φに対して所定の角度範囲内にあるとき、対角線23を、入力画像を領域分割する三角形の辺を構成する分割エッジとして抽出する。
<Edge extraction part: Diagonal extraction method>
FIG. 5 is a schematic diagram illustrating an example of a diagonal line extraction method by the edge extraction unit. Hereinafter, an example will be described in which the rectangular region forming the diagonal line is the right 3 × 2 pixel region. The “right 3 × 2 pixel area” means a rectangular area in the drawing in which the diagonal line extends in the lower right direction and is composed of 3 × 2 pixels. When the diagonal line extends in the lower left direction in the figure, it is expressed as "left ... pixel area".
The edge extraction unit 121 selects a rectangular region 22 (here, a right 3 × 2 pixel region) formed by a plurality of intermediate pixels 21 from the intermediate image 20 shown in FIG. The edge extraction unit 121 sets an intermediate pixel through which the diagonal line 23 of the rectangular region 22 passes as a determination target pixel 24 (colored portion in the figure). When the angle θ of each edge 13 indicated by all the determination target pixels 24 in the rectangular region 22 is within a predetermined angle range with respect to the angle φ of the diagonal line 23, the edge extraction unit 121 inputs the diagonal line 23 to the input image. Is extracted as the dividing edge that constitutes the side of the triangle that divides the area.

<分割エッジの検出パターン>
図6(a)〜(f)は、分割エッジとして抽出される対角線の検出パターンの一例を示す図である。
検出パターン記憶部122(図1)は、複数種類の対角線の検出パターンを記憶している。具体的には、検出パターン記憶部122は、矩形領域22である右3×2画素領域、左3×2画素領域(図6(a))、右2×3画素領域、左2×3画素領域(図6(b))、右3×1画素領域、左3×1画素領域(図6(c))、右1×3画素領域、左1×3画素領域(図6(d))、右2×1画素領域、左2×1画素領域(図6(e))、右1×2画素領域、左1×2画素領域(図6(f))の夫々の対角線に係る検出パターンを記憶している。なお、右1×1画素領域と左1×1画素領域の対角線は、補間対象の分割エッジとして取り扱われるため(図7参照)、検出パターンとしては記憶されていない。
本例において検出パターン記憶部122は、3×3画素領域よりも面積が小さい矩形領域の対角線を検出パターンとして記憶しているが、検出パターン記憶部122は、これよりも大きい矩形領域の対角線に係る検出パターンを記憶してもよい。
<Detection pattern of split edge>
6 (a) to 6 (f) are diagrams showing an example of a diagonal detection pattern extracted as a dividing edge.
The detection pattern storage unit 122 (FIG. 1) stores a plurality of types of diagonal detection patterns. Specifically, the detection pattern storage unit 122 has a rectangular area 22, a right 3 × 2 pixel area, a left 3 × 2 pixel area (FIG. 6A), a right 2 × 3 pixel area, and a left 2 × 3 pixel. Region (FIG. 6 (b)), right 3 × 1 pixel region, left 3 × 1 pixel region (FIG. 6 (c)), right 1 × 3 pixel region, left 1 × 3 pixel region (FIG. 6 (d)) , Right 2 × 1 pixel area, left 2 × 1 pixel area (FIG. 6 (e)), right 1 × 2 pixel area, left 1 × 2 pixel area (FIG. 6 (f)). I remember. Since the diagonal lines of the right 1 × 1 pixel area and the left 1 × 1 pixel area are treated as the divided edges to be interpolated (see FIG. 7), they are not stored as the detection pattern.
In this example, the detection pattern storage unit 122 stores the diagonal line of the rectangular area smaller than the 3 × 3 pixel area as the detection pattern, but the detection pattern storage unit 122 stores the diagonal line of the rectangular area larger than this as the detection pattern. Such a detection pattern may be stored.

検出パターン記憶部122は、互いに重複しない角度関係にある対角線に係る検出パターンを記憶する。特に、検出パターン記憶部122は、端点以外の対角線上に中間画素の交点(角部)を含まない対角線を検出パターンとして記憶することが望ましい。すなわち、検出パターンとして記憶される対角線を形成する矩形領域は、矩形領域の対角線と同一角度の対角線を有する小矩形領域を内部に含まない、互いに直行する2辺の長さが「互いに素」の関係にある矩形領域であることが望ましい。2辺の長さが「互いに素」とは、矩形領域を構成する直行する2辺の長さの最大公約数が1である関係を意味する。
例えば、6×4画素領域はその内部に4個の3×2画素領域を含み、6×4画素領域の対角線上には3×2画素領域の角部(交点)を含むため、検出パターン記憶部122は3×2画素領域の対角線を検出パターンとして記憶してもよいが、6×4画素領域の対角線は検出パターンとして記憶しないことが望ましい。これは、ラスタライズ時には、三角形メッシュの頂点に位置する元画素の画素値を参照して三角形メッシュ内を塗りつぶす画素値が決定されることに起因する。例えば、6×4画素領域の対角線を抽出する場合、この対角線を含んで構成される三角形メッシュの各辺の中央には3×2画素領域の角部が存在するが、各辺の中央に位置する元画素の画素値はラスタライズ時に参照されないため、元画像の再現率が低下する虞がある。検出パターン記憶部122に「互いに素」の関係にある矩形領域に係る対角線のみを検出パターンとして記憶させておくことにより、ラスタライズ時において元画像の再現率を向上させ、より元画像に近い画像を出力することが可能となる。
The detection pattern storage unit 122 stores the detection patterns related to the diagonal lines having an angular relationship that does not overlap with each other. In particular, it is desirable that the detection pattern storage unit 122 stores a diagonal line other than the end point on the diagonal line that does not include the intersection (corner portion) of the intermediate pixels as the detection pattern. That is, the rectangular region forming the diagonal line stored as the detection pattern does not include a small rectangular region having a diagonal line at the same angle as the diagonal line of the rectangular region, and the lengths of the two sides orthogonal to each other are "elementary to each other". It is desirable that the rectangular area is related. When the lengths of the two sides are "disjoint", it means that the greatest common divisor of the lengths of the two orthogonal sides forming the rectangular region is 1.
For example, since the 6 × 4 pixel area includes four 3 × 2 pixel areas and includes the corners (intersection points) of the 3 × 2 pixel area on the diagonal line of the 6 × 4 pixel area, the detection pattern is stored. The unit 122 may store the diagonal line of the 3 × 2 pixel area as a detection pattern, but it is desirable that the diagonal line of the 6 × 4 pixel area is not stored as a detection pattern. This is because at the time of rasterization, the pixel value to be filled in the triangular mesh is determined by referring to the pixel value of the original pixel located at the apex of the triangular mesh. For example, when extracting the diagonal line of the 6 × 4 pixel area, the corner part of the 3 × 2 pixel area exists in the center of each side of the triangular mesh including the diagonal line, but the position is located in the center of each side. Since the pixel value of the original pixel is not referred to at the time of rasterization, the reproduction rate of the original image may decrease. By storing only the diagonal lines related to the rectangular regions that are "disjoint" in the detection pattern storage unit 122 as the detection pattern, the recall rate of the original image is improved at the time of rasterization, and an image closer to the original image can be obtained. It becomes possible to output.

検出パターン記憶部122(図1)には、各対角線23の検出パターンに対して、判定対象画素24の位置と、判定用の角度範囲(パラメータa、b、アウトライヤ符号)とが対応付けて判定テーブルとして記憶されている。さらに、各対角線23の検出パターンには、検出対象である対角線23の基点23aの位置と、判定対象画素24のうち最初に判定が行われる注目画素25の位置とに係る情報が対応付けられている。なお、検出対象である対角線23の基点23aを有した判定対象画素24が注目画素25である。つまり、各対角線23の検出パターンは、注目画素25と注目画素25以外の判定対象画素24との位置関係を示す情報を含むと言える。
検出パターン記憶部122に記憶される判定用の角度範囲は、エッジ抽出部121によって抽出される対角線が互いに交差しないように設定されている。
In the detection pattern storage unit 122 (FIG. 1), the position of the determination target pixel 24 and the determination angle range (parameters a, b, outliner code) are associated with each other for the detection pattern of each diagonal line 23 for determination. It is stored as a table. Further, the detection pattern of each diagonal line 23 is associated with information relating to the position of the base point 23a of the diagonal line 23 to be detected and the position of the attention pixel 25 in which the determination is first performed among the determination target pixels 24. There is. The determination target pixel 24 having the base point 23a of the diagonal line 23 to be detected is the attention pixel 25. That is, it can be said that the detection pattern of each diagonal line 23 includes information indicating the positional relationship between the attention pixel 25 and the determination target pixel 24 other than the attention pixel 25.
The determination angle range stored in the detection pattern storage unit 122 is set so that the diagonal lines extracted by the edge extraction unit 121 do not intersect with each other.

図7(a)、(b)は、判定用の角度範囲の決定方法の一例について説明する模式図である。以下、右3×2画素からなる矩形領域22に係る対角線23を検出するための、判定用の角度範囲を決定する場合の例により説明する。
まず、抽出対象となる対角線23に対して、反時計回り方向に最も近い矩形領域(右2×1画素領域)の対角線d1と、時計回り方向に最も近い矩形領域(右1×1画素領域)の対角線d2とを見つける。ここで、対角線23の角度をφ、対角線d1の角度をα、対角線d2の角度をβとする。
対角線23の角度φと対角線d1の角度αを等角度分割した角度(φ+α)/2と、対角線23の角度φと対角線d2の角度βを等角度分割した角度(φ+β)/2との間を、判定用の角度範囲とする。

Figure 2021108222
・・・式(11)
なお、θは各中間画素21が示すエッジの角度である。 7 (a) and 7 (b) are schematic views illustrating an example of a method for determining an angle range for determination. Hereinafter, an example of determining an angle range for determination for detecting the diagonal line 23 related to the rectangular region 22 composed of the right 3 × 2 pixels will be described.
First, the diagonal line d1 of the rectangular area closest to the counterclockwise direction (right 2 × 1 pixel area) and the rectangular area closest to the clockwise direction (right 1 × 1 pixel area) with respect to the diagonal line 23 to be extracted. Find the diagonal line d2 of. Here, the angle of the diagonal line 23 is φ, the angle of the diagonal line d1 is α, and the angle of the diagonal line d2 is β.
Between the angle φ of the diagonal line 23 and the angle α of the diagonal line d1 divided equally (φ + α) / 2 and the angle φ of the diagonal line 23 and the angle β of the diagonal line d2 divided equally (φ + β) / 2. , The angle range for judgment.
Figure 2021108222
... Equation (11)
Note that θ is the angle of the edge indicated by each intermediate pixel 21.

ところで、中間画素21のエッジの角度θは、中間画素21のグラディエントを(gx,gy)とするとき、以下の式(12)により求められる。

Figure 2021108222
・・・式(12)
しかし、逆三角関数の計算は複雑であり、これを中間画素ごとに計算する場合には、回路の複雑化と処理負荷の増大を招くという問題がある。そこで、式(12)を以下の式(13)ように変形して、グラディエント比(gy/gx)の下限値をパラメータa、上限値をパラメータbとして判定テーブル(図6)に記憶させることで、逆三角関数の計算を省略することが可能となる。
Figure 2021108222
・・・式(13) By the way, the angle θ of the edge of the intermediate pixel 21 is obtained by the following equation (12) when the gradient of the intermediate pixel 21 is (gx, gy).
Figure 2021108222
... Equation (12)
However, the calculation of the inverse trigonometric function is complicated, and when this is calculated for each intermediate pixel, there is a problem that the circuit becomes complicated and the processing load increases. Therefore, the equation (12) is transformed into the following equation (13) and stored in the determination table (FIG. 6) with the lower limit value of the gradient ratio (gy / gx) as the parameter a and the upper limit value as the parameter b. , It is possible to omit the calculation of the inverse trigonometric function.
Figure 2021108222
... Equation (13)

なお、図6に示す検出パターンにおいて、各対角線(角度φ)を決定するパラメータa,bは、a<tanφ、tanφ<bを満たす任意の値に設定することができる。また、各対角線を決定する角度範囲は、異なる対角線を決定するパラメータ同士で重複する部分を有していてもよい。例えば、図6に示す検出パターンにおいては、図6(c)に示す左右3×1画素領域のパラメータaと、図6(d)に示す左右1×3画素領域のパラメータbについては、判定されないエッジの範囲が生じないように、エッジの判定範囲を拡大している。また、図6(e)に示す左右2×1画素領域の対角線と、図6(f)に示す左右1×2画素領域の対角線は、誤検出が少ないことから、判定用の角度範囲を拡大している。
更に、左右3×1画素領域と、左右1×3画素領域については、水平方向のエッジと垂直方向のエッジを誤検出しないようにするために、グラディエントのy成分gyがゼロである場合は対角線を抽出しないように設定されている。
In the detection pattern shown in FIG. 6, the parameters a and b for determining each diagonal line (angle φ) can be set to arbitrary values satisfying a <tanφ and tanφ <b. Further, the angle range for determining each diagonal line may have a portion overlapping between the parameters for determining different diagonal lines. For example, in the detection pattern shown in FIG. 6, the parameter a in the left and right 3 × 1 pixel area shown in FIG. 6 (c) and the parameter b in the left and right 1 × 3 pixel area shown in FIG. 6 (d) are not determined. The edge judgment range is expanded so that the edge range does not occur. Further, since the diagonal lines of the left and right 2 × 1 pixel areas shown in FIG. 6 (e) and the diagonal lines of the left and right 1 × 2 pixel areas shown in FIG. 6 (f) are less likely to be erroneously detected, the angle range for determination is expanded. is doing.
Further, in the left and right 3 × 1 pixel area and the left and right 1 × 3 pixel area, in order to prevent erroneous detection of the horizontal edge and the vertical edge, when the y component gy of the gradient is zero, it is a diagonal line. Is set not to be extracted.

<対角線の検出手順>
エッジ抽出部121は、面積の大きい矩形領域に係る対角線を、面積の小さい矩形領域に係る対角線に優先して抽出するように、分割エッジの抽出処理を実行する。即ち、エッジ抽出部121は、検出パターン記憶部122から検出パターンを読み出して、図6(a)〜(f)に示す順番で対角線を抽出するように分割エッジの抽出処理を実行する。エッジ抽出部121は、面積の大きい矩形領域に係る対角線を、面積の小さい矩形領域に係る対角線に優先して抽出することで、分割エッジが交差しないように対角線を抽出することができる。
<Diagonal detection procedure>
The edge extraction unit 121 executes the division edge extraction process so as to preferentially extract the diagonal line related to the rectangular area having a large area over the diagonal line related to the rectangular area having a small area. That is, the edge extraction unit 121 reads the detection pattern from the detection pattern storage unit 122, and executes the division edge extraction process so as to extract the diagonal lines in the order shown in FIGS. 6A to 6F. The edge extraction unit 121 can extract the diagonal lines so that the divided edges do not intersect by extracting the diagonal lines related to the rectangular area having a large area in preference to the diagonal lines related to the rectangular area having a small area.

具体的には、エッジ抽出部121は、図5に示すように、中間画像20(図4)の例えば左上から順番に一の中間画素21を選択し、注目画素25として設定する。エッジ抽出部121は、注目画素25のエッジ13の角度θと対角線23の判定用の角度範囲とを、面積の大きい矩形領域22に係る対角線23の検出パターンから順番に比較する。エッジ抽出部121は、注目画素25のエッジの角度θが、ある対角線23の判定用の角度範囲に含まれるとき、当該対角線23の検出パターンに基づいて注目画素25以外の判定対象画素24を設定する。エッジ抽出部121は、新たに設定した判定対象画素24のエッジ13の角度θと判定用の角度範囲とを比較する。エッジ抽出部121は、全ての判定対象画素24が示すエッジ13の角度θが判定用の角度範囲内にあるとき、当該対角線23を、入力画像10(図3(a))を領域分割する三角形の辺を構成する分割エッジとして抽出する。
仮に、何れかの判定対象画素24が示すエッジ13の角度θが対角線23の角度φに対して判定用の角度範囲を逸脱するとき、エッジ抽出部121は、注目画素25のエッジ13の角度θを、次に面積が大きい矩形領域に係る対角線の判定用の角度範囲と比較する。エッジ抽出部121は、比較結果に基づいて新たに注目画素25以外の判定対象画素24を設定する。
エッジ抽出部121は、以上の処理を順次実行することにより、中間画像20の全領域から分割エッジとしての対角線23を抽出する。
Specifically, as shown in FIG. 5, the edge extraction unit 121 selects one intermediate pixel 21 in order from, for example, the upper left of the intermediate image 20 (FIG. 4), and sets it as the attention pixel 25. The edge extraction unit 121 compares the angle θ of the edge 13 of the pixel of interest 25 and the angle range for determining the diagonal line 23 in order from the detection pattern of the diagonal line 23 related to the rectangular region 22 having a large area. When the angle θ of the edge of the pixel of interest 25 is included in the angle range for determination of a certain diagonal line 23, the edge extraction unit 121 sets the determination target pixels 24 other than the pixel of interest 25 based on the detection pattern of the diagonal line 23. do. The edge extraction unit 121 compares the angle θ of the edge 13 of the newly set determination target pixel 24 with the angle range for determination. When the angle θ of the edge 13 indicated by all the determination target pixels 24 is within the angle range for determination, the edge extraction unit 121 divides the diagonal line 23 into a triangle that divides the input image 10 (FIG. 3A) into a region. It is extracted as a dividing edge that constitutes the side of.
If the angle θ of the edge 13 indicated by any of the determination target pixels 24 deviates from the angle range for determination with respect to the angle φ of the diagonal line 23, the edge extraction unit 121 determines the angle θ of the edge 13 of the pixel of interest 25. Is compared with the angle range for determining the diagonal line relating to the rectangular region having the next largest area. The edge extraction unit 121 newly sets the determination target pixel 24 other than the attention pixel 25 based on the comparison result.
The edge extraction unit 121 extracts the diagonal line 23 as the divided edge from the entire region of the intermediate image 20 by sequentially executing the above processes.

<メッシュ補間部>
エッジ抽出部121が抽出した対角線23のみでは完全なメッシュを形成できないため、メッシュ補間部123は、メッシュが不完全な部分について分割エッジを補間し、入力画像10の全体を三角形により領域分割する。
図8(a)〜(d)は、補間される分割エッジの一例を示す図である。本図に示す分割エッジは、補間パターン記憶部124(図1)に記憶されている。
エッジ抽出部121は、メッシュが不完全な部分について図8(a)〜(d)の順に分割エッジを挿入することにより、入力画像10の全体を三角形により領域分割することができる。但し、エッジ抽出部121は、既に抽出されている分割エッジと交差しない場合にのみ、図示する分割エッジを挿入する。
なお、メッシュ生成部120のエッジ抽出部121は、上記以外の方法により算出された元画素のエッジの角度(或いはグラディエントの値)を用いて、分割エッジを抽出しても構わない。
<Mesh interpolation section>
Since a complete mesh cannot be formed only by the diagonal line 23 extracted by the edge extraction unit 121, the mesh interpolation unit 123 interpolates the divided edges for the portion where the mesh is incomplete, and divides the entire input image 10 into regions by triangles.
8 (a) to 8 (d) are diagrams showing an example of the divided edges to be interpolated. The divided edges shown in this figure are stored in the interpolation pattern storage unit 124 (FIG. 1).
The edge extraction unit 121 can divide the entire input image 10 into regions by triangles by inserting the divided edges in the order of FIGS. 8A to 8D for the portion where the mesh is incomplete. However, the edge extraction unit 121 inserts the illustrated divided edge only when it does not intersect the already extracted divided edge.
The edge extraction unit 121 of the mesh generation unit 120 may extract the divided edge by using the edge angle (or gradient value) of the original pixel calculated by a method other than the above.

〔フローチャート〕
図9は、本発明の一実施形態に係る画像の処理手順を示したフローチャートである。
ステップS1において、画像処理装置100は、入力画像10(図3(a))を取得する。入力画像10は、エッジ算出部110とエッジ強調部130に入力される。
ステップS3において、コントラスト算出部111は、複数の画素11を含む第一画素領域12を順次設定し、各第一画素領域12に含まれる各画素11の輝度値を取得する。コントラスト算出部111は、第一画素領域12に含まれる各画素11の輝度値に基づいて第一画素領域12のコントラストCを算出する(図3(b))。
ステップS5において、グラディエント算出部112は、第一画素領域12のコントラストCの大きさに基づいて、参照領域15を設定する。即ち、グラディエント算出部112は、コントラストCが閾値Cτ未満の場合に第一画素領域12を参照領域15aとして設定し、コントラストCが閾値Cτ以上の場合に第一画素領域12を含み、且つ第一画素領域12よりも大きい領域(第二画素領域)を参照領域15bとして設定する(図3(c))。
〔flowchart〕
FIG. 9 is a flowchart showing an image processing procedure according to an embodiment of the present invention.
In step S1, the image processing device 100 acquires the input image 10 (FIG. 3A). The input image 10 is input to the edge calculation unit 110 and the edge enhancement unit 130.
In step S3, the contrast calculation unit 111 sequentially sets the first pixel region 12 including the plurality of pixels 11, and acquires the brightness value of each pixel 11 included in each first pixel region 12. The contrast calculation unit 111 calculates the contrast C of the first pixel region 12 based on the brightness value of each pixel 11 included in the first pixel region 12 (FIG. 3B).
In step S5, the gradient calculation unit 112 sets the reference area 15 based on the magnitude of the contrast C of the first pixel area 12. That is, the gradient calculation unit 112 sets the first pixel region 12 as the reference region 15a when the contrast C is less than the threshold value Cτ, and includes the first pixel region 12 when the contrast C is the threshold value Cτ or more, and is the first. A region larger than the pixel region 12 (second pixel region) is set as the reference region 15b (FIG. 3 (c)).

ステップS7において、グラディエント算出部112は、設定した参照領域15に含まれる各画素11の輝度値を取得する。グラディエント算出部112は、参照領域15に含まれる各画素11の輝度値に基づいて、第一画素領域12のグラディエントG(gx,gy)を算出する。なお、グラディエントGは、第一画素領域12に存在するエッジ13の角度θを0〜90度の範囲で示す値である。本処理により、グラディエント算出部112は、各第一画素領域12のグラディエントGを画素値として有する複数の画素から構成されるグラディエント画像(中間画像)を生成する。
ステップS9において、アウトライヤ算出部113は、第一画素領域12における局所的なエッジ13の強さと方向を推定する値であるアウトライヤを算出する。アウトライヤ算出部113は、第一画素領域12に含まれる各画素11の輝度値に基づいてアウトライヤを算出する。本処理により、アウトライヤ算出部113は、各第一画素領域12のアウトライヤを画素値として有する複数の画素から構成されるアウトライヤ画像(中間画像)を生成する。
エッジ算出部110からは、各画素がグラディエントGとアウトライヤの情報とを有する中間画像20(図4)が、メッシュ生成部120に対して出力される。
In step S7, the gradient calculation unit 112 acquires the brightness value of each pixel 11 included in the set reference area 15. The gradient calculation unit 112 calculates the gradient G (gx, gy) of the first pixel region 12 based on the brightness value of each pixel 11 included in the reference region 15. The gradient G is a value indicating the angle θ of the edge 13 existing in the first pixel region 12 in the range of 0 to 90 degrees. By this processing, the gradient calculation unit 112 generates a gradient image (intermediate image) composed of a plurality of pixels having the gradient G of each first pixel region 12 as a pixel value.
In step S9, the outliner calculation unit 113 calculates an outliner which is a value for estimating the strength and direction of the local edge 13 in the first pixel region 12. The outliner calculation unit 113 calculates the outliner based on the brightness value of each pixel 11 included in the first pixel region 12. By this processing, the outliner calculation unit 113 generates an outliner image (intermediate image) composed of a plurality of pixels having an outliner of each first pixel region 12 as a pixel value.
The edge calculation unit 110 outputs an intermediate image 20 (FIG. 4) in which each pixel has gradient G and outliner information to the mesh generation unit 120.

ステップS11において、メッシュ生成部120のエッジ抽出部121は、グラディエント算出部112とアウトライヤ算出部113により生成された中間画像20の各中間画素21が示すエッジ13の角度θに基づいて、入力画像10を領域分割する三角形の辺を構成する分割エッジを抽出する。即ち、図5に示すように、エッジ抽出部121は、複数の中間画素21により形成される矩形領域22を設定し、矩形領域22の対角線23が通過する判定対象画素24の全てが対角線23を含む所定の角度範囲内にあるとき、その対角線23を、入力画像10を領域分割する三角形の辺を構成する分割エッジとして抽出する。本処理において、エッジ抽出部121は、面積の大きい矩形領域22に係る対角線23が面積の小さい矩形領域22に係る対角線23に優先して抽出されるように、図6(a)〜(f)に示す検出パターンの順に対角線を抽出する。 In step S11, the edge extraction unit 121 of the mesh generation unit 120 receives the input image 10 based on the angle θ of the edge 13 indicated by each intermediate pixel 21 of the intermediate image 20 generated by the gradient calculation unit 112 and the outliner calculation unit 113. Extract the dividing edges that make up the sides of the triangle that divides the area. That is, as shown in FIG. 5, the edge extraction unit 121 sets a rectangular region 22 formed by a plurality of intermediate pixels 21, and all of the determination target pixels 24 through which the diagonal line 23 of the rectangular region 22 passes pass through the diagonal line 23. When it is within a predetermined angle range including, the diagonal line 23 is extracted as a dividing edge constituting the side of the triangle that divides the input image 10 into a region. In this process, the edge extraction unit 121 extracts the diagonal line 23 related to the rectangular area 22 having a large area with priority over the diagonal line 23 related to the rectangular area 22 having a small area (a) to 6 (f). Diagonal lines are extracted in the order of the detection patterns shown in.

ステップS13において、メッシュ生成部120のメッシュ補間部123は、補間パターン記憶部124から補間対象となる分割エッジを読み出して、メッシュが不完全な部分について分割エッジを図8(a)〜(d)の順番で補間し、入力画像10の全体を三角形により領域分割する。入力画像10を領域分割する領域分割情報は、ベクターデータであり、拡大・縮小によってもその鮮鋭さを失うことのない情報である。
ステップS15において、エッジ強調部130は、入力画像10のエッジを強調して鮮鋭化した鮮鋭化画像を生成する。
ステップS17において、ラスタライズ部140は、エッジ強調部130から出力される鮮鋭化画像を、メッシュ生成部120から出力される領域分割情報を用いて拡大する。また、ラスタライズ部140は、三角形メッシュの頂点に相当する画素11の画素値を用いて、三角形メッシュ内を塗りつぶすための画素値を決定し、決定された画素値を用いて三角形メッシュ内を塗りつぶす。また、ラスタライズ部140は、必要に応じてバイリニア法やバイキュービック法等を用いてピクセル補間を行って、高解像度化した出力画像を生成する。
In step S13, the mesh interpolation unit 123 of the mesh generation unit 120 reads out the divided edge to be interpolated from the interpolation pattern storage unit 124, and sets the divided edge for the portion where the mesh is incomplete (a) to 8 (d). Interpolate in the order of, and the entire input image 10 is divided into regions by triangles. The area division information for dividing the input image 10 into areas is vector data, and is information that does not lose its sharpness even when enlarged or reduced.
In step S15, the edge enhancement unit 130 generates a sharpened image in which the edge of the input image 10 is emphasized and sharpened.
In step S17, the rasterization unit 140 enlarges the sharpened image output from the edge enhancement unit 130 by using the region division information output from the mesh generation unit 120. Further, the rasterization unit 140 determines the pixel value for filling the inside of the triangle mesh by using the pixel value of the pixel 11 corresponding to the apex of the triangle mesh, and fills the inside of the triangle mesh using the determined pixel value. Further, the rasterization unit 140 performs pixel interpolation using a bilinear method, a bicubic method, or the like as necessary to generate a high-resolution output image.

〔本発明の実施態様例と作用、効果のまとめ〕
<第一の実施態様>
本態様に係る画像処理装置100は、複数の画素11を含む第一画素領域12を含み、第一画素領域よりも広い第二画素領域(参照領域15b)における各画素の画素値を取得する画素値取得手段(エッジ算出部110)と、第二画素領域における各画素の画素値を用いて第一画素領域のエッジの角度θを算出するエッジ算出手段(エッジ算出部110)と、を備えることを特徴とする。
本態様によれば、第一画素領域よりも広い第二画素領域の各画素の画素値を用いて第一画素領域のエッジの角度を算出するので、エッジの角度の算出精度を向上させることが可能となる。
[Summary of Examples of Embodiments of the Present Invention, Actions, and Effects]
<First embodiment>
The image processing apparatus 100 according to this aspect includes a first pixel region 12 including a plurality of pixels 11, and a pixel that acquires a pixel value of each pixel in a second pixel region (reference region 15b) wider than the first pixel region. A value acquisition means (edge calculation unit 110) and an edge calculation means (edge calculation unit 110) for calculating the edge angle θ of the first pixel area using the pixel values of each pixel in the second pixel area are provided. It is characterized by.
According to this aspect, since the edge angle of the first pixel area is calculated using the pixel value of each pixel of the second pixel area wider than the first pixel area, it is possible to improve the calculation accuracy of the edge angle. It will be possible.

<第二の実施態様>
本態様に係る画像処理装置100は、第一画素領域12における画素11の画素値の差(コントラストC)を算出する差分算出手段(コントラスト算出部111)を備え、エッジ算出手段(エッジ算出部110)は、画素値の差に応じて第一画素領域を含む参照領域15(15a,15b)を設定し、該参照領域における各画素の画素値を用いて第一画素領域のエッジの角度θを算出することを特徴とする。
本態様によれば、画素値の差に応じて参照領域を設定し、設定した参照領域の各画素の画素値を用いて第一画素領域のエッジの角度を算出するので、エッジの角度の算出精度を向上させることが可能となる。
<Second embodiment>
The image processing device 100 according to this aspect includes a difference calculation means (contrast calculation unit 111) for calculating the difference (contrast C) of the pixel values of the pixels 11 in the first pixel region 12, and an edge calculation means (edge calculation unit 110). ) Sets the reference area 15 (15a, 15b) including the first pixel area according to the difference in the pixel values, and uses the pixel value of each pixel in the reference area to set the edge angle θ of the first pixel area. It is characterized by calculating.
According to this aspect, the reference area is set according to the difference in the pixel values, and the edge angle of the first pixel area is calculated using the pixel value of each pixel of the set reference area. Therefore, the edge angle is calculated. It is possible to improve the accuracy.

<第三の実施態様>
本態様に係る画像処理装置100において、エッジ算出手段(エッジ算出部110)は、画素値の差に応じて、第一画素領域12又は第二画素領域(参照領域15b)を参照領域15に設定することを特徴とする。
本態様において、エッジ算出手段は、画素値の差に応じて第一画素領域又は第二画素領域を参照領域として設定し、設定した参照領域の各画素の画素値を用いて第一画素領域のエッジの角度を算出する。即ち、エッジ算出手段は、画素値の差に応じて、第一画素領域(参照領域15a)を構成する各画素の画素値を用いて第一画素領域のエッジの角度を算出するか、第一画素領域よりも広い第二画素領域(参照領域15b)を構成する各画素の画素値を用いて第一画素領域のエッジの角度を算出する。
本態様によれば、画素値の差に応じて、第一画素領域又は第二画素領域を参照領域に設定して、第一画素領域のエッジの角度を算出するので、エッジの角度の算出精度を向上させることが可能となる。
<Third embodiment>
In the image processing apparatus 100 according to this aspect, the edge calculation means (edge calculation unit 110) sets the first pixel area 12 or the second pixel area (reference area 15b) in the reference area 15 according to the difference in pixel values. It is characterized by doing.
In this embodiment, the edge calculation means sets the first pixel area or the second pixel area as a reference area according to the difference in pixel values, and uses the pixel values of each pixel of the set reference area to obtain the first pixel area. Calculate the edge angle. That is, the edge calculation means calculates the edge angle of the first pixel region by using the pixel value of each pixel constituting the first pixel region (reference region 15a) according to the difference in the pixel values. The edge angle of the first pixel region is calculated using the pixel values of each pixel constituting the second pixel region (reference region 15b) wider than the pixel region.
According to this aspect, the first pixel area or the second pixel area is set as the reference area according to the difference in the pixel values, and the edge angle of the first pixel area is calculated. Therefore, the calculation accuracy of the edge angle is calculated. Can be improved.

<第四の実施態様>
本態様に係る画像処理装置100において、エッジ算出手段(エッジ算出部110)は、参照領域15の水平方向における画素値の変化率gxと垂直方向における画素値の変化率gyとに基づいてエッジの角度θを算出することを特徴とする。
角度θは、画素値の変化率gx,gyから逆三角関数により直接的に算出してもよいし、角度θの正接(gy/gx)を求めることで間接的に算出してもよい。逆三角関数の計算は処理負荷が高いため、後者の方法を採用すれば計算に係る処理負荷を低減できる。
<Fourth Embodiment>
In the image processing apparatus 100 according to this aspect, the edge calculation means (edge calculation unit 110) determines the edge based on the rate of change gx of the pixel value in the horizontal direction and the rate of change gy of the pixel value in the vertical direction of the reference region 15. It is characterized in that the angle θ is calculated.
The angle θ may be calculated directly from the rate of change of the pixel values gx and gy by an inverse trigonometric function, or may be calculated indirectly by obtaining the tangent (gy / gx) of the angle θ. Since the calculation of the inverse trigonometric function has a high processing load, the processing load related to the calculation can be reduced by adopting the latter method.

<第五の実施態様>
本態様に係る画像処理装置100において、エッジ算出手段(エッジ算出部110)は、参照領域15の各画素11の画素値に対し、第一画素領域12に含まれる画素との位置関係に応じた重み付け係数を乗じた上でエッジの角度θを算出することを特徴とする。
本態様によれば、必要に応じて第一画素領域の周辺に位置する画素の画素値を参照しつつ、より正確にエッジの角度を算出できる。
<Fifth embodiment>
In the image processing apparatus 100 according to this aspect, the edge calculation means (edge calculation unit 110) corresponds to the positional relationship between the pixel values of each pixel 11 in the reference region 15 and the pixels included in the first pixel region 12. It is characterized in that the edge angle θ is calculated after multiplying by a weighting coefficient.
According to this aspect, the edge angle can be calculated more accurately while referring to the pixel values of the pixels located around the first pixel region as needed.

<第六の実施態様>
本態様に係る画像処理装置100において、重み付け係数には2のべき乗値が設定されていることを特徴とする。
重み付け係数に2のべき乗値を設定することにより、ビットをずらして計算するシフト演算が利用できるようになり、処理速度の向上を図ることができる。
<Sixth Embodiment>
The image processing apparatus 100 according to this aspect is characterized in that a power value of 2 is set for the weighting coefficient.
By setting a power value of 2 to the weighting coefficient, a shift operation for calculating by shifting the bits can be used, and the processing speed can be improved.

10…入力画像、11…画素、12…第一画素領域、13…エッジ、15…参照領域、15a…参照領域、15b…参照領域(第二画素領域)、20…中間画像、21…中間画素、22…矩形領域、23…対角線、23a…基点、24…判定対象画素、25…注目画素、 100…画像処理装置、110…エッジ算出部(画素値取得手段、エッジ算出手段)、111…コントラスト算出部(差分算出手段)、112…グラディエント算出部、113…アウトライヤ算出部、120…メッシュ生成部、121…エッジ抽出部、122…検出パターン記憶部、123…メッシュ補間部、124…補間パターン記憶部、130…エッジ強調部、140…ラスタライズ部、151…CPU、152…ROM、153…RAM、154…バス、155…記憶装置、156…外部I/F、157…リーダライタ、161…外部記憶装置、162…記録媒体、d1,d2…対角線 10 ... Input image, 11 ... Pixel, 12 ... First pixel area, 13 ... Edge, 15 ... Reference area, 15a ... Reference area, 15b ... Reference area (second pixel area), 20 ... Intermediate image, 21 ... Intermediate pixel , 22 ... Rectangular area, 23 ... Diagonal line, 23a ... Base point, 24 ... Pixel to be determined, 25 ... Pixel of interest, 100 ... Image processing device, 110 ... Edge calculation unit (pixel value acquisition means, edge calculation means), 111 ... Contrast Calculation unit (difference calculation means), 112 ... gradient calculation unit, 113 ... outliner calculation unit, 120 ... mesh generation unit, 121 ... edge extraction unit, 122 ... detection pattern storage unit, 123 ... mesh interpolation unit, 124 ... interpolation pattern storage Unit, 130 ... Edge enhancement part, 140 ... Rasterize part, 151 ... CPU, 152 ... ROM, 153 ... RAM, 154 ... Bus, 155 ... Storage device, 156 ... External I / F, 157 ... Reader / writer, 161 ... External storage Device, 162 ... Recording medium, d1, d2 ... Diagonal

Claims (9)

複数の画素を含む第一画素領域を含み、前記第一画素領域よりも広い第二画素領域における前記各画素の画素値を取得する画素値取得手段と、
前記第二画素領域における前記各画素の画素値を用いて前記第一画素領域のエッジの角度を算出するエッジ算出手段と、
前記第一画素領域における前記画素の画素値の最大値と最小値との差を算出する差分算出手段と、を備え、
前記エッジ算出手段は、前記画素値の最大値と最小値との差に応じて前記第一画素領域を含む参照領域を設定し、該参照領域における前記各画素の画素値を用いて前記第一画素領域の前記エッジの角度を算出することを特徴とする画像処理装置。
A pixel value acquisition means that includes a first pixel region including a plurality of pixels and acquires a pixel value of each pixel in a second pixel region that is wider than the first pixel region.
An edge calculation means for calculating the edge angle of the first pixel region using the pixel value of each pixel in the second pixel region.
A difference calculation means for calculating the difference between the maximum value and the minimum value of the pixel value of the pixel in the first pixel region is provided.
The edge calculation means sets a reference area including the first pixel area according to the difference between the maximum value and the minimum value of the pixel value, and uses the pixel value of each pixel in the reference area to obtain the first pixel value. An image processing device for calculating the angle of the edge of a pixel region.
前記エッジ算出手段は、前記画素値の最大値と最小値との差に応じて、前記第一画素領域又は前記第二画素領域を前記参照領域に設定することを特徴とする請求項1に記載の画像処理装置。 The first aspect of claim 1, wherein the edge calculation means sets the first pixel area or the second pixel area in the reference area according to the difference between the maximum value and the minimum value of the pixel value. Image processing equipment. 前記エッジ算出手段は、前記参照領域の水平方向における画素値の変化率と垂直方向における画素値の変化率とに基づいて前記エッジの角度を算出することを特徴とする請求項1又は2に記載の画像処理装置。 The edge calculation means according to claim 1 or 2, wherein the edge calculation means calculates the angle of the edge based on the rate of change of the pixel value in the horizontal direction and the rate of change of the pixel value in the vertical direction of the reference region. Image processing device. 複数の画素を含む第一画素領域を含み、前記第一画素領域よりも広い第二画素領域における前記各画素の画素値を取得する画素値取得手段と、
前記第二画素領域における前記各画素の画素値を用いて前記第一画素領域のエッジの角度を算出するエッジ算出手段と、
前記第一画素領域における前記画素の画素値の差を算出する差分算出手段と、を備え、
前記エッジ算出手段は、前記画素値の差に応じて前記第一画素領域を含む参照領域を設定し、前記参照領域の各画素の画素値に対し、前記第一画素領域に含まれる画素との位置関係に応じた重み付け係数を乗じた上で、前記参照領域における前記各画素の画素値を用いて前記第一画素領域の前記エッジの角度を算出することを特徴とする画像処理装置。
A pixel value acquisition means that includes a first pixel region including a plurality of pixels and acquires a pixel value of each pixel in a second pixel region that is wider than the first pixel region.
An edge calculation means for calculating the edge angle of the first pixel region using the pixel value of each pixel in the second pixel region.
A difference calculation means for calculating the difference between the pixel values of the pixels in the first pixel region is provided.
The edge calculation means sets a reference area including the first pixel area according to the difference in the pixel values, and the pixel value of each pixel in the reference area is set with the pixel included in the first pixel area. An image processing apparatus characterized in that the angle of the edge of the first pixel region is calculated by multiplying the weighting coefficient according to the positional relationship by using the pixel value of each pixel in the reference region.
前記重み付け係数には2のべき乗値が設定されていることを特徴とする請求項4に記載の画像処理装置。 The image processing apparatus according to claim 4, wherein a power value of 2 is set for the weighting coefficient. 複数の画素を含む第一画素領域を含み、前記第一画素領域よりも広い第二画素領域における前記各画素の画素値を取得する画素値取得ステップと、
前記第二画素領域における前記各画素の画素値を用いて前記第一画素領域のエッジの角度を算出するエッジ算出ステップと、
前記第一画素領域における前記画素の画素値の最大値と最小値との差を算出する差分算出ステップと、を含み、
前記エッジ算出ステップでは、前記画素値の最大値と最小値との差に応じて前記第一画素領域を含む参照領域を設定し、該参照領域における前記各画素の画素値を用いて前記第一画素領域の前記エッジの角度を算出することを特徴とする画像処理方法。
A pixel value acquisition step of acquiring a pixel value of each pixel in a second pixel area that includes a first pixel area including a plurality of pixels and is wider than the first pixel area.
An edge calculation step of calculating the edge angle of the first pixel region using the pixel value of each pixel in the second pixel region, and
Including a difference calculation step of calculating the difference between the maximum value and the minimum value of the pixel value of the pixel in the first pixel region.
In the edge calculation step, a reference area including the first pixel area is set according to the difference between the maximum value and the minimum value of the pixel value, and the pixel value of each pixel in the reference area is used to set the first pixel value. An image processing method characterized by calculating the angle of the edge of a pixel region.
コンピュータを、
複数の画素を含む第一画素領域を含み、前記第一画素領域よりも広い第二画素領域における前記各画素の画素値を取得する画素値取得手段と、
前記第二画素領域における前記各画素の画素値を用いて前記第一画素領域のエッジの角度を算出するエッジ算出手段と、
前記第一画素領域における前記画素の画素値の最大値と最小値との差を算出する差分算出手段と、として機能させると共に、
前記エッジ算出手段が、前記画素値の最大値と最小値との差に応じて前記第一画素領域を含む参照領域を設定し、該参照領域における前記各画素の画素値を用いて前記第一画素領域の前記エッジの角度を算出するように機能させることを特徴とする画像処理プログラム。
Computer,
A pixel value acquisition means that includes a first pixel region including a plurality of pixels and acquires a pixel value of each pixel in a second pixel region that is wider than the first pixel region.
An edge calculation means for calculating the edge angle of the first pixel region using the pixel value of each pixel in the second pixel region.
It functions as a difference calculation means for calculating the difference between the maximum value and the minimum value of the pixel value of the pixel in the first pixel region, and also functions as a difference calculation means.
The edge calculation means sets a reference area including the first pixel area according to the difference between the maximum value and the minimum value of the pixel value, and the first pixel value of each pixel in the reference area is used. An image processing program characterized in that it functions to calculate the angle of the edge of a pixel region.
複数の画素を含む第一画素領域を含み、前記第一画素領域よりも広い第二画素領域における前記各画素の画素値を取得する画素値取得ステップと、
前記第二画素領域における前記各画素の画素値を用いて前記第一画素領域のエッジの角度を算出するエッジ算出ステップと、
前記第一画素領域における前記画素の画素値の差を算出する差分算出ステップと、を含み、
前記エッジ算出ステップでは、前記画素値の差に応じて前記第一画素領域を含む参照領域を設定し、前記参照領域の各画素の画素値に対し、前記第一画素領域に含まれる画素との位置関係に応じた重み付け係数を乗じた上で、前記参照領域における前記各画素の画素値を用いて前記第一画素領域の前記エッジの角度を算出することを特徴とする画像処理方法。
A pixel value acquisition step of acquiring a pixel value of each pixel in a second pixel area that includes a first pixel area including a plurality of pixels and is wider than the first pixel area.
An edge calculation step of calculating the edge angle of the first pixel region using the pixel value of each pixel in the second pixel region, and
Includes a difference calculation step of calculating the difference in pixel values of the pixels in the first pixel region.
In the edge calculation step, a reference area including the first pixel area is set according to the difference in the pixel values, and the pixel value of each pixel in the reference area is set with the pixel included in the first pixel area. An image processing method characterized in that the angle of the edge of the first pixel region is calculated using the pixel value of each pixel in the reference region after multiplying by a weighting coefficient according to the positional relationship.
コンピュータを、
複数の画素を含む第一画素領域を含み、前記第一画素領域よりも広い第二画素領域における前記各画素の画素値を取得する画素値取得手段と、
前記第二画素領域における前記各画素の画素値を用いて前記第一画素領域のエッジの角度を算出するエッジ算出手段と、
前記第一画素領域における前記画素の画素値の差を算出する差分算出手段と、として機能させると共に、
前記エッジ算出手段が、前記画素値の差に応じて前記第一画素領域を含む参照領域を設定し、前記参照領域の各画素の画素値に対し、前記第一画素領域に含まれる画素との位置関係に応じた重み付け係数を乗じた上で、前記参照領域における前記各画素の画素値を用いて前記第一画素領域の前記エッジの角度を算出するように機能させることを特徴とする画像処理プログラム。
Computer,
A pixel value acquisition means that includes a first pixel region including a plurality of pixels and acquires a pixel value of each pixel in a second pixel region that is wider than the first pixel region.
An edge calculation means for calculating the edge angle of the first pixel region using the pixel value of each pixel in the second pixel region.
It functions as a difference calculation means for calculating the difference between the pixel values of the pixels in the first pixel region, and also functions as a difference calculation means.
The edge calculation means sets a reference area including the first pixel area according to the difference in the pixel values, and the pixel value of each pixel in the reference area is set with the pixel included in the first pixel area. Image processing characterized in that it functions to calculate the angle of the edge of the first pixel region by using the pixel value of each pixel in the reference region after multiplying by a weighting coefficient according to the positional relationship. program.
JP2021076266A 2018-10-17 2021-04-28 Image processing device, image processing method, and image processing program Active JP7246103B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2021076266A JP7246103B2 (en) 2018-10-17 2021-04-28 Image processing device, image processing method, and image processing program

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2018195831A JP6884403B2 (en) 2018-10-17 2018-10-17 Image processing equipment, image processing method, and image processing program
JP2021076266A JP7246103B2 (en) 2018-10-17 2021-04-28 Image processing device, image processing method, and image processing program

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2018195831A Division JP6884403B2 (en) 2018-10-17 2018-10-17 Image processing equipment, image processing method, and image processing program

Publications (3)

Publication Number Publication Date
JP2021108222A true JP2021108222A (en) 2021-07-29
JP2021108222A5 JP2021108222A5 (en) 2021-11-18
JP7246103B2 JP7246103B2 (en) 2023-03-27

Family

ID=70387258

Family Applications (2)

Application Number Title Priority Date Filing Date
JP2018195831A Active JP6884403B2 (en) 2018-10-17 2018-10-17 Image processing equipment, image processing method, and image processing program
JP2021076266A Active JP7246103B2 (en) 2018-10-17 2021-04-28 Image processing device, image processing method, and image processing program

Family Applications Before (1)

Application Number Title Priority Date Filing Date
JP2018195831A Active JP6884403B2 (en) 2018-10-17 2018-10-17 Image processing equipment, image processing method, and image processing program

Country Status (1)

Country Link
JP (2) JP6884403B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102479976B1 (en) * 2021-11-15 2022-12-20 국방과학연구소 Change detection apparatus and method for detecting changes between different aerial photographs

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004180171A (en) * 2002-11-28 2004-06-24 Fuji Xerox Co Ltd Device, method and program for processing image, and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004180171A (en) * 2002-11-28 2004-06-24 Fuji Xerox Co Ltd Device, method and program for processing image, and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102479976B1 (en) * 2021-11-15 2022-12-20 국방과학연구소 Change detection apparatus and method for detecting changes between different aerial photographs

Also Published As

Publication number Publication date
JP6884403B2 (en) 2021-06-09
JP7246103B2 (en) 2023-03-27
JP2020064448A (en) 2020-04-23

Similar Documents

Publication Publication Date Title
RU2419881C2 (en) Anisometric texture synthesis
JP3915563B2 (en) Image processing apparatus and image processing program
Parsania et al. A comparative analysis of image interpolation algorithms
US8150197B2 (en) Apparatus and method of obtaining high-resolution image
CN105427253A (en) Multi-viewpoint RGB-D image super resolution method based on non-local regression and total difference
JP7246103B2 (en) Image processing device, image processing method, and image processing program
CN115330986A (en) Partitioned rendering mode graphic processing method and system
US9514526B2 (en) Device and method for detecting angle of rotation from normal position of image
US20220020113A1 (en) Image resizing using seam carving
JP6883864B2 (en) Image processing equipment, image processing method, and image processing program
US10481774B2 (en) Area-dependent image enhancement
JP4126541B2 (en) Image processing apparatus, image processing method, image processing program, and storage medium
US11503870B2 (en) Pattern filling in garment pieces
EP3175613B1 (en) Projection apparatus, image processing apparatus, and image processing method
JP2009146150A (en) Method and device for detecting feature position
US9761152B2 (en) Method for harmonizing colors, corresponding computer program and device
JP2005312014A (en) Resolution converting method
JP5678295B2 (en) Image display processing method and image display processing apparatus
KR100587979B1 (en) Interpolation method for image enlargement based on edge and corner
US20190206025A1 (en) Image magnifying apparatus
JP4827137B2 (en) Resolution conversion processing method, image processing apparatus, image display apparatus, and program
JP4265362B2 (en) Image processing device
JP5712385B2 (en) Image display processing apparatus and image display processing method
WO2024000173A1 (en) Method and apparatus for generating mode detection model, and computer device
CN111626935B (en) Pixel map scaling method, game content generation method and device

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20211006

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20211007

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20221014

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20221018

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20221214

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230307

R150 Certificate of patent or registration of utility model

Ref document number: 7246103

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150